summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-03-08 12:07:46 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-03-08 12:07:46 +0000
commitecc61d6322a93065aa3f802872ad5143a2f76706 (patch)
treee96b165e59998aa17ad02876dcaa23f5d0628abc
parentc3024e8f3379a5e1412f0f9158857dee595417a2 (diff)
rename forced to defines
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/CollisionReport.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageInfo.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm12
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm4
-rw-r--r--usr.sbin/pkg_add/pkg_add30
-rw-r--r--usr.sbin/pkg_add/pkg_delete18
-rw-r--r--usr.sbin/pkg_add/pkg_info10
11 files changed, 53 insertions, 53 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index b600fdd9eea..8fd72fa0ac3 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.81 2007/06/25 09:30:16 espie Exp $
+# $OpenBSD: Add.pm,v 1.82 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -369,7 +369,7 @@ sub prepare_for_addition
if ($s->{ro}) {
$s->report_ro($state, $fname);
}
- if ($state->{forced}->{kitchensink} && $state->{not}) {
+ if ($state->{defines}->{kitchensink} && $state->{not}) {
return;
}
if ($s->avail < 0) {
@@ -489,7 +489,7 @@ sub prepare_for_addition
if ($s->{ro}) {
$s->report_ro($state, $fname);
}
- if ($state->{forced}->{kitchensink} && $state->{not}) {
+ if ($state->{defines}->{kitchensink} && $state->{not}) {
return;
}
if ($s->avail < 0) {
@@ -680,7 +680,7 @@ sub prepare_for_addition
if ($s->{noexec} && $self->exec_on_delete) {
$s->report_noexec($state, $fname);
}
- if ($state->{forced}->{kitchensink} && $state->{not}) {
+ if ($state->{defines}->{kitchensink} && $state->{not}) {
return;
}
if ($s->avail < 0) {
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
index 4022f9c5d97..9f6d5fd57e4 100644
--- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
+++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: CollisionReport.pm,v 1.15 2007/06/20 13:44:39 espie Exp $
+# $OpenBSD: CollisionReport.pm,v 1.16 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -27,7 +27,7 @@ sub collision_report($$)
{
my ($list, $state) = @_;
- if ($state->{forced}->{removecollisions}) {
+ if ($state->{defines}->{removecollisions}) {
for my $f (@$list) {
print "rm ", $f->fullname, "\n";
unlink($f->fullname);
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 806eff3606e..7d2d3d1980b 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.59 2007/06/26 14:40:25 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.60 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -239,7 +239,7 @@ sub find_dep_in_repositories
# XXX not really efficient, but hey
my %c = map {($_->{name}, $_)} @candidates;
my @pkgs = keys %c;
- if (!$state->{forced}->{allversions}) {
+ if (!$state->{defines}->{allversions}) {
@pkgs = OpenBSD::PackageName::keep_most_recent(@pkgs);
}
if (@pkgs == 1) {
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
index 39bd8f5aa05..22cbc33c09c 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageInfo.pm,v 1.36 2008/01/12 14:02:32 espie Exp $
+# $OpenBSD: PackageInfo.pm,v 1.37 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -250,7 +250,7 @@ sub solve_installed_names
next if $found;
print "Ambiguous: $pkgname could be ", join(' ', @l),"\n";
- if ($state->{forced}->{ambiguous}) {
+ if ($state->{defines}->{ambiguous}) {
print "$msg\n";
push(@$new, @l);
for my $p (@l) {
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 3e2b6513751..5938bfaf28d 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.143 2007/07/14 21:50:05 ajacoutot Exp $
+# $OpenBSD: PackingElement.pm,v 1.144 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -1368,7 +1368,7 @@ sub run
return if $not;
chmod 0755, $name;
return if $state->system($name, $pkgname, @args) == 0;
- if ($state->{forced}->{scripts}) {
+ if ($state->{defines}->{scripts}) {
$state->warn($self->beautify, " script failed\n");
} else {
$state->fatal($self->beautify." script failed");
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index a94382537ea..fe56bb59933 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.43 2008/03/02 23:43:32 espie Exp $
+# $OpenBSD: Replace.pm,v 1.44 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -224,7 +224,7 @@ sub validate_depend
# nothing to do if new dependency just matches
return if $self->spec->filter($replacement);
- if ($state->{forced}->{updatedepends}) {
+ if ($state->{defines}->{updatedepends}) {
Warn "Forward dependency of $wanting on $toreplace doesn't match $replacement, forcing it\n";
$state->{forcedupdates} = {} unless defined $state->{forcedupdates};
$state->{forcedupdates}->{$wanting} = 1;
@@ -312,7 +312,7 @@ sub can_old_package_be_replaced
for my $i (@{$state->{journal}}) {
Warn "\t$i\n";
}
- if ($state->{forced}->{update}) {
+ if ($state->{defines}->{update}) {
Warn "(forcing update)\n";
$state->{okay} = 1;
} elsif ($state->{interactive}) {
@@ -356,7 +356,7 @@ sub is_new_package_safe
for my $i (@{$state->{journal}}) {
Warn "\t$i\n";
}
- if ($state->{forced}->{update}) {
+ if ($state->{defines}->{update}) {
Warn "(forcing update)\n";
$state->{okay} = 1;
} elsif ($state->{interactive}) {
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 9555dbbbb04..f91723474b3 100644
--- a/usr.sbin/pkg_add/OpenBSD/Update.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Update.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Update.pm,v 1.81 2007/09/20 09:01:34 espie Exp $
+# $OpenBSD: Update.pm,v 1.82 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -64,7 +64,7 @@ sub process_package
}
my @search = ();
push(@search, OpenBSD::Search::Stem->split($pkgname));
- if (!$state->{forced}->{allversions}) {
+ if (!$state->{defines}->{allversions}) {
push(@search, OpenBSD::Search::Filter->keep_most_recent);
}
@@ -77,7 +77,7 @@ sub process_package
if (@l == 0) {
return @l;
}
- if (@l == 1 && $state->{forced}->{pkgpath}) {
+ if (@l == 1 && $state->{defines}->{pkgpath}) {
return @l;
}
my @l2 = ();
@@ -126,14 +126,14 @@ sub process_package
return;
}
if (@l == 1) {
- if ($state->{forced}->{pkgpath}) {
+ if ($state->{defines}->{pkgpath}) {
$state->progress->clear;
print "Directly updating $pkgname -> ", $l[0], "\n";
$self->add2updates($l[0]);
return;
}
if (defined $found && $found eq $l[0] &&
- !$plist->uses_old_libs && !$state->{forced}->{installed}) {
+ !$plist->uses_old_libs && !$state->{defines}->{installed}) {
my $msg = "No need to update $pkgname";
$state->progress->message($msg);
print "$msg\n" if $state->{beverbose};
@@ -168,7 +168,7 @@ sub process
my @list = ();
OpenBSD::PackageInfo::solve_installed_names($old, \@list, "(updating them all)", $state);
- unless (defined $state->{full_update} or defined $state->{forced}->{noclosure}) {
+ unless (defined $state->{full_update} or defined $state->{defines}->{noclosure}) {
require OpenBSD::RequiredBy;
@list = OpenBSD::Requiring->compute_closure(@list);
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 761584438f0..b30dd7917fc 100644
--- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
+++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: UpdateSet.pm,v 1.2 2007/06/30 11:38:38 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.3 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -62,7 +62,7 @@ sub setup_progressmeter
sub check_root
{
my $state = shift;
- if ($< && !$state->{forced}->{nonroot}) {
+ if ($< && !$state->{defines}->{nonroot}) {
if ($state->{not}) {
Warn "$0 should be run as root\n";
} else {
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index f97be947884..9cd31991335 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.330 2008/03/08 11:32:38 espie Exp $
+# $OpenBSD: pkg_add,v 1.331 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -37,7 +37,7 @@ use OpenBSD::UpdateSet;
my $bad = 0;
-our %forced = ();
+our %defines = ();
our $not;
package OpenBSD::pkg_add::State;
@@ -173,7 +173,7 @@ sub can_install
@conflicts = keys %conflicts;
if (!$state->{allow_replacing}) {
- if ($state->{forced}->{conflicts}) {
+ if ($state->{defines}->{conflicts}) {
print "Forcing install of $pkgname in the presence of conflicts (",join(',', @conflicts), ")\n";
return 1;
}
@@ -420,7 +420,7 @@ sub install_set
return ();
}
if ($handle->has_error) {
- if ((!$state->{forced}->{kitchensink} ||
+ if ((!$state->{defines}->{kitchensink} ||
$handle->has_error(OpenBSD::Handle::BAD_PACKAGE)) &&
!$handle->{tweaked}) {
$state->set_name_from_handle($handle);
@@ -436,7 +436,7 @@ sub install_set
if ($plist->has('arch')) {
unless ($plist->{arch}->check($state->{arch})) {
print "$handle->{pkgname} is not for the right architecture\n";
- return () unless $forced{arch};
+ return () unless $defines{arch};
}
}
if (!defined $set->{solver}) {
@@ -465,7 +465,7 @@ sub install_set
# print "Didn't need to process: ", join(',', @{$set->{solver}->{todo}}), "\n";
if (!$set->{solver}->solve_wantlibs($state)) {
$location->close_now;
- if (!$forced{libdepends}) {
+ if (!$defines{libdepends}) {
$bad++;
return ();
}
@@ -493,7 +493,7 @@ sub find_truenames
$path = "";
}
my @l = $h->match(OpenBSD::Search::Stem->new($pkgname));
- if (@l > 1 && !$state->{forced}->{allversions}) {
+ if (@l > 1 && !$state->{defines}->{allversions}) {
@l = OpenBSD::PackageName::keep_most_recent(@l);
}
my $result = OpenBSD::Interactive::choose1($pkgname, $state->{interactive}, sort @l);
@@ -535,12 +535,12 @@ try {
'h' => sub { Usage(); },
'F' => sub {
for my $o (split /\,/o, shift) {
- $forced{$o} = 1;
+ $defines{$o} = 1;
}
},
'f' => sub {
for my $o (split /\,/o, shift) {
- $forced{$o} = 1;
+ $defines{$o} = 1;
}
}});
} catchall {
@@ -556,7 +556,7 @@ $state->{recorder} = OpenBSD::SharedItemsRecorder->new;
$state->{do_faked} = 0;
$state->{localbase} = $opt_L;
$state->{arch} = $opt_A;
-$state->{forced} = \%forced;
+$state->{defines} = \%defines;
if (defined $opt_Q and defined $opt_B) {
Usage "-Q and -B are incompatible options";
@@ -609,7 +609,7 @@ if (@ARGV == 0 && !$opt_u) {
Usage "Missing pkgname";
}
-lock_db($state->{not}) unless $state->{forced}->{nolock};
+lock_db($state->{not}) unless $state->{defines}->{nolock};
$state->setup_progressmeter($opt_x);
$state->check_root;
@@ -629,7 +629,7 @@ if ($opt_u) {
if (@cantupdate > 0) {
print "Cannot find updates for ", join(' ', @cantupdate), "\n";
- if ($state->{forced}->{alwaysupdate} ||
+ if ($state->{defines}->{alwaysupdate} ||
$state->{full_update} && !$state->{interactive}) {
print "Proceeding anyways\n";
} else {
@@ -651,7 +651,7 @@ if ($opt_u) {
} else {
find_truenames(\@ARGV, \@todo, $state);
OpenBSD::Add::tag_user_packages(@todo);
- if (defined $state->{forced}->{kitchensink}) {
+ if (defined $state->{defines}->{kitchensink}) {
reorder(\@todo);
if (!$opt_r) {
@todo = grep {s/\.tgz$//o; !is_installed($_);} @todo;
@@ -697,7 +697,7 @@ if (defined $state->{updatedepends} && %{$state->{updatedepends}}) {
join(' ', sort(keys %{$state->{updatedepends}})),
" may remain\n";
}
-if (defined $state->{forced}->{kitchensink}) {
+if (defined $state->{defines}->{kitchensink}) {
print "Added:\n", (map { "\t$_\n" } sort $state->installed), "\n";
}
rethrow $dielater;
@@ -770,7 +770,7 @@ sub get_plist
if (is_installed($pkgname) &&
(!$state->{allow_replacing} ||
- !$state->{forced}->{installed} &&
+ !$state->{defines}->{installed} &&
!$plist->has_new_sig($state) &&
!$plist->uses_old_libs)) {
$handle->{tweaked} =
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete
index 2d9abb15a3f..e39c624ae0a 100644
--- a/usr.sbin/pkg_add/pkg_delete
+++ b/usr.sbin/pkg_add/pkg_delete
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_delete,v 1.112 2008/03/08 11:32:38 espie Exp $
+# $OpenBSD: pkg_delete,v 1.113 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -29,7 +29,7 @@ use OpenBSD::Vstat;
use OpenBSD::Paths;
use OpenBSD::UpdateSet;
-our %forced = ();
+our %defines = ();
our $not;
package OpenBSD::pkg_delete::State;
@@ -48,12 +48,12 @@ try {
'h' => sub { Usage(); },
'F' => sub {
for my $o (split /\,/o, shift) {
- $forced{$o} = 1;
+ $defines{$o} = 1;
}
},
'f' => sub {
for my $o (split /\,/o, shift) {
- $forced{$o} = 1;
+ $defines{$o} = 1;
}
}});
} catchall {
@@ -94,7 +94,7 @@ $state->{verbose} = $opt_v;
$state->{beverbose} = $opt_n || ($opt_v >= 2);
$state->{extra} = $opt_c;
$state->{dont_run_scripts} = $opt_I;
-$state->{forced} = \%forced;
+$state->{defines} = \%defines;
$state->{destdir} = $opt_B;
$state->{interactive} = $opt_i;
if ($opt_B eq '') {
@@ -105,7 +105,7 @@ if ($opt_B eq '') {
$ENV{'PKG_DELETE_EXTRA'} = $state->{extra} ? "Yes" : "No";
-lock_db($opt_n) unless $state->{forced}->{nolock};
+lock_db($opt_n) unless $state->{defines}->{nolock};
$state->setup_progressmeter($opt_x);
$state->check_root;
@@ -120,7 +120,7 @@ OpenBSD::PackageInfo::solve_installed_names(\@ARGV, \@realnames,
my @todo = OpenBSD::RequiredBy->compute_closure(@realnames);
if (@todo > @realnames) {
- my $details = $state->{very_verbose} || $forced{verbosedeps};
+ my $details = $state->{very_verbose} || $defines{verbosedeps};
my $show = sub {
my ($p, $d) = @_;
print "Can't remove ".join(' ', @$p)." without also removing:\n"
@@ -146,7 +146,7 @@ if (@todo > @realnames) {
}
}
my $them = @todo > 1 ? 'them' : 'it';
- if ($forced{dependencies} or
+ if ($defines{dependencies} or
OpenBSD::Interactive::confirm("Do you want to remove $them as well", $state->{interactive}, 0)) {
print "(removing $them as well)\n";
} else {
@@ -172,7 +172,7 @@ eval {
}
my $r = OpenBSD::RequiredBy->new($pkgname);
if ($r->list > 0) {
- if ($forced{baddepend}) {
+ if ($defines{baddepend}) {
for my $p ($r->list) {
if ($done{$p}) {
$r->delete($p);
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index 4849ac2e084..e52773bea7f 100644
--- a/usr.sbin/pkg_add/pkg_info
+++ b/usr.sbin/pkg_add/pkg_info
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_info,v 1.65 2007/12/18 10:58:46 espie Exp $
+# $OpenBSD: pkg_info,v 1.66 2008/03/08 12:07:45 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -342,7 +342,7 @@ sub print_info
set_usage('pkg_info [-AacDdfIiKkLMPpqRrSstUv] [-F opt] [-E filename] [-e pkg-name] [-l str] [-Q query] [pkg-name] [...]');
-my %forced;
+my %defines;
my $locked;
try {
getopts('cDdfF:hIikKLmpPQ:qRrsSUve:E:Ml:aAt',
@@ -350,7 +350,7 @@ try {
sub {
my $pat = shift;
my @list;
- lock_db(1, $opt_q) unless $forced{nolock};
+ lock_db(1, $opt_q) unless $defines{nolock};
$locked = 1;
if ($pat =~ m/\//o) {
@list = find_by_path($pat);
@@ -366,7 +366,7 @@ try {
},
'F' => sub {
for my $o (split /\,/o, shift) {
- $forced{$o} = 1;
+ $defines{$o} = 1;
}
},
'h' => sub { Usage(); },
@@ -382,7 +382,7 @@ try {
Usage($_);
};
-lock_db(1, $opt_q) unless $locked or $forced{nolock};
+lock_db(1, $opt_q) unless $locked or $defines{nolock};
if ($opt_D) {
$opt_M = 1;