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

Re: Kudos to BootCD!



On Thu, Dec 16, 2004 at 04:52:29PM -0600, Hugo Vanwoerkom wrote:
> By its very operation it writes only the latest, yes?
Yes, that's a built-in feature that comes for free,
and is the real magic.  The rest is incidental.

> 
> Then what exactly are those last 2 steps you mention?

I've posted these a bunch:

/a/l/*.deb - The set of .debs which is the "current" plus "new"
       dpkg-scanpackages is run on this
/a/o/YYMMDD_HHNNSS/*.deb - the debs which were replaced at
                           HH:NN:SS on MM/DD/20YY.
/a/o/LYYMMDD_HHNNSS.gz - the state of /a/l at a point in time
/a/o/AYYMMDD_HHNNSS.gz - all packages available to be installed
                         at a point in time.

/a/x: a script:
if [[ "$dt" == "" ]]; then dt=`date +"%y%m%d_%H%M%S"`; else dt=$1; fi
sub=dists/latest/binary-i386
cd /a
cd l; if [[ `ls *%* 2>/dev/null | wc -l` -ne 0 ]]; then for x in *%*; do mv $x ${x/_[0-9]*\%3a/_}; done; fi; cd ..
echo Scanning Packages...
dpkg-scanpackages l /dev/null > $sub/Packages
##dpkg-scanpackages l /dev/null 2>&1 > $sub/Packages | grep -v "tar: Removing leading"
grep -Ex "Filename: l/.+" $sub/Packages | sed "s/Filename: l\/\(.*\)/\1/" > o/L$dt
pushd $sub
rm Packages.gz
gzip Packages
popd
mv l $dt
mkdir l
for x in `cat o/L$dt`; do mv $dt/$x l; done
gzip o/L$dt
cp o/L$dt.gz L.gz
if [[ `ls $dt | wc -l` -eq 0 ]]; then rm -r $dt;
  else echo $dt `ls $dt | wc -l`; mv $dt o; fi
[end of /a/x]

/a/u: a script:
dt=`date +"%y%m%d_%H%M%S"`
mv /var/cache/apt/archives/*.deb /a/l
apt-get clean
/a/x $dt
apt-get update
/a/a | gzip > /a/o/A$dt.gz
[end of /a/u]

It's just some hacky crap I wrote, but it's feature-complete.
dpkg-scanpackages is the magic and it's automatic identification
of dups is the important feature.  Just write your own scripts
around that.



Reply to: