[Pkg-kde-commits] rev 2207 - scripts

Josh Metzler jdmetz-guest at costa.debian.org
Fri Nov 11 17:42:16 UTC 2005


Author: jdmetz-guest
Date: 2005-11-11 17:42:16 +0000 (Fri, 11 Nov 2005)
New Revision: 2207

Modified:
   scripts/create-buildprep
Log:
Rework buildprep script.  It now works on an untarred source dir
with the debian directory already in it.  It also removes the
copy that it makes.


Modified: scripts/create-buildprep
===================================================================
--- scripts/create-buildprep	2005-11-11 16:35:36 UTC (rev 2206)
+++ scripts/create-buildprep	2005-11-11 17:42:16 UTC (rev 2207)
@@ -1,46 +1,39 @@
 #! /bin/bash
 
-# Usage: create-buildprep $PACKAGE_$UPSTREAMVERSION
+# Usage: create-buildprep untarred-dir-with-debian-drectory
 
 # Script to create a buildprep patch.
-# It starts with a .orig tarball (e.g. kdetoys_3.5-rc1.orig.tar.gz)
-# and ends with two directories - one (e.g. kdetoys-3.5-rc1)
-# ready for building with a fresh svn export of the debian directory,
-# but with the new 98_buildprep.diff, and the other (e.g.
-# kdetoys-3.5-rc1.orig) just the extracted tarball.
+# This script takes an untarred package directory with the debian
+# dir already in it as input.  It makes a copy in dirname.orig,
+# runs debian/rules buildprep, and then creates the 98_buildprep.diff.
+# It unapplies the patch when it is done, and removes the copy
+# of the source directory.
 
+# The only difference should be a new 98_buildprep.diff, and lots of
+# change mtimes.
+
 # Notes:
-#  - this script does an svn export from svn.debian.org
 #  - this script depends on the filter-buildprep script
 
 # (C) 2005, Josh Metzler <joshdeb at metzlers.org>
 # GPL'ed code follow.
 
-FILTERBP=`which filter-buildprep` || FILTERBP=`which ./filter-buildprep` || ( echo "Failed to find filter-buildprep" && exit 1 )
+test $# -gt 0 || { echo "Usage: create-buildprep untarred-dir-with-debian-directory" && exit 1; }
 
-# untar the source
-tar -xzf $1.orig.tar.gz || exit 1
-echo "Untarred the source"
+FILTERBP=`which filter-buildprep` || FILTERBP=`which ./filter-buildprep` || { echo "Failed to find filter-buildprep" && exit 1; }
 
-# dirname has hyphen rather than underscore between package and version
-DIRNAME=${1/_/-}
+# remove trailing slash if there is one
+DIRNAME=${1%/}
 # strip everything after the first underscore to get the base name
 BASENAME=${1%%_*}
 
 # make a hardlinked backup copy
 # autotools does the *right thing* with hardlinks
-cp -lr $DIRNAME $DIRNAME.orig
-echo "Made a copy of the original source"
+cp -lr $DIRNAME $DIRNAME.orig || { echo "Failed to create copy of source directory" && exit 1; }
+echo "Made a copy of the source directory"
 
-# if the debian directory exists, remove it
-test -e $DIRNAME/debian && rm -rf $DIRNAME/debian
-
-# export a fresh copy of svn/trunk's debian directory for this package
-# use force to make it write into an existing directory
-svn --force export svn://svn.debian.org/pkg-kde/trunk/packages/$BASENAME $DIRNAME || exit 1
-
 # remove the current buildprep patch
-rm $DIRNAME/debian/patches/98_buildprep.diff
+test -e $DIRNAME/debian/patches/98_buildprep.diff && rm $DIRNAME/debian/patches/98_buildprep.diff
 
 # run the buildprep
 cd $DIRNAME && fakeroot debian/rules buildprep
@@ -52,5 +45,11 @@
 
 # unapply the patch
 cd $DIRNAME && patch -p0 -R < debian/patches/98_buildprep.diff
+cd ..
 
+# remove the copied directory
+rm -rf $DIRNAME.orig
+echo "Removed the source copy"
 
+exit 0
+




More information about the pkg-kde-commits mailing list