Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleanup in merge

  • Loading branch information...
commit f56d5083b6d20e66589800e50aaaedc215a24bf9 1 parent fa219c2
Lennart Kolmodin kolmodin authored

Showing 1 changed file with 9 additions and 8 deletions. Show diff stats Hide diff stats

  1. +9 8 Merge.hs
17 Merge.hs
@@ -38,6 +38,9 @@ import Network.HTTP
38 38
39 39 import Cabal2Ebuild
40 40
  41 +a <-> b = a ++ '-':b
  42 +a <.> b = a ++ '.':b
  43 +
41 44 merge :: Verbosity -> URI -> String -> IO ()
42 45 merge verbosity serverURI pstr = do
43 46 (m_category, Portage.PN pname, m_version) <- case Portage.parseFriendlyPackage pstr of
@@ -79,16 +82,13 @@ merge verbosity serverURI pstr = do
79 82 (CompilerId GHC (Version [6,8,2] []))
80 83 [] genericDesc
81 84 let ebuild = fixSrc serverURI (packageId desc) (E.cabal2ebuild desc)
82   - ebuildName = category ++ '/': pname ++ "-" ++ display (pkgVersion (packageId desc))
  85 + ebuildName = category </> pname <-> display (pkgVersion (packageId desc))
83 86 putStrLn $ "Merging " ++ ebuildName
84 87 putStrLn $ "Destination: " ++ overlayPath
85 88 mergeEbuild overlayPath category ebuild
86   - let package_name = pkgName (package desc)
87   - package_version = showVersion (pkgVersion (package desc))
88   - print genericDesc
89 89 let
90   - a <-> b = a ++ '-':b
91   - a <.> b = a ++ '.':b
  90 + package_name = pkgName (package desc)
  91 + package_version = showVersion (pkgVersion (package desc))
92 92 url = "http://hackage.haskell.org/packages/archive/"
93 93 </> package_name </> package_version </> package_name <-> package_version <.> "tar.gz"
94 94 Just uri = parseURI url
@@ -108,14 +108,15 @@ fetchAndDigest :: Verbosity
108 108 -> IO ()
109 109 fetchAndDigest verbosity ebuildDir tarballName tarballURI = do
110 110 withWorkingDirectory ebuildDir $ do
111   - notice verbosity $ "Fetching " ++ show tarballURI ++ " ..."
  111 + notice verbosity $ "Fetching " ++ show tarballURI
112 112 response <- simpleHTTP (Request tarballURI GET [] "")
113 113 case response of
114 114 Left err -> print err
115 115 Right response -> do
116 116 let tarDestination = "/usr/portage/distfiles" </> tarballName
117   - notice verbosity $ "Writing to " ++ tarDestination
  117 + notice verbosity $ "Saving to " ++ tarDestination
118 118 writeFile tarDestination (rspBody response)
  119 + notice verbosity $ "Recalculating digests..."
119 120 system "repoman manifest"
120 121 return ()
121 122

0 comments on commit f56d508

Please sign in to comment.
Something went wrong with that request. Please try again.