Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Peter Baumann
waste.manager at gmx.de
Fri Aug 3 13:46:08 UTC 2007
On Fri, Aug 03, 2007 at 08:23:10AM +0300, Damyan Ivanov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> - -=| Peter Baumann, 2.08.2007 14:55 |=-
> >
> > After the upgrade to version 2.005-1 debmirror decided to delete my
> > whole debian mirror. And as i didn't pay attention during debmirror
> > updates this is really annoying.
> >
> > The corresponding debmirror code is here:
> >
> > 851 my $gunzf = gzopen($file, "rb") or die "$file: $!";
> > 852 my $line;
> > 853 my $res;
> > 854 my $loop = 1;
> > 855 while ($loop) {
> > 856 my $buf = "";
> > 857 while(($res = $gunzf->gzreadline($line) > 0)
> > 858 && !($line =~ /^$/)) {
> > 859 $buf = $buf . $line;
> > 860 }
> > 861 if ($res <= 0) { # <-------- THIS IS ALWAYS TRUE AFTER THE UPGRADE
> > 862 $loop = 0;
> > 863 next;
> > 864 }
>
> I have a couple of guesses that you may help with:
>
> The code above reads until either an empty $line appears, or $res is not
> positive. Could it be possible that the file in question does no contain
> empty lines and thus the inner while reads until EOF?
>
> Or, perhaps $line needs a chomp in order to match /^$/ ?
> (yes, that would mean a behaviour change)
No. The file is fine (it is e.g dists/lenny/main/binary-i386/Packages.gz).
But this gave me the right direction. Here is the output of the slighly
changed code segment (output enclosed by '-' markers)
my $gunzf = gzopen($file, "rb") or die "$file: $!";
my $line;
my $res;
my $loop = 1;
while ($loop) {
my $buf = "";
while(($res = $gunzf->gzreadline($line) > 0)
&& !($line =~ /^$/)) {
printf "%u:%s", length($line), $line;
exit;
$buf = $buf . $line;
}
previous version (1.42-2):
-
16:Package: 2vcard
-
new version (2.005-1)
-
791:Package: 2vcard
Priority: optional
Section: utils
Installed-Size: 108
Maintainer: Martin Albisetti <argentina at gmail.com>
Architecture: i386
Version: 0.5-1
Filename: pool/main/2/2vcard/2vcard_0.5-1_i386.deb
Size: 14090
MD5sum: 074de92c99657c98dff1ed42d580f84b
SHA1: ceea35694c35437ad3f8a1e06ab7d3e698efee56
SHA256: 814b27ae828b9947d63a1ce628c85e5fb36f95075f3ccdbd23c9c908e067fb6c
Description: A little perl script to convert an addressbook to VCARD file format
2vcard is a little perl script that you can use to convert the popular vcard
file format. Currently 2vcard can only convert adressbooks and alias files from
the following formats: abook,eudora,juno,ldif,mutt,mh and pine.
.
The VCARD format is used by gnomecard, for example, which is turn is used by
the balsa email client.
-
So it is definitly a change in behaviour of gzreadline()
Greetings,
Peter Baumann
More information about the pkg-perl-maintainers
mailing list