Package: release.debian.org User: release.debian.org@packages.debian.org UserTags: pu * Philipp Kern <pkern@debian.org> [110303 20:54]: > On Tue, Feb 22, 2011 at 09:36:34PM +0100, Bernhard R. Link wrote: > > I've prepared an upload of reprepro targeted for > > stable-proposed-updates to work around testing and unstable > > soon no longer having MD5Sum fields in the Release files. > > > > Attached the .changes and a diff of the .debian.tar.gz files > > and of the _amd64.deb files unpacked. > > > > Any chance for this to be accepted? Any modifications still > > needed to get in? > > we'd like to delay this for r2 to get all the checksum stuff in at once and > give it more testing in, well, testing and unstable. > > Would you mind filing a bug against release.debian.org about this, so > that we don't forget it? Thanks. Reattached are the diff files and the .debian.tar.gz Bernhard R. Link
diff -r -u -N reprepro_4.2.0-2/DEBIAN/control reprepro_4.2.0-2squeeze1/DEBIAN/control --- reprepro_4.2.0-2/DEBIAN/control 2010-10-24 12:35:49.000000000 +0200 +++ reprepro_4.2.0-2squeeze1/DEBIAN/control 2011-02-22 21:01:18.000000000 +0100 @@ -1,8 +1,8 @@ Package: reprepro -Version: 4.2.0-2 +Version: 4.2.0-2squeeze1 Architecture: amd64 Maintainer: Bernhard R. Link <brlink@debian.org> -Installed-Size: 992 +Installed-Size: 1056 Depends: libarchive1 (>= 2.0.25), libbz2-1.0, libc6 (>= 2.7), libdb4.8, libgpg-error0 (>= 1.6-1), libgpgme11 (>= 1.2.0), zlib1g (>= 1:1.2.0.2) Recommends: apt Suggests: gnupg-agent, inoticoming, lzma, xz-utils diff -r -u -N reprepro_4.2.0-2/DEBIAN/md5sums reprepro_4.2.0-2squeeze1/DEBIAN/md5sums --- reprepro_4.2.0-2/DEBIAN/md5sums 2010-10-24 12:35:49.000000000 +0200 +++ reprepro_4.2.0-2squeeze1/DEBIAN/md5sums 2011-02-22 21:01:18.000000000 +0100 @@ -1,13 +1,13 @@ -bddf387d4e112a831457249ce2f8336f usr/bin/changestool -0096b559d8b7732f41dee1c3c28c8939 usr/bin/reprepro -efa423f7e298d44dfe772440c0ca7a54 usr/bin/rredtool +b15e23081cab11900b9c7db404cadaf6 usr/bin/changestool +f0aa32f9cd1d26f73b20f9322596ecf3 usr/bin/reprepro +1a9d8383a841db87a27235a2a6e525d6 usr/bin/rredtool 9eebcd5853c2c8b8e8076e2152c8b41e usr/share/doc-base/reprepro 76f3022cae185ec0699f639099af0332 usr/share/doc/reprepro/FAQ.gz c07ed77f10acb332af8ffe9005d877d0 usr/share/doc/reprepro/NEWS.gz 798f3d5d64ff39786aa586e728574a19 usr/share/doc/reprepro/README 78da8594101caa835230f4a3159389b9 usr/share/doc/reprepro/README.Debian b37c79554960feb3aeb2236a5e1695ee usr/share/doc/reprepro/TODO -3300702ac95d85930567ea1b78e84f76 usr/share/doc/reprepro/changelog.Debian.gz +0eb5c7ef86bd193e041bf390d7d0d6c8 usr/share/doc/reprepro/changelog.Debian.gz 97edbb53d4cdd12777a27574b9a3ee3d usr/share/doc/reprepro/changelog.gz e4bb1498b6f1d1f09f8ac16d466f20b9 usr/share/doc/reprepro/copyright 1da86e7265847f906394650ca71c95a8 usr/share/doc/reprepro/examples/bzip.example Binary files reprepro_4.2.0-2/usr/bin/changestool and reprepro_4.2.0-2squeeze1/usr/bin/changestool differ Binary files reprepro_4.2.0-2/usr/bin/reprepro and reprepro_4.2.0-2squeeze1/usr/bin/reprepro differ Binary files reprepro_4.2.0-2/usr/bin/rredtool and reprepro_4.2.0-2squeeze1/usr/bin/rredtool differ diff -r -u -N reprepro_4.2.0-2/usr/share/doc/reprepro/changelog.Debian reprepro_4.2.0-2squeeze1/usr/share/doc/reprepro/changelog.Debian --- reprepro_4.2.0-2/usr/share/doc/reprepro/changelog.Debian 2010-10-24 11:14:27.000000000 +0200 +++ reprepro_4.2.0-2squeeze1/usr/share/doc/reprepro/changelog.Debian 2011-02-22 20:40:56.000000000 +0100 @@ -1,3 +1,9 @@ +reprepro (4.2.0-2squeeze1) stable-proposed-updates; urgency=low + + * handle Release files without MD5Sum (Closes: 614361) + + -- Bernhard R. Link <brlink@debian.org> Tue, 22 Feb 2011 20:39:37 +0100 + reprepro (4.2.0-2) unstable; urgency=low * include sys/stat.h in filecntl.h (Closes: 600982)
diff -r -u -N old/debian/changelog new/debian/changelog --- old/debian/changelog 2010-10-24 11:14:27.000000000 +0200 +++ new/debian/changelog 2011-02-22 20:53:45.000000000 +0100 @@ -1,3 +1,9 @@ +reprepro (4.2.0-2squeeze1) stable-proposed-updates; urgency=low + + * handle Release files without MD5Sum (Closes: 614361) + + -- Bernhard R. Link <brlink@debian.org> Tue, 22 Feb 2011 20:39:37 +0100 + reprepro (4.2.0-2) unstable; urgency=low * include sys/stat.h in filecntl.h (Closes: 600982) diff -r -u -N old/debian/patches/0006-support-Release-files-without-MD5Sum.patch new/debian/patches/0006-support-Release-files-without-MD5Sum.patch --- old/debian/patches/0006-support-Release-files-without-MD5Sum.patch 1970-01-01 01:00:00.000000000 +0100 +++ new/debian/patches/0006-support-Release-files-without-MD5Sum.patch 2011-02-22 20:54:09.000000000 +0100 @@ -0,0 +1,223 @@ +From b13d42711ce90193af66d6dc9e208c849d59b787 Mon Sep 17 00:00:00 2001 +From: Bernhard R. Link <brlink@debian.org> +Date: Tue, 22 Feb 2011 20:21:17 +0100 +Subject: support Release files without MD5Sum + +If a Release file has no MD5Sum field, fall back to only +use the other Checksums. + +This patch is similar to the one in 4.5.0 but more specific +to avoid any changes in cases where there is a MD5Sum field. + +Bug-Debian: 614361 +--- + checksums.c | 59 ++++++++++++++++++++++++++++++++++++-------------------- + checksums.h | 2 +- + readrelease.c | 23 +++++++++++++-------- + sources.c | 6 ++-- + tool.c | 2 +- + 5 files changed, 57 insertions(+), 35 deletions(-) + +diff --git a/checksums.c b/checksums.c +index af38753..fa66b5c 100644 +--- a/checksums.c ++++ b/checksums.c +@@ -674,15 +674,23 @@ retvalue hashline_parse(const char *filenametoshow, const char *line, enum check + return RET_OK; + } + +-retvalue checksumsarray_parse(struct checksumsarray *out, const struct strlist l[cs_hashCOUNT], const char *filenametoshow) { ++retvalue checksumsarray_parse(struct checksumsarray *out, const struct strlist l[cs_hashCOUNT], const char *filenametoshow, bool havemd5) { + retvalue r; + int i; + struct checksumsarray a; + struct strlist filenames; +- size_t count = l[cs_md5sum].count; ++ size_t count; + struct hashes *parsed; + enum checksumtype cs; + ++ if( havemd5 ) { ++ count = l[cs_md5sum].count; ++ } else { ++ count = 0; ++ for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) ++ count += l[cs].count; ++ } ++ + parsed = calloc(count, sizeof(struct hashes)); + if( FAILEDTOALLOC(parsed) ) { + return RET_ERROR_OOM; +@@ -741,35 +749,44 @@ retvalue checksumsarray_parse(struct checksumsarray *out, const struct strlist l + } else { + struct hash_data *hashes; + +- // TODO: suboptimal, as we know where +- // it likely is... + fileofs = strlist_ofs(&filenames, filename); + if( fileofs == -1 ) { +- // TODO: future versions might add files +- // her to the previous know ones instead, +- // once md5sum hash may be empty... +- fprintf(stderr, ++ if( havemd5 ) { ++ fprintf(stderr, + "WARNING: %s checksum line ' %s' in '%s' has no corresponding Files line!\n", +- hash_name[cs], line, +- filenametoshow); +- } +- hashes = parsed[fileofs].hashes; +- if( unlikely( hashes[cs_length].len +- != size_len +- || memcmp(hashes[cs_length].start, +- size_start, size_len) != 0) ) { +- fprintf(stderr, ++ hash_name[cs], line, ++ filenametoshow); ++ continue; ++ } ++ fileofs = filenames.count; ++ r = strlist_add_dup(&filenames, filename); ++ if( RET_WAS_ERROR(r) ) { ++ strlist_done(&filenames); ++ free(parsed); ++ return r; ++ } ++ hashes = parsed[fileofs].hashes; ++ hashes[cs_length].start = size_start; ++ hashes[cs_length].len = size_len; ++ } else { ++ hashes = parsed[fileofs].hashes; ++ if( unlikely( hashes[cs_length].len ++ != size_len ++ || memcmp(hashes[cs_length].start, ++ size_start, size_len) != 0) ) { ++ fprintf(stderr, + "WARNING: %s checksum line ' %s' in '%s' contradicts 'Files' filesize!\n", +- hash_name[cs], line, +- filenametoshow); +- continue; ++ hash_name[cs], line, ++ filenametoshow); ++ continue; ++ } + } + hashes[cs].start = hash_start; + hashes[cs].len = hash_len; + } + } + } +- assert( count == (size_t)filenames.count ); ++ assert( count >= (size_t)filenames.count ); + + if( filenames.count == 0 ) { + strlist_done(&filenames); +diff --git a/checksums.h b/checksums.h +index 2f8b3ff..9fbf890 100644 +--- a/checksums.h ++++ b/checksums.h +@@ -107,7 +107,7 @@ struct checksumsarray { + }; + void checksumsarray_move(/*@out@*/struct checksumsarray *, /*@special@*/struct checksumsarray *array)/*@requires maxSet(array->names.values) >= array->names.count /\ maxSet(array->checksums) >= array->names.count @*/ /*@releases array->checksums, array->names.values @*/; + void checksumsarray_done(/*@special@*/struct checksumsarray *array) /*@requires maxSet(array->names.values) >= array->names.count /\ maxSet(array->checksums) >= array->names.count @*/ /*@releases array->checksums, array->names.values @*/; +-retvalue checksumsarray_parse(/*@out@*/struct checksumsarray *, const struct strlist [cs_hashCOUNT], const char *filenametoshow); ++retvalue checksumsarray_parse(/*@out@*/struct checksumsarray *, const struct strlist [cs_hashCOUNT], const char *filenametoshow, bool havemd5); + retvalue checksumsarray_genfilelist(const struct checksumsarray *, /*@out@*/char **, /*@out@*/char **, /*@out@*/char **); + retvalue checksumsarray_include(struct checksumsarray *, /*@only@*/char *, const struct checksums *); + void checksumsarray_resetunsupported(const struct checksumsarray *, bool[cs_hashCOUNT]); +diff --git a/readrelease.c b/readrelease.c +index 3def5d9..f5cd758 100644 +--- a/readrelease.c ++++ b/readrelease.c +@@ -32,6 +32,8 @@ retvalue release_getchecksums(const char *releasefile, const bool ignore[cs_hash + char *chunk; + struct strlist files[cs_hashCOUNT]; + enum checksumtype cs; ++ bool foundchecksums = false; ++ bool havemd5 = true; + + r = readtextfile(releasefile, releasefile, &chunk, NULL); + assert( r != RET_NOTHING ); +@@ -47,23 +49,26 @@ retvalue release_getchecksums(const char *releasefile, const bool ignore[cs_hash + &files[cs]); + if( r == RET_NOTHING ) { + if( cs == cs_md5sum ) { +- fprintf(stderr, +-"Missing 'MD5Sum' field in Release file '%s'!\n", releasefile); +- r = RET_ERROR; +- } else +- strlist_init(&files[cs]); +- } +- if( RET_WAS_ERROR(r) ) { ++ havemd5 = false; ++ } ++ strlist_init(&files[cs]); ++ } else if( RET_WAS_ERROR(r) ) { + while( cs-- > cs_md5sum ) { + strlist_done(&files[cs]); + } + free(chunk); + return r; +- } ++ } else ++ foundchecksums = true; + } + free(chunk); ++ if( !foundchecksums ) { ++ fprintf(stderr, ++"Missing 'MD5Sum' field in Release file '%s'!\n", releasefile); ++ return RET_ERROR; ++ } + +- r = checksumsarray_parse(out, files, releasefile); ++ r = checksumsarray_parse(out, files, releasefile, havemd5); + for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) { + strlist_done(&files[cs]); + } +diff --git a/sources.c b/sources.c +index c3944b1..77155f6 100644 +--- a/sources.c ++++ b/sources.c +@@ -165,7 +165,7 @@ retvalue sources_getinstalldata(const struct target *t, const char *packagename, + return r; + } + } +- r = checksumsarray_parse(&files, filelines, packagename); ++ r = checksumsarray_parse(&files, filelines, packagename, true); + for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) { + strlist_done(&filelines[cs]); + } +@@ -303,7 +303,7 @@ retvalue sources_getchecksums(const char *chunk, struct checksumsarray *out) { + return r; + } + } +- r = checksumsarray_parse(&a, filelines, "source chunk"); ++ r = checksumsarray_parse(&a, filelines, "source chunk", true); + for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) { + strlist_done(&filelines[cs]); + } +@@ -529,7 +529,7 @@ retvalue sources_readdsc(struct dsc_headers *dsc, const char *filename, const ch + return r; + } + } +- r = checksumsarray_parse(&dsc->files, filelines, filenametoshow); ++ r = checksumsarray_parse(&dsc->files, filelines, filenametoshow, true); + for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) { + strlist_done(&filelines[cs]); + } +diff --git a/tool.c b/tool.c +index b6ab2f2..ba9fa64 100644 +--- a/tool.c ++++ b/tool.c +@@ -686,7 +686,7 @@ static retvalue read_dscfile(const char *fullfilename, struct dscfile **dsc) { + return r; + } + } +- r = checksumsarray_parse(&n->expected, filelines, fullfilename); ++ r = checksumsarray_parse(&n->expected, filelines, fullfilename, true); + for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ ) { + strlist_done(&filelines[cs]); + } +-- +1.5.6.5 + diff -r -u -N old/debian/patches/series new/debian/patches/series --- old/debian/patches/series 2010-10-24 11:14:27.000000000 +0200 +++ new/debian/patches/series 2011-02-22 20:54:09.000000000 +0100 @@ -3,3 +3,4 @@ 0003-replace-sn-with-no-copy-in-changelogs.example.patch 0004-add-support-for-ButAutomaticUpgrades-thanks-to-Mode.patch 0005-fix-typos-in-manpage.patch +0006-support-Release-files-without-MD5Sum.patch
Attachment:
reprepro_4.2.0-2squeeze1.debian.tar.gz
Description: Binary data