[Pkg-voip-commits] r2721 - yxa/trunk/debian

Mikael Magnusson mikma-guest at alioth.debian.org
Mon Nov 20 16:49:49 CET 2006


Author: mikma-guest
Date: 2006-11-20 16:49:49 +0100 (Mon, 20 Nov 2006)
New Revision: 2721

Added:
   yxa/trunk/debian/get-orig-source.sh
Modified:
   yxa/trunk/debian/rules
Log:
Add support for svn export snapshots.


Added: yxa/trunk/debian/get-orig-source.sh
===================================================================
--- yxa/trunk/debian/get-orig-source.sh	2006-11-20 14:57:31 UTC (rev 2720)
+++ yxa/trunk/debian/get-orig-source.sh	2006-11-20 15:49:49 UTC (rev 2721)
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+set -e
+
+function get_svn
+{
+    local upversion=$1
+    local url=$2
+    local filename=$3
+    local svnrev=$4
+
+    local srcdir=yxa-${upversion}.orig
+
+    echo Downloading ${filename} from ${url} rev ${svnrev}
+    svn export -q -r$svnrev --non-interactive $url ../tarballs/${srcdir}
+    echo Building snapshot tarball
+    GZIP=-9 tar -b1 -czf ../tarballs/${filename} -C ../tarballs ${srcdir}
+    echo Cleaning up
+    rm -rf ../tarballs/${srcdir}
+}
+
+function get_http
+{
+    local url=$1
+    local filename=$2
+
+    echo Downloading ${filename} from ${url} ...
+    wget -N -nv -T10 -t3 -O ../tarballs/${filename} ${url}
+}
+
+function usage
+{
+    echo "Usage: $0 version url [revision]"
+    echo
+}
+
+if [ -z "$1" ] || [ -z "$2" ]; then
+    echo "Missing parameter"
+    usage
+    exit 1;
+fi
+
+dh_testdir
+
+upversion=$1
+url=$2
+
+filename=yxa_${upversion}.orig.tar.gz
+
+if echo $url | grep ^svn ; then
+    if [ -z "$3" ]; then
+	echo Missing parameter revision
+	usage
+	exit 1
+    fi
+    svnrev=$3
+    get_svn $upversion $url $filename $svnrev
+else
+    echo not svn
+    get_http $url $filename
+fi


Property changes on: yxa/trunk/debian/get-orig-source.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: yxa/trunk/debian/rules
===================================================================
--- yxa/trunk/debian/rules	2006-11-20 14:57:31 UTC (rev 2720)
+++ yxa/trunk/debian/rules	2006-11-20 15:49:49 UTC (rev 2721)
@@ -29,12 +29,17 @@
                     | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
 UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
 
+ifeq (svn,$(findstring svn,$(UPVERSION)))
+URL := svn://anonsvn.it.su.se/yxa/trunk
+SVNREV := {$(shell echo $(DEBVERSION) | sed -e 's/^.*+//' | sed -e 's/svn-.*//')}
+else
 ifeq (,$(findstring +2,$(UPVERSION)))
 URL := http://www.stacken.kth.se/project/yxa/download/yxa-$(UPVERSION).tar.gz
 else
 TARVERSION:=$(shell echo $(UPVERSION) | sed -e 's/^.*\+\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)/\1-\2-\3/')
 URL := http://www.stacken.kth.se/project/yxa/download/snapshots/yxa-$(TARVERSION).tar.gz
 endif
+endif
 
 FILENAME := yxa_$(UPVERSION).orig.tar.gz
 SHA1SUM := 72c54db19a02e8b888fe991139746bd55da176c4
@@ -118,10 +123,10 @@
 	@@echo "Debian version:          $(DEBVERSION)"
 	@@echo "Upstream version:        $(UPVERSION)"
 	@@echo "URL:                     $(URL)"
+	@@echo "SVN revision:            $(SVNREV)"
 
 get-orig-source:
 	@@dh_testdir
 	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
-	@@echo Downloading $(FILENAME) from $(URL) ...
-	@@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
-	@@echo "$(SHA1SUM)  ../tarballs/yxa_$(UPVERSION).orig.tar.gz" | sha1sum -c
+	@@chmod +x debian/get-orig-source.sh
+	debian/get-orig-source.sh $(UPVERSION) $(URL) $(SVNREV)




More information about the Pkg-voip-commits mailing list