[pkg-haskell-tools] 01/02: New script: cabal-debian (wrapper around cabal-debian)
Joachim Breitner
nomeata at moszumanska.debian.org
Sat Aug 15 16:29:04 UTC 2015
This is an automated email from the git hooks/post-receive script.
nomeata pushed a commit to branch master
in repository pkg-haskell-tools.
commit b4a8e45db714a9dc3bca0a117a6edc4a81826e13
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sat Aug 15 18:09:59 2015 +0200
New script: cabal-debian (wrapper around cabal-debian)
---
debian/changelog | 1 +
scripts/cabal-debian | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
scripts/upgrade | 19 ++-----------------
3 files changed, 52 insertions(+), 17 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index b3fb2e2..a82f807 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ pkg-haskell-tools (0.7) UNRELEASED; urgency=medium
* Do not run changestool if sbuild already failed
* make-all: Run shake with progress reporting enabled
+ * New script: cabal-debian (wrapper around cabal-debian)
-- Joachim Breitner <nomeata at debian.org> Thu, 13 Aug 2015 21:05:00 +0200
diff --git a/scripts/cabal-debian b/scripts/cabal-debian
new file mode 100755
index 0000000..a9d3659
--- /dev/null
+++ b/scripts/cabal-debian
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+set -e
+
+if [ "$1" = "--help" ]
+then
+ cat <<__END__
+cabal-debian - Run cabal-debian with inferred parameters
+
+__END__
+ $0 --manpage
+ exit 0
+fi
+
+
+if [ "$1" = "--manpage" ]
+then
+cat <<'__END__'
+Usage: dht cabal-debian [option...]
+
+This is a wrapper around cabal-debian that tries to infer a few useful facts:
+ * If the test suite is enabled.
+ * Which Cabal flags are to be used.
+ * The source package name.
+
+None of these checks are perfect, so check the result.
+
+It also passes `--official`.
+
+__END__
+ exit 0;
+fi
+
+if test -e debian/rules && grep -q '^DEB_ENABLE_TESTS :\?= yes' debian/rules
+then
+ test=""
+else
+ test="--no-tests"
+fi
+
+if test -e debian/rules
+then
+flags=$(perl -ne 'if (/^DEB_SETUP_GHC_CONFIGURE_ARGS/) {while (/(?:-f|--flags)=? ?(-?[a-z0-9_-]+)/gc) { print "--cabal-flag $1 "}}' debian/rules)
+fi
+
+srcname=$(basename $(pwd))
+
+cabal-debian --official --source-package-name $srcname $test $flags "$@"
+find debian/ -name '*~' -delete
diff --git a/scripts/upgrade b/scripts/upgrade
index 7118614..c8a839d 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -2,21 +2,6 @@
set -e
-function run_cabal_debian () {
- if grep -q '^DEB_ENABLE_TESTS :\?= yes' debian/rules
- then
- test=""
- else
- test="--no-tests"
- fi
-
- flags=$(perl -ne 'if (/^DEB_SETUP_GHC_CONFIGURE_ARGS/) {while (/(?:-f|--flags)=? ?(-?[a-z0-9_-]+)/gc) { print "--cabal-flag $1 "}}' debian/rules)
-
- cabal-debian --official $test $flags "$@"
- find debian/ -name '*~' -delete
-}
-
-
if [ "$1" = "--help" ]
then
cat <<__END__
@@ -118,14 +103,14 @@ do
# base commit
origtargz -u
- run_cabal_debian --upgrade
+ dht cabal-debian --upgrade
git add .
git commit -q -m 'Temporary base commit'
# next commit
debchange --changelog debian/changelog --newversion="$epoch$version-1" 'New upstream release'
origtargz -u
- run_cabal_debian --upgrade
+ dht cabal-debian --upgrade
dch -D $dist -r ''
git commit . -q -m "$cabal_name: Upgrading from $old_version to $version"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/pkg-haskell-tools.git
More information about the Pkg-haskell-commits
mailing list