Commit 75bfe09c authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Make misc/gen-extra-source-files.sh edit the Cabal.cabal file directly.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 4cd6ef0b
......@@ -15,6 +15,7 @@ dist-*
/Cabal/dist/
/Cabal/tests/Setup
/Cabal/Setup
/Cabal/misc/source-file-list
/cabal-install/dist/
/cabal-install/Setup
......
......@@ -29,7 +29,9 @@ extra-source-files:
doc/installing-packages.markdown
doc/misc.markdown
-- Generated with 'misc/gen-extra-source-files.sh' & 'M-x sort-lines':
-- Generated with 'misc/gen-extra-source-files.sh'
-- Do NOT edit this section manually; instead, run the script.
-- BEGIN gen-extra-source-files
tests/PackageTests/BenchmarkExeV10/Foo.hs
tests/PackageTests/BenchmarkExeV10/benchmarks/bench-Foo.hs
tests/PackageTests/BenchmarkExeV10/my.cabal
......@@ -120,6 +122,7 @@ extra-source-files:
tests/PackageTests/TestSuiteTests/LibV09/Lib.hs
tests/PackageTests/TestSuiteTests/LibV09/LibV09.cabal
tests/PackageTests/TestSuiteTests/LibV09/tests/Deadlock.hs
tests/PackageTests/Tests.hs
tests/PackageTests/UniqueIPID/P1/M.hs
tests/PackageTests/UniqueIPID/P1/my.cabal
tests/PackageTests/UniqueIPID/P2/M.hs
......@@ -133,6 +136,7 @@ extra-source-files:
tests/hackage/download.sh
tests/hackage/unpack.sh
tests/misc/ghc-supported-languages.hs
-- END gen-extra-source-files
source-repository head
type: git
......
#! /bin/sh
#!/bin/sh
find tests -type f \( -name '*.hs' -or -name '*.lhs' -or -name '*.c' -or -name '*.sh' \
-or -name '*.cabal' -or -name '*.hsc' \) -and -not -regex ".*/dist/.*" \
| awk '/Check.hs$|UnitTests|PackageTester|autogen|PackageTests.hs|CreatePipe/ { next } { print }'
| awk '/Check.hs$|UnitTests|PackageTester|autogen|PackageTests.hs|CreatePipe/ { next } { print }' \
| LC_COLLATE=C sort \
| sed -e 's/^/ /' \
> misc/source-file-list
lead='^ -- BEGIN gen-extra-source-files'
tail='^ -- END gen-extra-source-files'
# cribbed off of http://superuser.com/questions/440013/how-to-replace-part-of-a-text-file-between-markers-with-another-text-file
sed -i.bak -e "/$lead/,/$tail/{ /$lead/{p; r misc/source-file-list
}; /$tail/p; d }" Cabal.cabal
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