diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/Configure.hs | 5 | ||||
-rw-r--r-- | Build/DistributionUpdate.hs | 26 | ||||
-rwxr-xr-x | Build/make-sdist.sh | 7 |
3 files changed, 32 insertions, 6 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs index 116a44215..c5e3b9735 100644 --- a/Build/Configure.hs +++ b/Build/Configure.hs @@ -7,6 +7,7 @@ import Control.Applicative import System.Environment (getArgs) import Control.Monad.IfElse import Control.Monad +import System.IO import Build.TestConfig import Build.Version @@ -62,7 +63,11 @@ shaTestCases l = map make l key = "sha" ++ show n search [] = return Nothing search (c:cmds) = do + putStr $ "(" ++ c + hFlush stdout sha <- externalSHA c n "/dev/null" + putStr $ ":" ++ show sha ++ ")" + hFlush stdout if sha == Right knowngood then return $ Just c else search cmds diff --git a/Build/DistributionUpdate.hs b/Build/DistributionUpdate.hs index a681ec2ed..3a4c550b0 100644 --- a/Build/DistributionUpdate.hs +++ b/Build/DistributionUpdate.hs @@ -1,6 +1,9 @@ {- Builds distributon info files for each git-annex release in a directory - tree, which must itself be part of a git-annex repository. Only files - - that are present have their info file created. -} + - that are present have their info file created. + - + - Also gpg signs the files. + -} import Common.Annex import Types.Distribution @@ -15,6 +18,10 @@ import Git.Command import Data.Time.Clock +-- git-annex distribution signing key (for Joey Hess) +signingKey :: String +signingKey = "89C809CB" + main = do state <- Annex.new =<< Git.Construct.fromPath =<< getRepoDir Annex.eval state makeinfos @@ -36,7 +43,7 @@ makeinfos = do v <- lookupFile f case v of Nothing -> noop - Just (k, _b) -> whenM (inAnnex k) $ do + Just k -> whenM (inAnnex k) $ do liftIO $ putStrLn f let infofile = f ++ ".info" liftIO $ writeFile infofile $ show $ GitAnnexDistribution @@ -46,7 +53,9 @@ makeinfos = do , distributionReleasedate = now , distributionUrgentUpgrade = Nothing } - void $ inRepo $ runBool [Param "add", Param infofile] + void $ inRepo $ runBool [Param "add", File infofile] + signFile infofile + signFile f void $ inRepo $ runBool [ Param "commit" , Param "-m" @@ -81,3 +90,14 @@ getRepoDir = do mkUrl :: FilePath -> FilePath -> String mkUrl basedir f = "https://downloads.kitenet.net/" ++ relPathDirToFile basedir f + +signFile :: FilePath -> Annex () +signFile f = do + void $ liftIO $ boolSystem "gpg" + [ Param "-a" + , Param $ "--default-key=" ++ signingKey + , Param "--sign" + , File f + ] + liftIO $ rename (f ++ ".asc") (f ++ ".sig") + void $ inRepo $ runBool [Param "add", File (f ++ ".sig")] diff --git a/Build/make-sdist.sh b/Build/make-sdist.sh index 950334532..6e1ddae62 100755 --- a/Build/make-sdist.sh +++ b/Build/make-sdist.sh @@ -9,11 +9,12 @@ mkdir --parents dist/$sdist_dir find . \( -name .git -or -name dist -or -name cabal-dev \) -prune \ -or -not -name \\*.orig -not -type d -print \ -| perl -ne "print unless length >= 100 - length q{$sdist_dir}" \ -| xargs cp --parents --target-directory dist/$sdist_dir + | perl -ne "print unless length >= 100 - length q{$sdist_dir}" \ + | grep -v ':' \ + | xargs cp --parents --target-directory dist/$sdist_dir cd dist -tar -caf $sdist_dir.tar.gz $sdist_dir +tar --format=ustar -caf $sdist_dir.tar.gz $sdist_dir # Check that tarball can be unpacked by cabal. # It's picky about tar longlinks etc. |