summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-05-24 01:34:17 -0400
committerJoey Hess <joeyh@joeyh.name>2016-05-24 01:34:17 -0400
commitc80dce468b0660387e71e66743920b284c04f720 (patch)
tree84015ceeafc5fe58a73c1b4dd32f6238b9313435 /Build
parentc86fb48e2fe685434558c0ccfc27d093ce741835 (diff)
downloadgit-repair-c80dce468b0660387e71e66743920b284c04f720.tar.gz
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.
Diffstat (limited to 'Build')
-rw-r--r--Build/Version.hs12
-rwxr-xr-xBuild/make-sdist.sh21
2 files changed, 7 insertions, 26 deletions
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