[Pkg-xfce-commits] r4884 - scripts

Yves-Alexis Perez corsac at alioth.debian.org
Sat Feb 5 03:01:33 UTC 2011


Author: corsac
Date: 2011-02-05 15:01:27 +0000 (Sat, 05 Feb 2011)
New Revision: 4884

Added:
   scripts/get-sources.sh
Log:
add a get-source shell script which uses uscan and watchfiles


Added: scripts/get-sources.sh
===================================================================
--- scripts/get-sources.sh	                        (rev 0)
+++ scripts/get-sources.sh	2011-02-05 15:01:27 UTC (rev 4884)
@@ -0,0 +1,71 @@
+#!/bin/bash
+# Download Xfce tarballs
+# © 2011 Yves-Alexis Perez
+# GPLv2
+#
+# Use it with:
+# ./get-source.sh desktop
+# ./get-source.sh goodies xfce4-power-manager
+# BRANCH=branches/experimental ./get-source.sh desktop thunar
+
+REPOSITORY="$PWD/.."
+BRANCH=${BRANCH:-trunk}
+
+get_package()
+{
+	local pkg=$1
+	if [ -z "$pkg" ] || [ ! -d "$DIR/$pkg" ];
+	then
+		echo "Package $pkg doesn't exist in repository" >&2
+		return
+	fi
+	
+	echo "Downloading $pkg"
+	
+	pushd "$DIR/$pkg" >/dev/null
+	uscan --destdir=../tarballs
+	popd > /dev/null
+}
+
+usage()
+{
+	echo "Usage: $0 <desktop>|<goodies> [package,package,...]" >&2
+	exit 1
+}
+
+[ "$#" -gt 0 ] || usage
+
+CAT="$1"
+shift
+
+case "$CAT" in
+	"desktop")
+		DIR="$REPOSITORY/desktop/$BRANCH"
+		;;
+	"goodies")
+		DIR="$REPOSITORY/goodies/$BRANCH"
+		;;
+	*)
+		usage
+		;;
+esac
+
+if [ "$#" -gt 0 ];
+then
+	#we have a package list, use it
+	while [ "$#" -gt 0 ];
+	do
+		PACKAGE=$1
+		shift
+		get_package $PACKAGE
+	done
+else
+	# we just pick every package with a watchfile
+	for WATCHFILE in $DIR/*/debian/watch
+	do
+		PACKAGE=$(basename ${WATCHFILE%%debian/watch})
+		get_package $PACKAGE
+	done
+fi
+
+exit 0


Property changes on: scripts/get-sources.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the Pkg-xfce-commits mailing list