Taisuke Yamada <tai.deb...@cc.rakugaki.org> writes: > Hi. > > I was recently hit by ia32-apt-get bug (Bug #512634) caused by > zero-size *_Packages file, and it seems no official response was > made since January. > > This can be fixed by simply ignoring such *_Packages file, > so I'm sending in this one-line patch. Please include it in > next release. > > Best Regards, > Taisuke Yamada > --- apt-get.orig 2009-03-09 11:39:25.000000000 +0900 > +++ apt-get 2009-03-09 11:39:11.000000000 +0900 > @@ -66,6 +66,7 @@ > > # Mangle foreign files > for F in $LISTDIR/foreign/lists/*_*; do > + test -s "$F" || continue > DIR="$(dirname "$F")" > case "$F" in > *_Packages)
That would leave the old file in place possibly giving a checksum error. I've just commited the following patch to svn.debian.org pkg-ia32-libs: --- ia32-libs-tools/mangle.cc (revision 245) +++ ia32-libs-tools/mangle.cc (working copy) @@ -224,7 +224,8 @@ std::vector<PkgDepOr> pkgAnd; size_t parse(std::string& s, size_t offset) { while(offset < s.length()) { - if (s[offset] == ' ' || s[offset] == ',') { + if (s[offset] == ' ' || s[offset] == ',' + || s[offset] == '\t' || s[offset] == '\n') { ++offset; continue; } @@ -399,7 +400,9 @@ assert(buf != NULL); } } - assert(buf_used > 1); + // In case of empty file + if (buf_used < 2) exit(0); + // Ensure end of stanza at end of file while(buf[buf_used-2] != '\n') { buf[buf_used++] = '\n'; } The first chunk fixes the original problem of having multi-line Depends in the Packages file. The second chunk fixes the problem for empty files. MfG Goswin -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org