[Pkg-haskell-commits] darcs: tools: Script to find the URL of the diff from Debian to latest Hackage version

Joachim Breitner mail at joachim-breitner.de
Sun Oct 21 13:57:14 UTC 2012


Sun Oct 21 13:54:16 UTC 2012  Joachim Breitner <mail at joachim-breitner.de>
  * Script to find the URL of the diff from Debian to latest Hackage version
  Ignore-this: cba90b88395c0c39e4e4465b3a39c8e2

    A ./diff-upgrade.sh

Sun Oct 21 13:54:16 UTC 2012  Joachim Breitner <mail at joachim-breitner.de>
  * Script to find the URL of the diff from Debian to latest Hackage version
  Ignore-this: cba90b88395c0c39e4e4465b3a39c8e2
diff -rN -u old-tools//diff-upgrade.sh new-tools//diff-upgrade.sh
--- old-tools//diff-upgrade.sh	1970-01-01 00:00:00.000000000 +0000
+++ new-tools//diff-upgrade.sh	2012-10-21 13:57:14.715758225 +0000
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+if [ "$1" = "-D" ]
+then
+	dist="$2"
+	shift
+	shift
+fi
+
+if [ "$1" = '--help' ]
+then
+	echo "Usage: $0 [dir]"
+	echo
+	echo "Shows the URL of the diff from this to the latest version, using"
+	echo "http://hdiff.luite.com"
+	echo
+	echo "Unfortuntely, cgit does not support raw diffs."
+	exit
+fi
+
+set -e
+
+if [ -n "$1" ]
+then
+	cd $1 || ( echo "Could not chnage directory to $1" ; exit 1 )
+fi
+
+if [ ! -e changelog ]
+then
+	echo "No changelog file found, skipping $dir"
+	popd >/dev/null
+	continue
+fi
+
+if [ ! -e watch ]
+then
+	echo "No watch file found, skipping $dir"
+	popd >/dev/null
+	continue
+fi
+
+package="$(grep-dctrl -n -s Source . < control)"
+old_version=`dpkg-parsechangelog -lchangelog -c1 | grep-dctrl -n -s Version .`
+old_version=`echo $old_version | cut -d- -f1` # this could be improved
+if echo $old_version | fgrep -q : ; then
+	old_version=`echo $old_version | cut -d: -f2-`
+fi
+
+version="$(uscan --dehs --upstream-version 0 --watchfile watch --package $package --report-status|xpath -e 'dehs/upstream-version/text()' -q)"
+cabal_name="$(uscan --dehs --upstream-version 0 --watchfile watch --package $package --report-status|xpath -e 'dehs/upstream-url/text()' -q|cut -d/ -f6)"
+
+if [ -z "$version" ]
+then
+	echo "could not detect version." >&1
+	exit 1
+fi
+
+if [ "$old_version" = "$version" ]
+then
+	exit 1
+else
+	echo "http://hdiff.luite.com/cgit/$cabal_name/diff/?id=$version&id2=$old_version"
+fi





More information about the Pkg-haskell-commits mailing list