-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdist: don't fall over when data-dir has * in it.
Also includes some tests for sdist.
- Loading branch information
1 parent
cb36882
commit bcf1661
Showing
22 changed files
with
100 additions
and
2 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 = return () |
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 @@ | ||
blah |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/SDist/ListSources/extra-doc/blah/a.tex
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 @@ | ||
blah |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/SDist/ListSources/extra-src/blah/a.html
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 @@ | ||
blah |
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.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,11 @@ | ||
cabal-version: 2.2 | ||
name: list-sources | ||
version: 0 | ||
data-dir: data | ||
data-files: blah/*.dat | ||
extra-source-files: extra-src/blah/*.html | ||
extra-doc-files: extra-doc/blah/*.tex | ||
|
||
executable dummy | ||
default-language: Haskell2010 | ||
main-is: Main.hs |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.cabal.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 '/tmp/cabal-testsuite.included-in-sdist-c1023f76/sources' | ||
List of package sources written to file '/tmp/cabal-testsuite.included-in-sdist-c1023f76/sources' |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/SDist/ListSources/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 '/tmp/cabal-testsuite.included-in-sdist-cfee5f8f/sources' | ||
List of package sources written to file '/tmp/cabal-testsuite.included-in-sdist-cfee5f8f/sources' |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/SDist/ListSources/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,10 @@ | ||
import Control.Monad.IO.Class | ||
import System.IO.Temp (withSystemTempDirectory) | ||
import Test.Cabal.Prelude | ||
main = setupAndCabalTest $ withSystemTempDirectory "cabal-testsuite.included-in-sdist" $ \dir -> do | ||
let fn = dir </> "sources" | ||
cabal "sdist" ["--list-sources=" ++ fn] | ||
liftIO $ putStrLn =<< readFile fn | ||
assertFileDoesContain fn "data/blah/a.dat" | ||
assertFileDoesContain fn "extra-src/blah/a.html" | ||
assertFileDoesContain fn "extra-doc/blah/a.tex" |
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 @@ | ||
blah |
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 = return () |
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 @@ | ||
blah |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/SDist/StarInDataDir/included-in-sdist.cabal.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 '/tmp/cabal-testsuite.included-in-sdist-dfad8f7a/sources' | ||
List of package sources written to file '/tmp/cabal-testsuite.included-in-sdist-dfad8f7a/sources' |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/SDist/StarInDataDir/included-in-sdist.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 '/tmp/cabal-testsuite.included-in-sdist-2540730b/sources' | ||
List of package sources written to file '/tmp/cabal-testsuite.included-in-sdist-2540730b/sources' |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/SDist/StarInDataDir/included-in-sdist.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 System.IO.Temp (withSystemTempDirectory) | ||
import Test.Cabal.Prelude | ||
main = setupAndCabalTest $ withSystemTempDirectory "cabal-testsuite.included-in-sdist" $ \dir -> do | ||
let fn = dir </> "sources" | ||
cabal "sdist" ["--list-sources=" ++ fn] | ||
assertFileDoesContain fn "*/a.dat" | ||
assertFileDoesNotContain fn "a/a.dat" |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/SDist/StarInDataDir/star-in-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,9 @@ | ||
cabal-version: 2.2 | ||
name: star-in-data-dir | ||
version: 0 | ||
data-dir: * | ||
data-files: *.dat | ||
|
||
executable dummy | ||
default-language: Haskell2010 | ||
main-is: Main.hs |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/SDist/StarInDataDir/warning-issued.cabal.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,12 @@ | ||
# cabal sdist | ||
Distribution quality errors: | ||
No 'synopsis' or 'description' field. | ||
The 'license' field is missing or is NONE. | ||
Using a '*' character in 'data-dir', like *, can behave erratically with prior versions of Cabal. It is recommended that you set 'cabal-version: 3.0' to exclude old versions. | ||
Distribution quality warnings: | ||
No 'category' field. | ||
No 'maintainer' field. | ||
Note: the public hackage server would reject this package. | ||
Warning: Cannot run preprocessors. Run 'configure' command first. | ||
Building source dist for star-in-data-dir-0... | ||
Source tarball created: <ROOT>/warning-issued.cabal.dist/work/./dist/star-in-data-dir-0.tar.gz |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/SDist/StarInDataDir/warning-issued.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,12 @@ | ||
# cabal sdist | ||
Distribution quality errors: | ||
No 'synopsis' or 'description' field. | ||
The 'license' field is missing or is NONE. | ||
Using a '*' character in 'data-dir', like *, can behave erratically with prior versions of Cabal. It is recommended that you set 'cabal-version: 3.0' to exclude old versions. | ||
Distribution quality warnings: | ||
No 'category' field. | ||
No 'maintainer' field. | ||
Note: the public hackage server would reject this package. | ||
Warning: Cannot run preprocessors. Run 'configure' command first. | ||
Building source dist for star-in-data-dir-0... | ||
Source tarball created: <ROOT>/warning-issued.dist/work/./dist/star-in-data-dir-0.tar.gz |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/SDist/StarInDataDir/warning-issued.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,4 @@ | ||
import Test.Cabal.Prelude | ||
main = setupAndCabalTest $ do | ||
output <- cabal' "sdist" [] | ||
assertOutputContains "Using a '*' character in 'data-dir'" output |
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