Commit c3ccc1c5 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix a bug where the destdir prefix got included in the prog prefix and suffix

Previously all members of InstallDirs were paths so it was safe to prefix
them all with the destdir, but now we've also got these two non-paths, so
we have to not apply the prefix to them. Perhaps the program prefix and suffix
should just be PathTemplates on their own and not part of InstallDirs.
Reported by MarcWeber while hacking on Haskell packages for Nix.
parent 4305e089
...@@ -313,7 +313,13 @@ absoluteInstallDirs :: PackageIdentifier -> PackageIdentifier -> CopyDest ...@@ -313,7 +313,13 @@ absoluteInstallDirs :: PackageIdentifier -> PackageIdentifier -> CopyDest
-> InstallDirTemplates -> InstallDirs FilePath -> InstallDirTemplates -> InstallDirs FilePath
absoluteInstallDirs pkgId compilerId copydest dirs = absoluteInstallDirs pkgId compilerId copydest dirs =
(case copydest of (case copydest of
CopyTo destdir -> fmap ((destdir </>) . dropDrive) CopyTo destdir -> \dirs -> (fmap ((destdir </>) . dropDrive) dirs) {
-- We add the destdir to all the paths, but the
-- program prefix and suffix are not paths, so we
-- keep their old values:
progprefix = progprefix dirs,
progsuffix = progsuffix dirs
}
_ -> id) _ -> id)
. appendSubdirs (</>) . appendSubdirs (</>)
. fmap fromPathTemplate . fmap fromPathTemplate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment