summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-10-10 09:33:57 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-10-10 09:33:57 +0000
commit1780c113ae3cfb2bd73241fa66d39b85b147a97f (patch)
treeb0f2b85e664a8fab2ad9ef4e7eec8854371277eb /usr.sbin/pkg_add
parent8dd015156d600a1405b15437232eb95bf71d1955 (diff)
Display an error message if no packages are available in the PKG_PATH.
Quote nlist command, if we invoke it accidentally in a directory with *.tgz present.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm4
-rw-r--r--usr.sbin/pkg_add/pkg_add5
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index 2cc3bb9294f..1864df5c6fe 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocator.pm,v 1.41 2005/09/24 08:43:59 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.42 2005/10/10 09:33:56 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -539,7 +539,7 @@ sub list
if (!defined $self->{list}) {
$self->make_room();
my $fullname = $self->{baseurl};
- $self->{list} = $self->_list("echo nlist *.tgz|ftp -o - $fullname 2>/dev/null");
+ $self->{list} = $self->_list("echo 'nlist *.tgz'|ftp -o - $fullname 2>/dev/null");
}
return $self->{list};
}
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index a226ff8409e..a1dbeddafe7 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.203 2005/09/19 10:19:45 espie Exp $
+# $OpenBSD: pkg_add,v 1.204 2005/10/10 09:33:56 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -622,6 +622,9 @@ sub available_stems
{
my $state = shift;
my @avail = OpenBSD::PackageLocator::available();
+ if (@avail == 0) {
+ Warn "No packages available in the PKG_PATH\n";
+ }
unless ($state->{forced}->{allversions}) {
@avail = OpenBSD::PackageName::keep_most_recent(@avail);
}