Alexander Hall wrote:
Hi!

I'm having trouble with automated package updating using the swedish mirror (ftp.eu.openbsd.org, aka ftp.su.se). It seems that the server is not responding correctly to the "nlist *.tgz" command in OpenBSD::PackageRepository.

Here's a diff that solves the issue. I do not know how much an impact
removing "*.tgz" from the nlist command might have, but I suppose the
paths in PKG_PATH are supposed to mainly consist of .tgz's anyway.

The diff also removes a (to me) superflous
  ``m/^d.*\s+\S/'', which probably really was meant to be
  ``m/^\d.*\s+\S/'' anyway... ;-)

/Alexander

Index: PackageRepository.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm,v
retrieving revision 1.52
diff -u -p -r1.52 PackageRepository.pm
--- PackageRepository.pm        16 May 2008 18:31:47 -0000      1.52
+++ PackageRepository.pm        23 May 2008 08:41:44 -0000
@@ -645,8 +645,7 @@ sub _list
        open(my $fh, '-|', "$cmd") or return;
        while(<$fh>) {
                chomp;
-               next if m/^d.*\s+\S/;
-               next unless m/([^\s]+)\.tgz\s*$/;
+               next unless m/(\S+)\.tgz\s*$/;
                push(@$l, $1);
        }
        close($fh);
@@ -658,7 +657,7 @@ sub get_ftp_list
        my ($self, $error) = @_;

        my $fullname = $self->url;
-       return $self->_list("echo 'nlist *.tgz'| ".OpenBSD::Paths->ftp
+       return $self->_list("echo 'nlist' | ".OpenBSD::Paths->ftp
            ." $fullname 2>$error");
 }

Reply via email to