From 648827861024783ef6fa9c03e8ca5210c68fc7cb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 2 Jul 2011 14:53:55 -0400 Subject: cabal sdist: plan C --- Makefile | 8 ++++++++ configure.hs | 14 -------------- git-annex.cabal | 1 + "testdata/unicode-test-\303\266" | 1 - 4 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 "testdata/unicode-test-\303\266" diff --git a/Makefile b/Makefile index 0bc02dc35..afd2de99e 100644 --- a/Makefile +++ b/Makefile @@ -87,4 +87,12 @@ clean: rm -rf doc/.ikiwiki html dist find . \( -name \*.o -or -name \*.hi \) -exec rm {} \; +# Workaround for cabal sdist not running Setup hooks, so I cannot +# generate a file list there. +sdist: clean + @if [ ! -e git-annex.cabal.orig ]; then cp git-annex.cabal git-annex.cabal.orig; fi + @sed -e "s!\(Extra-Source-Files: \).*!\1$(shell find . -name .git -prune -or -not -name \\*.orig -type f -print)!i" < git-annex.cabal.orig > git-annex.cabal + @cabal sdist + @mv git-annex.cabal.orig git-annex.cabal + .PHONY: $(bins) test install diff --git a/configure.hs b/configure.hs index d47dddf1d..8639af44b 100644 --- a/configure.hs +++ b/configure.hs @@ -17,7 +17,6 @@ tests = , TestCase "curl" $ testCmd "curl" "curl --version >/dev/null" , TestCase "bup" $ testCmd "bup" "bup --version >/dev/null" , TestCase "gpg" $ testCmd "gpg" "gpg --version >/dev/null" - , TestCase "unicode FilePath support" $ unicodeFilePath ] ++ shaTestCases [1, 256, 512, 224, 384] shaTestCases :: [Int] -> [TestCase] @@ -40,19 +39,6 @@ testCp k option = TestCase cmd $ testCmd k run cmd = "cp " ++ option run = cmd ++ " " ++ testFile ++ " " ++ testFile ++ ".new" -{- Checks if FilePaths contain decoded unicode, or not. The testdata - - directory contains a "unicode-test-ü" file; try to find the file, - - and see if the "ü" is encoded correctly. - - - - Note that the file is shipped with git-annex, rather than created, - - to avoid other potential unicode issues. - -} -unicodeFilePath :: Test -unicodeFilePath = do - fs <- getDirectoryContents "testdata" - let file = head $ filter (isInfixOf "unicode-test") fs - return $ Config "unicodefilepath" (BoolConfig $ isInfixOf "ü" file) - {- Pulls package version out of the changelog. -} getVersion :: Test getVersion = do diff --git a/git-annex.cabal b/git-annex.cabal index fab2c71b9..59220f47b 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -7,6 +7,7 @@ Author: Joey Hess Stability: Stable Copyright: 2010-2011 Joey Hess License-File: GPL +Extra-Source-Files: use-make-sdist-instead Homepage: http://git-annex.branchable.com/ Build-type: Custom Category: Utility diff --git "a/testdata/unicode-test-\303\266" "b/testdata/unicode-test-\303\266" deleted file mode 100644 index 45b983be3..000000000 --- "a/testdata/unicode-test-\303\266" +++ /dev/null @@ -1 +0,0 @@ -hi -- cgit v1.2.3