Re: closure on the changes file format?
On Sun, 27 Aug 1995 Dirk.Eddelbuettel@qed.econ.queensu.ca wrote:
>
> In order to reinvent the wheel only once: could someone who has already
> written a piece to do this please post it?
My script is sort of an ongoing hack-in-progress, and not the
sort of thing I'd normally let loose in public. it's pretty
messy, but it does build my packages consistently and now
does construct a perins-style package announcement.
Here's a sample trial-run announcement:
PACKAGE: bc
VERSION: 1.03-7
DATE: Mon Aug 28 09:36:32 PDT 1995
Priority: Routine
Changes: Administrative changes only
Changed extended description for the bc package to the one used by GNU.
Renamed debian.* files using conventions followed in my other source packages.
Added SECTION field to control files.
[... still in progress ...]
# File: <name> <size> <md5checksum> <destination>
File: bc-1.03-7.tar.gz 121464 f7ec678489d560f7351f74879b528871 source/math
File: bc-1.03-7.diff.gz 20538 6b02bdbb3c45c682fe660114964224a0 source/math
File: bc-1.03-7.deb 36038 6b51c17f1221df29f4d2546ac522329e binary/math
File: dc-1.03-7.deb 19306 dde73305227569a917a18e6c4eb113d2 binary/math
And here's some lines cut out of the script. I can post the
whole thing here if there's interest.
if [ ! -f ../changes -o ../changes -ot debian.README ]
then
echo $i/changes file is missing or outdated 1>&2
exit 1
fi
if grep -q '^ *$' ../changes
then
echo $i/changes has disallowed blank lines in it 1>&2
exit 1
fi
if ! grep -q '^Priority:' ../changes
then
echo $i/changes has no Priority field 1>&2
exit 1
fi
if ! grep -q '^Changes:' ../changes
then
echo $i/changes has no Changes field 1>&2
exit 1
SECTION=`dpkg-deb --field $DEB section`
if [ X$SECTION = X ]
then
echo "No SECTION field in control file" 1>&2
exit 1
fi
DATE=`date`
[... and, later ...]
echo ----------- doing announce file for $i-$REV
DEB=`ls $i/*.deb | head -1`
PACKAGE=`dpkg-deb --field $DEB package`
VERSION=`dpkg-deb --field $DEB version`
REVISION=`dpkg-deb --field $DEB package_revision`
if [ X != X$REVISION ]
then
VERSION=$VERSION-$REVISION
fi
SECTION=`dpkg-deb --field $DEB section`
if [ X$SECTION = X ]
then
echo "No SECTION field in control file" 1>&2
exit 1
fi
>$i-$REV.announce
echo "PACKAGE: $PACKAGE" >>$i-$REV.announce
echo "VERSION: $VERSION" >>$i-$REV.announce
echo "DATE: $DATE" >>$i-$REV.announce
cat $i/changes >>$i-$REV.announce
echo "# File: <name> <size> <md5checksum> <destination>" \
>>$i-$REV.announce
for j in tar diff
do
FILE=$i-$REV.$j.gz
SIZE=`wc -c $FILE | sed -e 's/^ *//' | cut -d' ' -f1`
MD5SUM=`md5sum $FILE | cut -d' ' -f1`
echo "File: $FILE $SIZE $MD5SUM source/$SECTION" >>$i-$REV.announce
done
for j in $i/*-$REV.deb
do
FILE=`echo $j | sed -e "s/$i\///"`
SIZE=`wc -c $FILE | sed -e 's/^ *//' | cut -d' ' -f1`
MD5SUM=`md5sum $FILE | cut -d' ' -f1`
echo "File: $FILE $SIZE $MD5SUM binary/$SECTION" >>$i-$REV.announce
done
Reply to: