Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror

Damyan Ivanov dam at modsoftsys.com
Fri Aug 3 05:23:10 UTC 2007


-----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)
- --
Damyan Ivanov            JabberID: dam at jabber.minus273.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsru+Hqjlqpcl9jsRAp/IAKCw8lc3W+k2Lya5+qvjOPzYaS+6MQCfWKHV
Wy7RdEGhIQ7ezm+JCLq1jn4=
=XtPN
-----END PGP SIGNATURE-----




More information about the pkg-perl-maintainers mailing list