r41134 - /scripts/fix-missing-upstream
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Mon Aug 3 07:07:13 UTC 2009
Author: ryan52-guest
Date: Mon Aug 3 07:07:06 2009
New Revision: 41134
URL: http://svn.debian.org/wsvn/?sc=1&rev=41134
Log:
add a script to fix missing upstreams automatically
Added:
scripts/fix-missing-upstream (with props)
Added: scripts/fix-missing-upstream
URL: http://svn.debian.org/wsvn/scripts/fix-missing-upstream?rev=41134&op=file
==============================================================================
--- scripts/fix-missing-upstream (added)
+++ scripts/fix-missing-upstream Mon Aug 3 07:07:06 2009
@@ -1,0 +1,45 @@
+#!/bin/sh
+
+TEMPD=$(mktemp -d)
+trap "/bin/rm -rf \"$TEMPD\"" QUIT INT EXIT
+DOWNLOAD_STRING=$(sed -r -e '/unstable. urgency/ !d' -e 'q' debian/changelog)
+if [ -z "$DOWNLOAD_STRING" ]; then
+ DOWNLOAD_STRING=$(head -1 debian/changelog)
+fi
+DOWNLOAD_STRING=$(echo $DOWNLOAD_STRING | sed -r 's/(.*) \((.*)\).*/\1=\2/')
+TARBALL=$(echo $DOWNLOAD_STRING | sed -e 's/=/_/' -e 's/^[0-9]*://' -e 's/-[0-9]*$//').orig.tar.gz
+UPSTREAM_VERSION=$(echo $TARBALL | sed -r 's/^.*_(.*).orig.tar.gz$/\1/')
+PACKAGE=$(echo $TARBALL | sed -r 's/^(.*)_.*$/\1/')
+ORIGDIR=$(pwd)
+cd $TEMPD
+apt-get source --download-only $DOWNLOAD_STRING
+if [ ! -f $TARBALL ]; then
+ cd $ORIGDIR
+ uscan --force-download --destdir $TEMPD --rename --upstream-version $UPSTREAM_VERSION
+ if [ ! -f $TEMPD/$TARBALL ]; then
+ if [ -f ../$TARBALL ]; then
+ cp $(readlink -f ../$TARBALL) $TEMPD/$TARBALL
+ elif [ -f ../tarballs/$TARBALL ]; then
+ cp $(readlink -f ../tarballs/$TARBALL) $TEMPD/$TARBALL
+ else
+ echo "Couldn't download $TARBALL using apt or uscan. Please get it manually, put it in ../ or ../tarballs/, and rerun this script."
+ exit 1
+ fi
+ fi
+ cd $TEMPD
+fi
+mkdir to_upload
+cd to_upload
+tar xzf ../$TARBALL
+UPLOAD_DIR=./to_upload/
+if [ "$(ls | wc -l)" = "1" ]; then
+ UPLOAD_DIR=$UPLOAD_DIR$(ls)/
+fi
+cd $TEMPD
+wget http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn_load_dirs/svn_load_dirs.pl.in -O svn_load_dirs
+sed -i 's, at SVN_BINDIR@,/usr/bin,' svn_load_dirs
+# TODO: this requires that stuff in /tmp/ can be executed. it shouldn't.
+chmod +x svn_load_dirs
+# TODO: get this from props so that this can be used more generally
+$(readlink -f svn_load_dirs) svn+ssh://svn.debian.org/svn/pkg-perl/ branches/upstream/$PACKAGE/current -t branches/upstream/$PACKAGE/$UPSTREAM_VERSION $(readlink -f $UPLOAD_DIR)
+
Propchange: scripts/fix-missing-upstream
------------------------------------------------------------------------------
svn:executable = *
More information about the Pkg-perl-cvs-commits
mailing list