forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR haskell#5284 changed things around, and now matchDirFileGlob will break if it's passed a null directory, which happens to be the default value for data-dir. Its call sites have been fixed to check for this and to substitute '.' for an empty path, which is the desired behaviour; in addition, matchDirFileGlob itself will now warn about this if it's detected, so that new broken call sites can't sneak in. Fixes haskell#5318.
- Loading branch information
1 parent
765de7b
commit c8af0a4
Showing
10 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = putStrLn "hi" |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/Regression/T5318/empty-data-dir.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cabal-version: 2.0 | ||
name: empty-data-dir | ||
version: 0 | ||
build-type: Simple | ||
data-files: foo.dat | ||
|
||
executable foo | ||
default-language: Haskell2010 | ||
build-depends: base | ||
main-is: Main.hs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# cabal install | ||
Resolving dependencies... | ||
Configuring empty-data-dir-0... | ||
Preprocessing executable 'foo' for empty-data-dir-0.. | ||
Building executable 'foo' for empty-data-dir-0.. | ||
Installing executable foo in <PATH> | ||
Warning: The directory <ROOT>/install.dist/home/.cabal/bin is not in the system search path. | ||
Installed empty-data-dir-0 |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Regression/T5318/install.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ | ||
cabal "install" [] |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Regression/T5318/sdist-list-sources.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cabal sdist | ||
List of package sources written to file '<TMPDIR>/sources' | ||
List of package sources written to file '<TMPDIR>/sources' |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/Regression/T5318/sdist-list-sources.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
tmpdir <- fmap testTmpDir getTestEnv | ||
let fn = tmpdir </> "sources" | ||
cabal "sdist" ["--list-sources=" ++ fn] | ||
-- --list-sources outputs with slashes on posix and backslashes on Windows. 'normalise' converts our needle to the necessary format. | ||
assertFileDoesContain fn $ normalise "foo.dat" |