summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-16 09:37:32 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-16 09:37:32 +0000
commit6681a2d93df19ca04a6a22cbd3cd6182f0478c5f (patch)
treeb8b3847ba70c3ca0ea1dc1a38542406a19464f74 /usr.sbin
parent5f0af5a6151621e365e01d103ec8c80f20fd74ac (diff)
FTP_KEEPALIVE as a crude interface to ftp -k. To be thought out later.
this is just an experiment.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Paths.pm4
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 979bc5ddc2b..72d7c2dafaa 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.46 2007/06/16 09:29:37 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.47 2007/06/16 09:37:31 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -433,8 +433,14 @@ our %distant = ();
sub grab_object
{
my ($self, $object) = @_;
+ my $ftp = $ENV{'FETCH_CMD'} || OpenBSD::Paths->ftp;
+ my @extra = ();
+ if (defined $ENV{'FTP_KEEPALIVE'}) {
+ push(@extra, "-k", $ENV{'FTP_KEEPALIVE'});
+ }
exec {OpenBSD::Paths->ftp}
"ftp",
+ @extra,
"-o",
"-", $self->url($object->{name})
or die "can't run ftp";
diff --git a/usr.sbin/pkg_add/OpenBSD/Paths.pm b/usr.sbin/pkg_add/OpenBSD/Paths.pm
index b2ebd79fd64..06a0cd33259 100644
--- a/usr.sbin/pkg_add/OpenBSD/Paths.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Paths.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Paths.pm,v 1.3 2007/06/16 09:29:37 espie Exp $
+# $OpenBSD: Paths.pm,v 1.4 2007/06/16 09:37:31 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -32,7 +32,7 @@ sub sysctl() { '/sbin/sysctl' }
sub openssl() { '/usr/sbin/openssl' }
sub chmod() { '/bin/chmod' } # external command is used for symbolic modes.
sub gzip() { '/usr/bin/gzip' }
-sub ftp() { $ENV{'FETCH_CMD'} || '/usr/bin/ftp' }
+sub ftp() { '/usr/bin/ftp' }
sub groff() { '/usr/bin/groff' }
sub sh() { '/bin/sh' }
sub arch() { '/usr/bin/arch' }