From c80dce468b0660387e71e66743920b284c04f720 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 May 2016 01:34:17 -0400 Subject: Updated cabal file explictly lists source files. The tarball on hackage will include only the files needed for cabal install; it is NOT the full git-repair source tree. debian/changelog: Converted to symlinks to CHANGELOG. --- Build/Version.hs | 12 +++--- Build/make-sdist.sh | 21 ---------- CHANGELOG | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++- Makefile | 2 +- Setup.hs | 2 + configure.hs | 6 --- debian/changelog | 112 +------------------------------------------------- git-repair.cabal | 79 +++++++++++++++++++++++++++++++---- 8 files changed, 198 insertions(+), 152 deletions(-) delete mode 100755 Build/make-sdist.sh mode change 120000 => 100644 CHANGELOG delete mode 100644 configure.hs mode change 100644 => 120000 debian/changelog diff --git a/Build/Version.hs b/Build/Version.hs index da9d1bb..d39a0fe 100644 --- a/Build/Version.hs +++ b/Build/Version.hs @@ -1,24 +1,26 @@ {- Package version determination, for configure script. -} +{-# OPTIONS_GHC -fno-warn-tabs #-} + module Build.Version where -import Data.Maybe -import Control.Applicative import Data.List import System.Environment -import System.Directory import Data.Char import System.Process +import Control.Applicative +import Prelude import Utility.Monad import Utility.Exception +import Utility.Directory type Version = String {- Set when making an official release. (Distribution vendors should set - this too.) -} isReleaseBuild :: IO Bool -isReleaseBuild = isJust <$> catchMaybeIO (getEnv "RELEASE_BUILD") +isReleaseBuild = (== Just "1") <$> catchMaybeIO (getEnv "RELEASE_BUILD") {- Version is usually based on the major version from the changelog, - plus the date of the last commit, plus the git rev of that commit. @@ -44,7 +46,7 @@ getVersion = do getChangelogVersion :: IO Version getChangelogVersion = do - changelog <- readFile "debian/changelog" + changelog <- readFile "CHANGELOG" let verline = takeWhile (/= '\n') changelog return $ middle (words verline !! 1) where diff --git a/Build/make-sdist.sh b/Build/make-sdist.sh deleted file mode 100755 index d4dbdb9..0000000 --- a/Build/make-sdist.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# Workaround for `cabal sdist` requiring all included files to be listed -# in .cabal. - -# Create target directory -sdist_dir=git-repair-$(grep '^Version:' git-repair.cabal | sed -re 's/Version: *//') -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 - -cd dist -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. -rm -rf $sdist_dir -cabal unpack $sdist_dir.tar.gz diff --git a/CHANGELOG b/CHANGELOG deleted file mode 120000 index d526672..0000000 --- a/CHANGELOG +++ /dev/null @@ -1 +0,0 @@ -debian/changelog \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..94f0743 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,115 @@ +git-repair (1.20151216) UNRELEASED; urgency=medium + + * git-repair.cabal: Add Setup-Depends. + * Updated cabal file explictly lists source files. The tarball + on hackage will include only the files needed for cabal install; + it is NOT the full git-repair source tree. + * debian/changelog: Converted to symlinks to CHANGELOG. + + -- Joey Hess Wed, 04 May 2016 12:16:33 -0400 + +git-repair (1.20151215) unstable; urgency=medium + + * Fix insecure temporary permissions and potential denial of + service attack when creating temp dirs. Closes: #807341 + * Merge from git-annex. + + -- Joey Hess Tue, 15 Dec 2015 20:47:59 -0400 + +git-repair (1.20150106) unstable; urgency=medium + + * Debian package is now maintained by Richard Hartmann. + * Fix build with process 1.2.1.0. + * Merge from git-annex. + + -- Joey Hess Tue, 06 Jan 2015 19:09:23 -0400 + +git-repair (1.20141027) unstable; urgency=medium + + * Adjust cabal file to support network-uri split. + * Merge Build/ from git-annex, including removing a use of deprecated + System.Cmd. + + -- Joey Hess Mon, 27 Oct 2014 11:09:56 -0400 + +git-repair (1.20141026) unstable; urgency=medium + + * Prevent auto gc from happening when fetching from a remote. + * Merge from git-annex. + + -- Joey Hess Sun, 26 Oct 2014 13:37:30 -0400 + +git-repair (1.20140914) unstable; urgency=medium + + * Update to build with optparse-applicative 0.10. Closes: #761552 + + -- Joey Hess Sun, 14 Sep 2014 12:48:27 -0400 + +git-repair (1.20140815) unstable; urgency=medium + + * Removing bad objects could leave fsck finding no more unreachable objects, + but some branches no longer accessible. Fix this, including support for + fixing up repositories that were incompletely repaired before. + * Merge from git-annex. + + -- Joey Hess Fri, 15 Aug 2014 13:49:09 -0400 + +git-repair (1.20140423) unstable; urgency=medium + + * Improve memory usage when git fsck finds a great many broken objects. + * Merge from git-annex. + + -- Joey Hess Wed, 23 Apr 2014 14:01:30 -0400 + +git-repair (1.20140227) unstable; urgency=medium + + * Optimise unpacking of pack files, and avoid repeated error + messages about corrupt pack files. + * Add swapping 2 files test case. + + -- Joey Hess Thu, 27 Feb 2014 11:56:27 -0400 + +git-repair (1.20140115) unstable; urgency=medium + + * Support old git versions from before git fsck --no-dangling was + implemented. + * Fix bug in packed refs file exploding code that caused a .gitrefs + directory to be created instead of .git/refs + * Check git version at run time. + + -- Joey Hess Wed, 15 Jan 2014 16:53:30 -0400 + +git-repair (1.20131213) unstable; urgency=low + + * Improve repair of index files in some situations. + + -- Joey Hess Fri, 13 Dec 2013 14:51:51 -0400 + +git-repair (1.20131203) unstable; urgency=low + + * Fix build deps. Closes: #731179 + + -- Joey Hess Tue, 03 Dec 2013 15:02:21 -0400 + +git-repair (1.20131122) unstable; urgency=low + + * Added test mode, which can be used to randomly corrupt test + repositories, in reproducible ways, which allows easy + corruption-driven-development. + * Improve repair code in the case where the index file is corrupt, + and this hides other problems. + * Write a dummy .git/HEAD if the file is missing or corrupt, as + git otherwise will not treat the repository as a git repo. + * Improve fsck code to find badly corrupted objects that crash git fsck + before it can complain about them. + * Fixed crashes on bad file encodings. + * Can now run 10000 tests (git-repair --test -n 10000 --force) + with 0 failures. + + -- Joey Hess Fri, 22 Nov 2013 11:16:03 -0400 + +git-repair (1.20131118) unstable; urgency=low + + * First release + + -- Joey Hess Mon, 18 Nov 2013 13:38:12 -0400 diff --git a/Makefile b/Makefile index dcdcbbb..19312be 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ clean: # Upload to hackage. hackage: clean - ./Build/make-sdist.sh + @cabal sdist @cabal upload dist/*.tar.gz # hothasktags chokes on some template haskell etc, so ignore errors diff --git a/Setup.hs b/Setup.hs index 03c23a3..b5603f8 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-tabs #-} + {- cabal setup file -} import Distribution.Simple diff --git a/configure.hs b/configure.hs deleted file mode 100644 index 15833e6..0000000 --- a/configure.hs +++ /dev/null @@ -1,6 +0,0 @@ -{- configure program -} - -import Build.Configure - -main :: IO () -main = run tests diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 395b4dc..0000000 --- a/debian/changelog +++ /dev/null @@ -1,111 +0,0 @@ -git-repair (1.20151216) UNRELEASED; urgency=medium - - * git-repair.cabal: Add Setup-Depends. - - -- Joey Hess Wed, 04 May 2016 12:16:33 -0400 - -git-repair (1.20151215) unstable; urgency=medium - - * Fix insecure temporary permissions and potential denial of - service attack when creating temp dirs. Closes: #807341 - * Merge from git-annex. - - -- Joey Hess Tue, 15 Dec 2015 20:47:59 -0400 - -git-repair (1.20150106) unstable; urgency=medium - - * Debian package is now maintained by Richard Hartmann. - * Fix build with process 1.2.1.0. - * Merge from git-annex. - - -- Joey Hess Tue, 06 Jan 2015 19:09:23 -0400 - -git-repair (1.20141027) unstable; urgency=medium - - * Adjust cabal file to support network-uri split. - * Merge Build/ from git-annex, including removing a use of deprecated - System.Cmd. - - -- Joey Hess Mon, 27 Oct 2014 11:09:56 -0400 - -git-repair (1.20141026) unstable; urgency=medium - - * Prevent auto gc from happening when fetching from a remote. - * Merge from git-annex. - - -- Joey Hess Sun, 26 Oct 2014 13:37:30 -0400 - -git-repair (1.20140914) unstable; urgency=medium - - * Update to build with optparse-applicative 0.10. Closes: #761552 - - -- Joey Hess Sun, 14 Sep 2014 12:48:27 -0400 - -git-repair (1.20140815) unstable; urgency=medium - - * Removing bad objects could leave fsck finding no more unreachable objects, - but some branches no longer accessible. Fix this, including support for - fixing up repositories that were incompletely repaired before. - * Merge from git-annex. - - -- Joey Hess Fri, 15 Aug 2014 13:49:09 -0400 - -git-repair (1.20140423) unstable; urgency=medium - - * Improve memory usage when git fsck finds a great many broken objects. - * Merge from git-annex. - - -- Joey Hess Wed, 23 Apr 2014 14:01:30 -0400 - -git-repair (1.20140227) unstable; urgency=medium - - * Optimise unpacking of pack files, and avoid repeated error - messages about corrupt pack files. - * Add swapping 2 files test case. - - -- Joey Hess Thu, 27 Feb 2014 11:56:27 -0400 - -git-repair (1.20140115) unstable; urgency=medium - - * Support old git versions from before git fsck --no-dangling was - implemented. - * Fix bug in packed refs file exploding code that caused a .gitrefs - directory to be created instead of .git/refs - * Check git version at run time. - - -- Joey Hess Wed, 15 Jan 2014 16:53:30 -0400 - -git-repair (1.20131213) unstable; urgency=low - - * Improve repair of index files in some situations. - - -- Joey Hess Fri, 13 Dec 2013 14:51:51 -0400 - -git-repair (1.20131203) unstable; urgency=low - - * Fix build deps. Closes: #731179 - - -- Joey Hess Tue, 03 Dec 2013 15:02:21 -0400 - -git-repair (1.20131122) unstable; urgency=low - - * Added test mode, which can be used to randomly corrupt test - repositories, in reproducible ways, which allows easy - corruption-driven-development. - * Improve repair code in the case where the index file is corrupt, - and this hides other problems. - * Write a dummy .git/HEAD if the file is missing or corrupt, as - git otherwise will not treat the repository as a git repo. - * Improve fsck code to find badly corrupted objects that crash git fsck - before it can complain about them. - * Fixed crashes on bad file encodings. - * Can now run 10000 tests (git-repair --test -n 10000 --force) - with 0 failures. - - -- Joey Hess Fri, 22 Nov 2013 11:16:03 -0400 - -git-repair (1.20131118) unstable; urgency=low - - * First release - - -- Joey Hess Mon, 18 Nov 2013 13:38:12 -0400 diff --git a/debian/changelog b/debian/changelog new file mode 120000 index 0000000..a535994 --- /dev/null +++ b/debian/changelog @@ -0,0 +1 @@ +../CHANGELOG \ No newline at end of file diff --git a/git-repair.cabal b/git-repair.cabal index 25f0f2e..5076fbd 100644 --- a/git-repair.cabal +++ b/git-repair.cabal @@ -7,7 +7,6 @@ Author: Joey Hess Stability: Stable Copyright: 2013 Joey Hess License-File: GPL -Extra-Source-Files: CHANGELOG Build-Type: Custom Homepage: http://git-repair.branchable.com/ Category: Utility @@ -21,11 +20,24 @@ Description: As well as avoiding the need to rm -rf a damaged repository and re-clone, using git-repair can help rescue commits you've made to the damaged repository and not yet pushed out. +Extra-Source-Files: + CHANGELOG + TODO + git-repair.1 Flag network-uri Description: Get Network.URI from the network-uri package Default: True +custom-setup + Setup-Depends: base (>= 4.5), hslogger, MissingH, unix-compat, process, + unix, filepath, exceptions, bytestring, directory, IfElse, data-default, + Cabal + +source-repository head + type: git + location: git://git-repair.branchable.com/ + Executable git-repair Main-Is: git-repair.hs GHC-Options: -threaded -Wall -fno-warn-tabs @@ -44,9 +56,62 @@ Executable git-repair else Build-Depends: unix -custom-setup - Setup-Depends: base (>= 4.5), hslogger, MissingH - -source-repository head - type: git - location: git://git-repair.branchable.com/ + Other-Modules: + Build.Configure + Build.TestConfig + Build.Version + Common + Git + Git.Branch + Git.BuildVersion + Git.CatFile + Git.Command + Git.Config + Git.Construct + Git.CurrentRepo + Git.Destroyer + Git.DiffTreeItem + Git.FilePath + Git.Filename + Git.Fsck + Git.Index + Git.LsFiles + Git.LsTree + Git.Objects + Git.Ref + Git.RefLog + Git.Remote + Git.Repair + Git.Sha + Git.Types + Git.UpdateIndex + Git.Url + Git.Version + Utility.Applicative + Utility.Batch + Utility.CoProcess + Utility.Data + Utility.Directory + Utility.DottedVersion + Utility.Env + Utility.Exception + Utility.FileMode + Utility.FileSize + Utility.FileSystemEncoding + Utility.Format + Utility.Metered + Utility.Misc + Utility.Monad + Utility.PartialPrelude + Utility.Path + Utility.PosixFiles + Utility.Process + Utility.Process.Shim + Utility.QuickCheck + Utility.Rsync + Utility.SafeCommand + Utility.SystemDirectory + Utility.ThreadScheduler + Utility.Tmp + Utility.URI + Utility.UserInfo -- cgit v1.2.3