[Pkg-haskell-commits] darcs: tools: pkg-haskell-checkout
Joachim Breitner
mail at joachim-breitner.de
Tue Jun 11 10:17:32 UTC 2013
Sun Jul 5 15:53:29 UTC 2009 Joachim Breitner <mail at joachim-breitner.de>
* pkg-haskell-checkout
A ./pkg-haskell-checkout
Sun Jul 5 15:53:29 UTC 2009 Joachim Breitner <mail at joachim-breitner.de>
* pkg-haskell-checkout
diff -rN -u old-tools/pkg-haskell-checkout new-tools/pkg-haskell-checkout
--- old-tools/pkg-haskell-checkout 1970-01-01 00:00:00.000000000 +0000
+++ new-tools/pkg-haskell-checkout 2013-06-11 10:17:32.018164865 +0000
@@ -0,0 +1,84 @@
+#!/bin/sh
+# Copyright (c) 2009 Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
+# 2009 Joachim Breitner <nomeata at debian.org>
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# Usage:
+# build-pkg-haskell
+# [PACKAGE ...]
+
+set -e
+
+until [ -z "$1" ]
+do
+ case "$1" in
+ *)
+ PACKAGES="$PACKAGES $1"
+ ;;
+ esac
+ shift
+done
+
+if [ -z "$PACKAGES" ]
+then
+ echo "Usage: $0 [PACKAGE ...]"
+ exit 1
+fi
+
+for PACKAGE in $PACKAGES
+do
+ if [ -e $PACKAGE-debian ]
+ then
+ echo "Temporary directory $PACKAGE-debian already exists, aborting"
+ exit 1
+ fi
+
+ darcs get alioth.debian.org:/darcs/pkg-haskell/$PACKAGE $PACKAGE-debian
+
+ if [ ! -e $PACKAGE-debian/control -o ! -e $PACKAGE-debian/changelog ]
+ then
+ echo "Did not find PACKAGE-debian/control or $PACKAGE-debian/changelog."
+ echo "Is the repository in the debian/-only format?"
+ exit 1
+ fi
+
+ VERSION=`dpkg-parsechangelog -l$PACKAGE-debian/changelog -c1 | grep-dctrl -n -s Version .`
+ UPSTREAM=`echo $VERSION | cut -d- -f1` # this could be improved
+ TARBALL=${PACKAGE}_$UPSTREAM.orig.tar.gz
+ WANTED_PACKAGEDIR="${PACKAGE}-${UPSTREAM}"
+ [ ! -e $TARBALL ] \
+ && uscan \
+ --force-download \
+ --package $PACKAGE \
+ --watchfile $PACKAGE-debian/watch \
+ --upstream-version $UPSTREAM \
+ --destdir .
+
+ # assumes the convention that the tarball contains one equally named directory
+ # ideally, we apply the full logic as dpkg-source does
+ PACKAGEDIR=`readlink $TARBALL | xargs -I TARGET basename TARGET .tar.gz`
+ [ ! -e $PACKAGEDIR ] \
+ && tar xzf $TARBALL
+ mv $PACKAGEDIR $WANTED_PACKAGEDIR
+
+ mv $PACKAGE-debian $WANTED_PACKAGEDIR/debian
+
+ echo "Successfully checked out $PACKAGE in $WANTED_PACKAGEDIR"
+done
More information about the Pkg-haskell-commits
mailing list