summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-18 13:34:37 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-18 13:34:37 +0000
commitd364ebd99eecf619d794d3600c98daa08fb29d50 (patch)
tree70cf47f0b486af979cff1207c144eed513a763cc /usr.sbin
parent72221c1df53de3185949c350d7046bd41c0b75db (diff)
implement special `kitchensink' option for testers.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_add28
1 files changed, 25 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 8f2ecbd3611..a982ad3e955 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.147 2004/12/18 13:20:53 espie Exp $
+# $OpenBSD: pkg_add,v 1.148 2004/12/18 13:34:36 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -181,8 +181,14 @@ sub pre_add($$)
}
print "parsing $pkgname\n";
}
- return undef unless can_install($plist, $state, $handle);
- return $handle;
+ if (can_install($plist, $state, $handle)) {
+ return $handle;
+ } else {
+ if ($state->{forced}->{kitchensink}) {
+ $errors = 0;
+ }
+ return undef;
+ }
}
@@ -630,6 +636,19 @@ sub install_package
return ();
}
+sub reorder
+{
+ my $l = shift;
+ my $n = @$l;
+ my ($a, $i, $j);
+ for ($i = 0; $i < $n; $i++) {
+ $j = int(rand($n-$i));
+ $a = $l->[$i];
+ $l->[$i] = $l->[$n-$j-1];
+ $l->[$n-$j-1] = $a;
+ }
+}
+
set_usage('pkg_add [-acInqrvvx] [-A arch] [-B pkg-destdir] [-f keys]',
'[-L localbase] [-P type] [-Q quick-destdir] pkgname [...]');
@@ -717,6 +736,9 @@ if ($< && !$forced{nonroot}) {
fill_conflict_lists($state);
my @todo = (@ARGV);
+if (defined $state->{forced}->{kitchensink}) {
+ reorder(\@todo);
+}
eval {
while (my $pkg = shift @todo) {