[pkg-haskell-tools] 02/03: dht upload: If no changes file is given, derive from the current directory (like debrelease does).

Joachim Breitner nomeata at moszumanska.debian.org
Fri Aug 28 21:11:23 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 b7c495ec4d7855e56db563cea29ac9a047298756
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Aug 25 22:18:13 2015 +0200

    dht upload: If no changes file is given, derive from the current directory (like debrelease does).
---
 debian/changelog |  2 ++
 scripts/upload   | 27 +++++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 13ab70b..86a90b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ pkg-haskell-tools (0.9) UNRELEASED; urgency=medium
   * Depend on cabal-debian >= 4.31, the first version supporting --upgrade
     (among other improvements)
   * New script: dch (wrapper around debchange)
+  * dht upload: If no changes file is given, derive from the current directory
+    (like debrelease does).
 
  -- Joachim Breitner <nomeata at debian.org>  Thu, 20 Aug 2015 10:09:40 +0200
 
diff --git a/scripts/upload b/scripts/upload
index 4f8d29e..4bf7219 100755
--- a/scripts/upload
+++ b/scripts/upload
@@ -2,16 +2,20 @@
 
 set -e
 
-if [ -z "$1" -o "$1" = "--help" ]
+if [ "$1" = "--help" ]
 then
   echo "upload - Uploads, tags and pushes"
   echo
-  echo "Usage: dht upload foo.changes"
+  echo "Usage: dht upload [foo.changes]"
   echo
   echo "Signs the .changes file and the corresponding .dsc file in a temporary"
   echo "location (to avoid touching the original files), uploads them to the archive"
   echo "using \"dput ssh-upload\" and tags them in the repository and pushes the tag."
   echo
+  echo "If no changes file is given, but the script is run in a debian source package,"
+  echo "it checks the parent directory for an appropriately named changes file, just"
+  echo "like debrelease(1) would do."
+  echo
   echo "Checks that the distribution is not UNRELEASED and that the tag does"
   echo "not exist already."
   echo
@@ -28,6 +32,10 @@ Signs the `.changes` file and the corresponding `.dsc` file in a temporary
 location (to avoid touching the original files), uploads them to the archive
 using `dput ssh-upload` and tags them in the repository and pushes the tag.
 
+If no changes file is given, but the script is run in a debian source package,
+it checks the parent directory for an appropriately named changes file, just
+like debrelease(1) would do.
+
 Checks that the distribution is not `UNRELEASED` and that the tag does
 not exist already.
 __END__
@@ -36,6 +44,21 @@ fi
 
 changes="$@"
 
+if [ -z "$changes" -a -r "debian/changelog" ]
+then
+	src="$(dpkg-parsechangelog -SSource)"
+	ver="$(dpkg-parsechangelog -SVersion | perl -pe 's/^\d+://')"
+	arch="$(dpkg-architecture -qDEB_HOST_ARCH)"
+	changes_path="../${src}_${ver}_${arch}.changes"
+	if [ -e $changes_path ]
+	then
+	  changes="$changes_path"
+	else
+	  echo "Cannot find $changes_path."
+	  exit 1
+	fi
+fi
+
 root="$(realpath --relative-to=$PWD "$(git rev-parse --show-toplevel)")"
 tmpdir=$root/uploads
 

-- 
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