rev 4957 - kde-extras/kwlan/trunk/debian

Fathi Boudra fboudra-guest at alioth.debian.org
Tue Nov 21 09:46:02 UTC 2006


Author: fboudra-guest
Date: 2006-11-21 10:46:01 +0100 (Tue, 21 Nov 2006)
New Revision: 4957

Added:
   kde-extras/kwlan/trunk/debian/dpatch-get-repack-origtargz
Modified:
   kde-extras/kwlan/trunk/debian/changelog
   kde-extras/kwlan/trunk/debian/rules
Log:
add dpatch-get-repack-origtargz for supporting bz2 archive. Thanks to Frode D?\195?\184ving

Modified: kde-extras/kwlan/trunk/debian/changelog
===================================================================
--- kde-extras/kwlan/trunk/debian/changelog	2006-11-21 09:12:20 UTC (rev 4956)
+++ kde-extras/kwlan/trunk/debian/changelog	2006-11-21 09:46:01 UTC (rev 4957)
@@ -1,3 +1,12 @@
+kwlan (0.5.6-2) UNRELEASED; urgency=low
+
+  * Add dpatch-get-repack-origtargz (modified dpatch-get-origtargz)
+    dpatch-get-origtargz does not handle upstream .tar.bz2 origs. This modified
+    version will repack with bunzip2 and gzip -9n until dpatch bug 391776 is
+    properly fixed. Thanks to Frode Døving.
+
+ -- Fathi Boudra <fboudra at free.fr>  Tue, 21 Nov 2006 10:35:41 +0100
+
 kwlan (0.5.6-1) unstable; urgency=low
 
   * New upstream release

Added: kde-extras/kwlan/trunk/debian/dpatch-get-repack-origtargz
===================================================================
--- kde-extras/kwlan/trunk/debian/dpatch-get-repack-origtargz	2006-11-21 09:12:20 UTC (rev 4956)
+++ kde-extras/kwlan/trunk/debian/dpatch-get-repack-origtargz	2006-11-21 09:46:01 UTC (rev 4957)
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+set -e
+
+DPGO_BASENAME="$(basename $0)"
+
+# makes sure that there is a .orig.tar.gz in a given directory.
+# This script is to be invoked from a package build directory as it uses
+# dpkg-parsechangelog
+
+# Usage: dpatch-get-origtargz origtardir
+
+ORIGTARDIR="$1"
+shift
+if [ -z "$ORIGTARDIR" ] || [ -n "$1" ]; then
+  echo >&2 "${DPGO_BASENAME}: Usage: dpatch-get-origtargz <origtardir>"
+  exit 1
+fi
+
+PACKAGENAME="$(dpkg-parsechangelog | sed -n '/^Source:/{s/^Source:[[:space:]]\+\(.*\)/\1/;p;q}')"
+UPSTREAMVERSION="$(dpkg-parsechangelog | sed -n '/^Version:/{s/^Version:[[:space:]]\+\([0-9]\+:\)\?\([^-]\+\).*/\2/;p;q}')"
+ORIGTARGZ="${PACKAGENAME}_${UPSTREAMVERSION}.orig.tar.gz"
+if [ -f "${ORIGTARDIR}/$ORIGTARGZ" ]; then
+  true
+elif [ -f "${DPGO_ORIGTARDIR}/$ORIGTARGZ" ]; then
+  cp $(readlink -f "${DPGO_ORIGTARDIR}/$ORIGTARGZ") $ORIGTARDIR
+elif [ ! -z "${DPGO_ORIGTARGZPATH}" ]; then
+    for dir in $(echo ${DPGO_ORIGTARGZPATH} | cut -d: -f 1- --output-delimiter=' '); do
+	echo DEBUG: try $dir 
+	if [ -f "$dir/$ORIGTARGZ" ]; then
+	    cp $(readlink -f "$dir/$ORIGTARGZ") "$ORIGTARDIR/$ORIGTARGZ"
+	    break
+	fi
+    done
+fi
+ 
+# path and other methods failed, try heuristics and apt
+
+if [ ! -f  "${ORIGTARDIR}/$ORIGTARGZ" ]; then
+    if [ -f "../$ORIGTARGZ" ]; then
+	cp $(readlink -f "../$ORIGTARGZ") $ORIGTARDIR
+    elif [ -x $(which apt-get) ]; then
+	if (cd $ORIGTARDIR && apt-get --tar-only source "$PACKAGENAME"); then
+	    if ! [ -f "${ORIGTARDIR}/$ORIGTARGZ" ]; then
+		echo >&2 "${DPGO_BASENAME}: Error: apt-get source $PACKAGENAME failed to provide the correct version of $ORIGTARGZ"
+	    fi
+	else
+	    echo >&2 "${DPGO_BASENAME}: Error: apt-get source $PACKAGENAME failed"
+	fi
+    fi
+fi
+
+# as a last resort, use debian/watch
+
+if [ ! -f "${ORIGTARDIR}/$ORIGTARGZ" -a -f "debian/watch" -a -x "$(which curl)" ] && ! curl --fail "$(< debian/watch sed -n "/^\\(http\\|ftp\\)/{s/^\\([^(]\\+\\)([^)]*)\\([^ ]*\\).*/\\1${UPSTREAMVERSION}\\2/;s/\\\\//g;p;q;}")" > ${ORIGTARDIR}/$ORIGTARGZ; then
+  echo >&2 "${DPGO_BASENAME}: Error: cannot curl $ORIGTARGZ from debian/watch location"
+fi
+
+# start: hack by Frode M. Døving <frode at ubuntu.com> to use with dpatch-get-origtargz
+# when watch file refers to a orig.tar.bz2 archive. This will bunzip and gzip -9
+
+if [ `file -bi "${ORIGTARDIR}/$ORIGTARGZ"` = 'application/x-bzip2' ]; then
+    /bin/bunzip2 -q "${ORIGTARDIR}/$ORIGTARGZ"
+    for i in "${ORIGTARDIR}/$ORIGTARGZ.out" ;do mv $i ${i%%.gz.out};/bin/gzip -9 ${i%%.gz.out};done
+    exit 0
+else
+    echo "Nothing to do."
+    exit 0
+fi
+
+# end: hack
+
+if [ ! -f "${ORIGTARDIR}/$ORIGTARGZ" ]; then
+  echo >&2 "${DPGO_BASENAME}: Error: unable to obtain $ORIGTARGZ from anywhere"
+  exit 1
+fi
+
+exit 0
+
+# arch-tag: 48d225e9-2c31-42fc-b999-e1c367cb2c20


Property changes on: kde-extras/kwlan/trunk/debian/dpatch-get-repack-origtargz
___________________________________________________________________
Name: svn:executable
   + *

Modified: kde-extras/kwlan/trunk/debian/rules
===================================================================
--- kde-extras/kwlan/trunk/debian/rules	2006-11-21 09:12:20 UTC (rev 4956)
+++ kde-extras/kwlan/trunk/debian/rules	2006-11-21 09:46:01 UTC (rev 4957)
@@ -11,5 +11,6 @@
 get-orig-source:
 	@@dh_testdir
 	@@[ -d ../tarballs/. ]
-	@@dpatch-get-origtargz ../tarballs
+	#@@dpatch-get-origtargz ../tarballs
+	@@debian/dpatch-get-repack-origtargz ../tarballs
 




More information about the pkg-kde-commits mailing list