[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Maintaining personal backports



On Mon, Jul 20, 2009 at 10:19:29AM -0500, Kumar Appaiah wrote:
> > If you are looking for small private archive:
> >  http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_small_public_package_archive
> > 
> > Also debi command in devscript may reduce dpkg -i.
> 
> Thanks for that. It'd be nice to automate the build process as well
> though, and combine it with these tools.

So, I used Osamu's reference to create a small repository for myself,
and then put together this piece of 5 minute shell jugglery for one
command building of packages to load in there. It's really not neat,
but hey, works well for a 5 minute effort.

Just run it with the sid source package as argument, and (assuming
your directories are set up like mine), it should result in a
backported package for you.

I am looking to Wikify this, with full procedure on how to set up the
mirror, the pbuilder/cowbuilder build environment and finally building
packages. But before that, I'd appreciate it if others can suggest
workarounds for the following kludges:

1. I download the Sources file from the mirror. It might become stale,
   so I'd have to remove it periodically.
2. I am parsing the output of grep-dctrl with certain
   assumptions. They might fail for some cases, and are not robust.
3. Judging the name of the changes file from the .dsc.
4. Checking for errors and bailing out.

Thanks!

Kumar

#!/bin/sh

if [ ! -n "$1" ];
then
    echo "Usage: `basename $0` <sid_package>"
    exit 1;
fi

if [ ! -s Sources ];
then
    wget ftp://ftp.utexas.edu/pub/debian/dists/unstable/main/source/Sources.bz2 -O - |bzcat > Sources
fi

FILE=$(grep-dctrl -X -S "$1" -s Directory,Files < Sources |awk '/^Directory/ { url = $NF}
/\.dsc$/ { url = url "/" $NF}
END { print url}')
echo $FILE
dget -d "ftp://ftp.utexas.edu/pub/debian/$FILE";
sudo cowbuilder --configfile ~/.pbuilderrc-lenny --build $(basename "$FILE")
dupload -t aceslinc /var/cache/pbuilder/result/$(basename "${FILE%.dsc}")_amd64.changes
-- 
Kumar Appaiah

Attachment: signature.asc
Description: Digital signature


Reply to: