[commit: Cabal] master: Fix the urls for the new hackage server (621dcff)
Ian Lynagh
igloo at earth.li
Fri Jun 24 01:57:50 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/621dcffbb5161def8f868066abd39d9831d8ba24
>---------------------------------------------------------------
commit 621dcffbb5161def8f868066abd39d9831d8ba24
Author: Duncan Coutts <duncan at haskell.org>
Date: Fri Aug 8 15:19:57 2008 +0000
Fix the urls for the new hackage server
>---------------------------------------------------------------
cabal-install/Distribution/Client/Fetch.hs | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/cabal-install/Distribution/Client/Fetch.hs b/cabal-install/Distribution/Client/Fetch.hs
index c79e1c3..1f2f792 100644
--- a/cabal-install/Distribution/Client/Fetch.hs
+++ b/cabal-install/Distribution/Client/Fetch.hs
@@ -41,7 +41,7 @@ import Distribution.Simple.Program
import Distribution.Simple.Configure
( getInstalledPackages )
import Distribution.Simple.Utils
- ( die, notice, debug, setupMessage, intercalate
+ ( die, notice, debug, setupMessage
, copyFileVerbose, writeFileAtomic )
import Distribution.System
( buildOS, buildArch )
@@ -56,6 +56,8 @@ import System.Directory
( doesFileExist, createDirectoryIfMissing )
import System.FilePath
( (</>), (<.>) )
+import qualified System.FilePath.Posix as FilePath.Posix
+ ( combine, joinPath )
import Network.URI
( URI(uriScheme, uriPath) )
import Network.HTTP
@@ -103,7 +105,7 @@ downloadIndex :: Verbosity -> RemoteRepo -> FilePath -> IO FilePath
downloadIndex verbosity repo cacheDir = do
let uri = (remoteRepoURI repo) {
uriPath = uriPath (remoteRepoURI repo)
- ++ "/" ++ "00-index.tar.gz"
+ `FilePath.Posix.combine` "00-index.tar.gz"
}
path = cacheDir </> "00-index" <.> "tar.gz"
createDirectoryIfMissing True cacheDir
@@ -170,8 +172,9 @@ packageDir repo pkgid = repoLocalDir repo
packageURI :: RemoteRepo -> PackageIdentifier -> URI
packageURI repo pkgid =
(remoteRepoURI repo) {
- uriPath = intercalate "/"
- [uriPath (remoteRepoURI repo) ,
- pkgName pkgid, display (pkgVersion pkgid),
- display pkgid ++ ".tar.gz"]
+ uriPath = FilePath.Posix.joinPath
+ [uriPath (remoteRepoURI repo)
+ ,"packages"
+ ,display pkgid
+ ,"tarball"]
}
More information about the Cvs-libraries
mailing list