diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-10 21:28:00 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-10 21:28:00 +0000 |
commit | b039c5e2f74be6a127e392ec2effc1aebc324126 (patch) | |
tree | c8c8595f9db084f5c6f46a002b88bd6d76d17e53 | |
parent | 6da0bc7f38345d7dd3b9755ca396488764f8a274 (diff) |
unify options a bit: use -Dname=value for defines uniformously (e.g., deprecate
-F keyword heavily).
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 12 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add.1 | 20 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_create.1 | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete.1 | 20 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 12 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info.1 | 8 |
9 files changed, 54 insertions, 39 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 534ce67ac5d..98f8d916b7b 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.16 2010/01/09 14:49:53 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.17 2010/01/10 21:27:59 espie Exp $ # # Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org> # @@ -30,11 +30,19 @@ sub handle_options set_usage(@usage); $state = OpenBSD::State->new; $hash->{h} = sub { Usage(); }; - $hash->{f} = $hash->{F} = sub { + $hash->{F} = sub { for my $o (split /\,/o, shift) { $defines{$o} = 1; } }; + $hash->{D} = sub { + my $_ = shift; + if (m/^(.*?)=(.*)/) { + $defines{$1} = $2; + } else { + $defines{$_} = 1; + } + }; try { getopts('hciInqvsxB:f:F:L:'.$opt_string, $hash); } catchall { diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 26dfbd9a97d..dc8b34652fa 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.464 2010/01/10 16:03:49 espie Exp $ +# $OpenBSD: pkg_add,v 1.465 2010/01/10 21:27:59 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -810,7 +810,7 @@ sub install_set our ($opt_a, $opt_A, $opt_P, $opt_Q, $opt_r, $opt_u, $opt_U, $opt_l, $opt_z); handle_options('aqchruUzl:A:P:Q:', {}, - 'pkg_add [-acIinqrsUuvxz] [-A arch] [-B pkg-destdir] [-F keywords]', + 'pkg_add [-acIinqrsUuvxz] [-A arch] [-B pkg-destdir] [-D name[=value]]', '[-L localbase] [-l file] [-P type] [-Q quick-destdir] pkg-name [...]'); local $SIG{'INFO'} = sub { $state->status->print($state); }; diff --git a/usr.sbin/pkg_add/pkg_add.1 b/usr.sbin/pkg_add/pkg_add.1 index 91d6ed8281b..cf413dfdf67 100644 --- a/usr.sbin/pkg_add/pkg_add.1 +++ b/usr.sbin/pkg_add/pkg_add.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pkg_add.1,v 1.91 2010/01/04 00:20:05 espie Exp $ +.\" $OpenBSD: pkg_add.1,v 1.92 2010/01/10 21:27:59 espie Exp $ .\" .\" Documentation and design originally from FreeBSD. All the code has .\" been rewritten since. We keep the documentation's notice: @@ -15,7 +15,7 @@ .\" Jordan K. Hubbard .\" .\" -.Dd $Mdocdate: January 4 2010 $ +.Dd $Mdocdate: January 10 2010 $ .Dt PKG_ADD 1 .Os .Sh NAME @@ -27,7 +27,10 @@ .Op Fl acIinqrsUuvxz .Op Fl A Ar arch .Op Fl B Ar pkg-destdir -.Op Fl F Ar keywords +.Oo Fl D Ar name +.Ns Oo Ns = Ns Ar value +.Oc +.Oc .Op Fl L Ar localbase .Op Fl l Ar file .Op Fl P Ar type @@ -225,12 +228,15 @@ While replacing packages, delete extra configuration file in the old package, mentioned as .Dl @extra file in the packing-list. -.It Fl F Ar keywords +.It Fl D Ar name Ns = Ns Ar value Force installation of the package. -.Ar keywords -is a comma-separated list of keywords that state what failsafes +.Ar name +is a keyword that states what failsafe should be waived. -These include: +The +.Op = Ns value +part is actually unnecessary in most cases. +Recognized keywords include: .Pp .Bl -tag -width "updatedependsXX" -compact .It Ar allversions diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index d398c15623d..e527a176d70 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.131 2010/01/10 11:47:48 espie Exp $ +# $OpenBSD: pkg_create,v 1.132 2010/01/10 21:27:59 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -495,7 +495,7 @@ my ($cert, $privkey); set_usage( -'pkg_create [-nQqv] [-A arches] [-B pkg-destdir] [-D name=value]', +'pkg_create [-nQqv] [-A arches] [-B pkg-destdir] [-D name[=value]]', '[-L localbase] [-M displayfile] [-P pkg-dependency]', '[-s x509 -s cert -s priv] [-U undisplayfile] [-W wantedlib]', '-d desc -D COMMENT=value -f packinglist -p prefix pkg-name'); diff --git a/usr.sbin/pkg_add/pkg_create.1 b/usr.sbin/pkg_add/pkg_create.1 index a1bd423af8f..558ac1dbc46 100644 --- a/usr.sbin/pkg_add/pkg_create.1 +++ b/usr.sbin/pkg_add/pkg_create.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pkg_create.1,v 1.54 2010/01/05 11:31:07 espie Exp $ +.\" $OpenBSD: pkg_create.1,v 1.55 2010/01/10 21:27:59 espie Exp $ .\" .\" Documentation and design originally from FreeBSD. All the code has .\" been rewritten since. We keep the documentation's notice: @@ -21,7 +21,7 @@ .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" -.Dd $Mdocdate: January 5 2010 $ +.Dd $Mdocdate: January 10 2010 $ .Dt PKG_CREATE 1 .Os .Sh NAME @@ -34,7 +34,8 @@ .Op Fl A Ar arches .Op Fl B Ar pkg-destdir .Oo Fl D Ar name -.Ns = Ns Ar value +.Ns Oo Ns = Ns Ar value +.Oc .Oc .Op Fl L Ar localbase .Op Fl M Ar displayfile diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index d38e43e1f64..b0fba068f20 100644 --- a/usr.sbin/pkg_add/pkg_delete +++ b/usr.sbin/pkg_add/pkg_delete @@ -1,8 +1,8 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_delete,v 1.132 2009/12/21 11:03:00 espie Exp $ +# $OpenBSD: pkg_delete,v 1.133 2010/01/10 21:27:59 espie Exp $ # -# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> +# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -40,7 +40,7 @@ use OpenBSD::PackageInfo; use OpenBSD::UpdateSet; handle_options('chxDnq', {}, - 'pkg_delete [-cIinqsvx] [-B pkg-destdir] [-F keywords] pkg-name [...]'); + 'pkg_delete [-cIinqsvx] [-B pkg-destdir] [-D name[=value]] pkg-name [...]'); local $SIG{'INFO'} = sub { $state->status->print($state); }; $opt_B = $ENV{'PKG_DESTDIR'} unless defined $opt_B; diff --git a/usr.sbin/pkg_add/pkg_delete.1 b/usr.sbin/pkg_add/pkg_delete.1 index 1ddaf4c4163..d3bf268b195 100644 --- a/usr.sbin/pkg_add/pkg_delete.1 +++ b/usr.sbin/pkg_add/pkg_delete.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pkg_delete.1,v 1.30 2009/12/21 11:03:00 espie Exp $ +.\" $OpenBSD: pkg_delete.1,v 1.31 2010/01/10 21:27:59 espie Exp $ .\" .\" Documentation and design originally from FreeBSD. All the code has .\" been rewritten since. We keep the documentation's notice: @@ -15,7 +15,7 @@ .\" Jordan K. Hubbard .\" .\" -.Dd $Mdocdate: December 21 2009 $ +.Dd $Mdocdate: January 10 2010 $ .Dt PKG_DELETE 1 .Os .Sh NAME @@ -25,7 +25,10 @@ .Nm pkg_delete .Op Fl cIinqsvx .Op Fl B Ar pkg-destdir -.Op Fl F Ar keywords +.Oo Fl D Ar name +.Ns Oo Ns = Ns Ar value +.Oc +.Oc .Ar pkg-name Op Ar ... .Sh DESCRIPTION The @@ -59,12 +62,15 @@ as the prefix to prepend to any object deleted. Delete extra configuration file, mentioned as .Dl @extra file in the packing-list. -.It Fl F Ar keywords +.It Fl D Ar name Ns = Ns Ar value Force removal of the package. -.Ar keywords -is a comma-separated list of keywords that state what failsafes +.Ar name +is a keyword that states what failsafe should be waived. -These include: +The +.Op = Ns value +part is actually unnecessary in most cases. +Recognized keywords include: .Bl -tag -width "dependenciesXX" .It Ar ambiguous delete all packages matching ambiguous package specifications. diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 55f24f9d990..4a06772b756 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.91 2010/01/10 11:59:57 espie Exp $ +# $OpenBSD: pkg_info,v 1.92 2010/01/10 21:27:59 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -275,7 +275,7 @@ sub find_by_path } } -our ($opt_c, $opt_C, $opt_D, $opt_d, $opt_f, $opt_I, $opt_K, +our ($opt_c, $opt_C, $opt_d, $opt_f, $opt_I, $opt_K, $opt_L, $opt_Q, $opt_q, $opt_R, $opt_s, $opt_v, $opt_h, $opt_l, $opt_a, $opt_m, $opt_M, $opt_U, $opt_A, $opt_S, $opt_P, $opt_t); my $terse = 0; @@ -407,12 +407,12 @@ sub print_info } } -set_usage('pkg_info [-AacCDdfIKLMmPqRSstUv] [-F opt] [-E filename] [-e pkg-name] [-l str] [-Q query] [pkg-name] [...]'); +set_usage('pkg_info [-AacCdfIKLMmPqRSstUv] [-F opt] [-E filename] [-e pkg-name] [-l str] [-Q query] [pkg-name] [...]'); my %defines; my $locked; try { - getopts('cCDdfF:hIKLmPQ:qRsSUve:E:Ml:aAt', + getopts('cCdfF:hIKLmPQ:qRsSUve:E:Ml:aAt', {'e' => sub { my $pat = shift; @@ -451,10 +451,6 @@ try { lock_db(1, $opt_q) unless $locked or $defines{nolock}; -if ($opt_D) { - $opt_M = 1; -} - unless ($opt_c || $opt_M || $opt_U || $opt_d || $opt_f || $opt_I || $opt_L || $opt_R || $opt_s || $opt_S || $opt_P || $terse) { diff --git a/usr.sbin/pkg_add/pkg_info.1 b/usr.sbin/pkg_add/pkg_info.1 index 983fdac2524..a5f877fa698 100644 --- a/usr.sbin/pkg_add/pkg_info.1 +++ b/usr.sbin/pkg_add/pkg_info.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pkg_info.1,v 1.35 2010/01/08 17:06:00 espie Exp $ +.\" $OpenBSD: pkg_info.1,v 1.36 2010/01/10 21:27:59 espie Exp $ .\" .\" Documentation and design originally from FreeBSD. All the code has .\" been rewritten since. We keep the documentation's notice: @@ -15,7 +15,7 @@ .\" Jordan K. Hubbard .\" .\" -.Dd $Mdocdate: January 8 2010 $ +.Dd $Mdocdate: January 10 2010 $ .Dt PKG_INFO 1 .Os .Sh NAME @@ -24,7 +24,7 @@ .Sh SYNOPSIS .Nm pkg_info .Bk -words -.Op Fl AacCDdfIKLMmPqRSstUv +.Op Fl AacCdfIKLMmPqRSstUv .Op Fl E Ar filename .Op Fl e Ar pkg-name .Op Fl l Ar str @@ -72,8 +72,6 @@ Show information for all currently installed packages. Show the one-line comment field for each package. .It Fl C Show certificate information for signed packages. -.It Fl D -Show the install-message file (if any) for each package (deprecated option). .It Fl d Show the long-description field for each package. .It Fl E Ar filename |