summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2009-02-17 02:11:53 +0000
committerGuillem Jover <guillem@hadrons.org>2010-06-10 23:21:24 +0200
commit27527f25cfee14feca74cf74951e4d87ba9dcb77 (patch)
tree2dea3d3ef8e66e601f179195c5343719c0797205
parent16bbea3f7179baca643094c17e69e72361a2d32a (diff)
downloadinetutils-27527f25cfee14feca74cf74951e4d87ba9dcb77.tar.gz
Update debian/tarball.sh
- Use git instead of CVS to get new snapshots. - Use lower case variable names. - Make snapshot argument handle both cloning and updating. - Add a new tarball argument. - Add code to bootstrap from gnulib. - Refactor version detection into a function and use it when needed. Update documentation about debian/tarball.sh in debian/README.source.
-rw-r--r--debian/README.source8
-rw-r--r--debian/changelog8
-rwxr-xr-xdebian/tarball.sh101
3 files changed, 86 insertions, 31 deletions
diff --git a/debian/README.source b/debian/README.source
index 742b7dc..1ca4852 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -2,11 +2,7 @@ This package uses quilt to manage all modifications to the upstream
source. Please refer to /usr/share/doc/quilt/README.source for more
information.
-There's a script to help generating tarballs from CVS snapshots:
+There's a script to help generate or update tarballs from git snapshots:
- $ debian/tarball.sh snapshot <upstream-tarball>
-
-and to update it:
-
- $ debian/tarball.sh update
+ $ debian/tarball.sh snapshot
diff --git a/debian/changelog b/debian/changelog
index 66e7628..40f90de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,14 @@ inetutils (2:1.6-1) UNRELEASED; urgency=low
- Change references from GPL-2 to GPL-3.
- Remove comments about no longer stripped out non-free documentation.
- Add reference to GFDL-1.2.
+ * Update debian/tarball.sh:
+ - Use git instead of CVS to get new snapshots.
+ - Use lower case variable names.
+ - Make snapshot argument handle both cloning and updating.
+ - Add a new tarball argument.
+ - Add code to bootstrap from gnulib.
+ - Refactor version detection into a function and use it when needed.
+ * Update documentation about debian/tarball.sh in debian/README.source.
* Switch to debhelper compatibility level 7.
* Use dh_prep instead of “dh_clean -k”.
* Remove RCS keywords from packaging files.
diff --git a/debian/tarball.sh b/debian/tarball.sh
index 6fdcc22..a873715 100755
--- a/debian/tarball.sh
+++ b/debian/tarball.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2004, 2005 Guillem Jover <guillem@debian.org>
+# Copyright © 2004, 2005, 2007, 2009 Guillem Jover <guillem@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -8,45 +8,96 @@
# (at your option) any later version.
#
-PKG=inetutils
-export CVSROOT=":pserver:anonymous@cvs.sv.gnu.org:/sources/$PKG"
-
set -e
+set -u
+
+pkg=inetutils
+pkg_file=libinetutils
+
+action=$1
+shift
-SRCDIR="$PKG-snapshot"
+get_version()
+{
+ local d=$1
-case "$1" in
+ echo $(grep ^AC_INIT $d/configure.ac | sed -e 's/.*, *\[\([^,]*\)\] *,.*/\1/')
+}
+
+echo "-> getting the source."
+case "$action" in
snapshot)
- echo "-> getting new snapshot."
-# cvs login
- cvs -z3 co -d $SRCDIR $PKG
+ echo " -> making a git snapshot."
+
+ snapshot_dir="$pkg-snapshot"
+
+ if [ -d $snapshot_dir ]; then
+ cd $snapshot_dir
+ git pull
+ cd ..
+ else
+ git clone git://git.sv.gnu.org/inetutils.git $snapshot_dir
+ fi
+
+ echo " -> bootstrapping source tree form gnulib."
+ cd $snapshot_dir
+ ./bootstrap --copy
+ cd ..
+
+ version="$(get_version $snapshot_dir)+$(date +%Y%m%d)"
;;
- update)
- echo "-> updating snapshot."
- cvs -z3 up -dP $SRCDIR
+ tarball)
+ echo " -> unpacking upstream tarball."
+
+ upstream_dir="$pkg-tarball"
+ upstream_tarball=$1
+
+ mkdir $upstream_dir
+ cd $upstream_dir
+ tar xzf ../$upstream_tarball --strip 1
+ cd ..
+
+ version=$(get_version $upstream_dir)
;;
esac
-if ! [ -e $SRCDIR/libinetutils ]
+tarball=${pkg}_${version}.orig.tar.gz
+tree=${pkg}-${version}
+
+echo "-> filling the working tree."
+case "$action" in
+ snapshot)
+ cp -al $snapshot_dir $tree
+ ;;
+ tarball)
+ mv $upstream_dir $tree
+ ;;
+esac
+
+if ! [ -e $tree/$pkg_file ]
then
- echo "error: no $PKG source dir available."
+ echo "error: no $pkg tree available."
exit 1
fi
-echo "-> creating new directory tree."
-VERSION=$(grep ^AC_INIT $SRCDIR/configure.ac | \
- sed -e 's/.*, *\[\([^,]*\)\] *,.*/\1/')
-SNAPSHOTVERSION="$VERSION+$(date +%Y%m%d)"
-TARBALLDIR="$PKG-$SNAPSHOTVERSION"
-cp -al $SRCDIR $TARBALLDIR
+echo "-> cleaning tree."
+# Clean non-free stuff
+: nothing to clean
+
+# Clean junk from CVS to git conversion
+rm -rf $tree/Attic
+
+# Clean bootstrap and autofoo stuff
+rm -rf $tree/autom4te.cache
+rm -rf $tree/gnulib
-echo "-> cleaning snapshot."
-# Clean cvs stuff
-find $TARBALLDIR -name 'CVS' -o -name '.cvsignore' | xargs rm -rf
+# Clean vcs stuff
+find $tree -name 'CVS' -o -name '.cvsignore' -o \
+ -name '.git' -o -name '.gitignore' | xargs rm -rf
echo "-> creating new tarball."
-tar czf ${PKG}_$SNAPSHOTVERSION.orig.tar.gz $TARBALLDIR
+tar czf $tarball $tree
echo "-> cleaning directory tree."
-rm -rf $TARBALLDIR
+rm -rf $tree