Re: Doing CVS based Package maintainence
>>>>> "MS" == Manoj Srivastava <srivasta@datasync.com> writes:
MS> Hi,
MS> I have been thinking of expanding my cvs-buildpackage package
MS> into something more useful for CVS based sources. I am thinking along
MS> the following lines:
MS> a) cvs-pkginit
MS> Takes a dsc file, and source and diff files (the diff file
MS> being optional), and imports the package into CVS.
MS> It parses the dsc file to determine package name and version
MS> number, unpacks the original source (using dpkg-source
MS> maybe?), imports the original onto the vendor branch, tags it,
MS> checks out the source, applies the patch, makes debian/rules
MS> executable, and commits the resulting package, tags it, and
MS> removes the package.
MS> This should work very well for importing a source CD to a
MS> central CVS repository.
I have written a simple shell script which register a package into CVS
using the .dsc through the following steps :
o extract sources using dpkg-source -x
o untar the .orig archive
o import the upstream version
o import the debian modifications
I don't know if two cvs import commands can hurt.
The script is included after my signature. Any comments welcome.
--
Fred - May the source be with you
#! /bin/sh
version='$Id: cvs-register-pkg,v 1.1 1997/09/14 20:21:15 fred Exp $'
set -e # exit on error
#set -x # echo commands
if [ $# = 0 ]; then
echo "usage: "`basename $0`" [-d <module dir>] <package .dsc file>" 1>&2
echo " <module dir> default is debian" 1>&2
exit 1
fi
module_dir=debian
# parse command line
while getopts d:v args; do
case $args in
d) module_dir=$OPTARG; shift;;
esac
shift
done
# append a / to the directory name
if [ -n "$module_dir" ]; then
module_dir="$module_dir/"
fi
desc=$1
if [ ! -r $desc ]; then
echo "package description file $desc is not available" 1>&2
exit 1
fi
filename=`basename $desc .dsc`
package=`echo $filename|sed -n 's/\(.*\)_.*/\1/p'`
upstream_version=`echo $filename|sed -n 's/.*_\(.*\)-.*/\1/p'`
debian_version=`echo $filename|sed -n 's/.*-\(.*\)/\1/p'`
echo "package=${package} upstream_version=${upstream_version} debian_version=${debian_version} module_dir=$module_dir"
cd ${TMPDIR=/tmp}
dpkg-source -x $desc
if [ $? != 0 ]; then
echo "Error extracting package: exiting" 1>&2
exit 1
fi
# import original source tree
tar zxvf ${package}_${upstream_version}.orig.tar.gz
cd ${package}-${upstream_version}.orig
cvs import -m "upstream version ${upstream_version} imported" -ko ${module_dir}${package} upstream upstream_version_`echo ${upstream_version}| tr . _`
cd ..
# import debian modified version
cd ${package}-${upstream_version}
cvs import -m "debian version ${upstream_version}-${debian_version} imported" ${module_dir}${package} debian debian_version_`echo ${upstream_version}-${debian_version}| tr . _`
cd ..
# clean up the temporary locations
rm -rf ${package}-${upstream_version}
rm -f ${package}_${upstream_version}.orig.tar.gz
echo "$package registered under CVS"
# cvs-register-pkg ends here
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: