Re: debian binary diff system ?!
On Sat, Nov 14, 1998 at 02:05:24PM +0100, Kai Duebbert wrote:
> Hi.
>
> I was wondering if anybody is working on something like making binary diff
> updates possible with debian!? It always bugs me again, when I have to download
> a whole package (and pay the German telephone fees...), although just something
> in the documentation or so is changed. and i like to have an up-to-date system.
>
> If nobody is working on that, did you already discuss something like this
> before? How do others think about this? Anybody interested to work on this?
Initial indications with a couple of scripts I hacked up are slightly
disappointing (~20% savings as a diff from hamm to slink, tested for
2 or 3 packages). However, the script
doesn't do anything fancy yet (like compare individual files), so it may get
better. My scripts are attached anyway.
--
Tom Lees <tom@lpsg.demon.co.uk> <tom@debian.org> http://www.lpsg.demon.co.uk/
PGP Key: finger tom@master.debian.org, http://www.lpsg.demon.co.uk/pgpkeys.asc.
#!/bin/sh
#
# Reconstruct a new .deb from the old + a diff
#
PO="$1"
PD="$2"
OD="`pwd`"
mkdir /tmp/mk-pbd.$$
cd /tmp/mk-pbd.$$
ar x $PD debian-binary diff.xd control.tar.gz
PKGO="`dpkg-deb -f "$PO" Package`"
VERO="`dpkg-deb -f "$PO" Version`"
DIFF_VER="`sed 1q debian-binary`"
PKGD="`sed -ne 's/Package: \(.*\)/\1/gp' debian-binary`"
VERDO="`sed -ne 's/VersionFrom: \(.*\)/\1/gp' debian-binary`"
VERDN="`sed -ne 's/VersionTo: \(.*\)/\1/gp' debian-binary`"
if [ "$DIFF_VER" != "3.0" ]; then
echo Unknown version $DIFF_VER
exit 1
fi
if [ "$PKGD" != "$PKGO" ]; then
echo Package names differ!
exit 1
fi
if [ "$VERDO" != "$VERO" ]; then
echo Diff is FROM a different version to orig. pkg
exit 1
fi
ar x "$PO" data.tar.gz
gunzip data.tar.gz
mv data.tar "$VERDO.tar"
xdelta patch diff.xd
mv $VERDN.tar data.tar
gzip -9n data.tar
echo 2.0 > debian-binary
ar rcs "$OD"/${PKGO}_${VERDN}.deb debian-binary control.tar.gz data.tar.gz
rm -fr /tmp/mk-pbd.$$
# End of file.
#!/bin/sh
P1="$1"
P2="$2"
OD="`pwd`"
PKG1="`dpkg-deb -f "$P1" Package`"
VER1="`dpkg-deb -f "$P1" Version`"
PKG2="`dpkg-deb -f "$P2" Package`"
VER2="`dpkg-deb -f "$P2" Version`"
if [ "$PKG1" != "$PKG2" ]; then
echo Different packages!
exit 1
fi
mkdir /tmp/pbd.$$
cd /tmp/pbd.$$
ar x "$P1" data.tar.gz
gunzip data.tar.gz
mv data.tar $VER1.tar
ar x "$P2" data.tar.gz control.tar.gz
gunzip data.tar.gz
mv data.tar $VER2.tar
xdelta delta -9 $VER1.tar $VER2.tar diff.xd
cat <<EOF >debian-binary
3.0
Package: $PKG1
VersionFrom: $VER1
VersionTo: $VER2
EOF
ar rcs "$OD"/${PKG1}_$VER1-diff-$VER2.deb debian-binary control.tar.gz diff.xd
rm -fr /tmp/pbd.$$
# End of file.
Reply to: