[commit: ghc] ghc-8.0: ghc-pkg: Drop trailing slashes in computing db paths (f3bca8f)

git at git.haskell.org git at git.haskell.org
Fri Jul 8 14:12:56 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/f3bca8f124f0f2d5e26dac083b1fe2d3ad69242a/ghc

>---------------------------------------------------------------

commit f3bca8f124f0f2d5e26dac083b1fe2d3ad69242a
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Jun 20 09:25:05 2016 +0200

    ghc-pkg: Drop trailing slashes in computing db paths
    
    Test Plan: Validate, try tests in ticket
    
    Reviewers: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2336
    
    GHC Trac Issues: #12194
    
    (cherry picked from commit f68d40cbfc832a1dfc7742d02f76129ed80506e4)


>---------------------------------------------------------------

f3bca8f124f0f2d5e26dac083b1fe2d3ad69242a
 utils/ghc-pkg/Main.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index af3032d..a105ab3 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -789,7 +789,7 @@ mungePackageDBPaths :: FilePath -> PackageDB -> PackageDB
 mungePackageDBPaths top_dir db at PackageDB { packages = pkgs } =
     db { packages = map (mungePackagePaths top_dir pkgroot) pkgs }
   where
-    pkgroot = takeDirectory (locationAbsolute db)
+    pkgroot = takeDirectory $ dropTrailingPathSeparator (locationAbsolute db)
     -- It so happens that for both styles of package db ("package.conf"
     -- files and "package.conf.d" dirs) the pkgroot is the parent directory
     -- ${pkgroot}/package.conf  or  ${pkgroot}/package.conf.d/



More information about the ghc-commits mailing list