Make update_popcon deal with lower-case http headers too

This commit is contained in:
Steve McIntyre 2020-08-01 12:43:25 +01:00
parent 35f2c1a0f4
commit a5f0edc39d
2 changed files with 12 additions and 4 deletions

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
debian-cd (3.1.30) UNRELEASED; urgency=medium
[ Steve McIntyre ]
* tools/update_popcon: cope with lower-case HTTP headers too; Debian
just enabled http2 so this broke
-- Steve McIntyre <93sam@debian.org> Sat, 01 Aug 2020 12:43:04 +0100
debian-cd (3.1.29) unstable; urgency=medium
[ Raphaël Hertzog ]

View File

@ -45,7 +45,7 @@ dl_file () {
exit 1
fi
HEAD_SIZE=`cat $TDIR/$DIST.head | \
awk '/^Content-Length/ {gsub("\r","");print $2}'`
awk '/^.ontent-.ength/ {gsub("\r","");print $2}'`
curl -L $capath -s $SITE/$DIST/by_inst > $TDIR/$DIST
error=$?
@ -55,14 +55,14 @@ dl_file () {
exit 1
fi
if [ $DL_SIZE != $HEAD_SIZE ] ; then
if [ "$DL_SIZE"x != "$HEAD_SIZE"x ] ; then
echo "Failed to download correctly: expected $HEAD_SIZE bytes, but got $DL_SIZE bytes" >&2
exit 1
fi
LASTMOD=`awk '/^Last-Modified:/ {
LASTMOD=`awk '/^.ast-.odified:/ {
gsub("\r","")
gsub("^Last-Modified: ","")
gsub("^.ast-.odified: ","")
print $0}' $TDIR/$DIST.head`
echo "$LASTMOD"
}