pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_alternatives/files Add the -g flag to exp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d33e9c8a24c1
branches:  trunk
changeset: 488200:d33e9c8a24c1
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Tue Jan 25 16:47:20 2005 +0000

description:
Add the -g flag to explicitly select the "group mode" (previously known as
"package mode").  Use previous version bump for this change.

diffstat:

 pkgtools/pkg_alternatives/files/pkg_alternatives.8  |  31 +++++++++++++-------
 pkgtools/pkg_alternatives/files/pkg_alternatives.sh |  11 ++++--
 2 files changed, 27 insertions(+), 15 deletions(-)

diffs (124 lines):

diff -r 6ce565ed94ca -r d33e9c8a24c1 pkgtools/pkg_alternatives/files/pkg_alternatives.8
--- a/pkgtools/pkg_alternatives/files/pkg_alternatives.8        Tue Jan 25 16:33:29 2005 +0000
+++ b/pkgtools/pkg_alternatives/files/pkg_alternatives.8        Tue Jan 25 16:47:20 2005 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_alternatives.8,v 1.2 2005/01/25 16:27:37 jmmv Exp $
+.\" $NetBSD: pkg_alternatives.8,v 1.3 2005/01/25 16:47:20 jmmv Exp $
 .\"
 .\" pkg_alternatives - Generic wrappers for programs with similar interfaces
 .\" Copyright (c) 2005 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
@@ -35,7 +35,7 @@
 .Nd generic wrappers for programs with similar interfaces
 .Sh SYNOPSIS
 .Nm
-.Op Fl sw
+.Op Fl gsw
 .Op Fl p Ar prefix
 action
 .Ar arg1 ... argN
@@ -62,13 +62,14 @@
 .Em alternatives
 available.
 .Pp
-The alternatives are classified according to the
-.Em package
-they belong to.
+The alternatives are classified according to the package they belong to,
+forming
+.Em groups
+of alternatives.
 In other words, a concrete package contains a list of all the wrappers it
 affects by providing alternatives to them.
 This makes things easier to the end user and/or the administrator who has
-to deal with them, as they can manually select a package rather than a
+to deal with them, as they can manually select a group (package) rather than a
 bunch of wrappers.
 .Pp
 Wrappers are identified by its file name relative to the installation
@@ -129,6 +130,12 @@
 .Ss Options
 The following options are available:
 .Bl -tag -width XpXprefixX
+.It Fl g
+Operate on groups of wrappers rather than individual files.
+This is the opposite of
+.Fl w
+and is currently the default behavior.
+Affects the behavior of all actions.
 .It Fl p Ar prefix
 Set installation prefix.
 This affects where wrappers and their manual pages are looked for.
@@ -138,12 +145,14 @@
 .It Fl s
 Run in silent mode: no output except for errors.
 .It Fl w
-Operate on wrappers rather than on packages.
-This affects the behavior of all actions.
+Operate on individual wrappers rather than on groups.
+This is the opposite of
+.Fl g .
+Affects the behavior of all actions.
 .El
-.Ss Actions in package mode
+.Ss Actions in group mode
 The following table describes each available action and its behavior when
-working in package mode.
+working in group mode.
 All these actions are at a higher level than the same actions in wrapper
 mode.
 They always end up using the later at some point, so you should also
@@ -215,7 +224,7 @@
 working in wrapper mode.
 Note that these actions work at a very low level as they are used to manage
 wrappers and alternative commands directly.
-In most situations, you will want to use these actions in package mode.
+In most situations, you will want to use these actions in group mode.
 .Bl -tag -width XXXX
 .It auto Ar wrapper
 Removes any manual configuration created for the given
diff -r 6ce565ed94ca -r d33e9c8a24c1 pkgtools/pkg_alternatives/files/pkg_alternatives.sh
--- a/pkgtools/pkg_alternatives/files/pkg_alternatives.sh       Tue Jan 25 16:33:29 2005 +0000
+++ b/pkgtools/pkg_alternatives/files/pkg_alternatives.sh       Tue Jan 25 16:47:20 2005 +0000
@@ -1,6 +1,6 @@
 #!@SH@
 #
-# $NetBSD: pkg_alternatives.sh,v 1.2 2005/01/25 16:27:37 jmmv Exp $
+# $NetBSD: pkg_alternatives.sh,v 1.3 2005/01/25 16:47:20 jmmv Exp $
 #
 # pkg_alternatives - Generic wrappers for programs with similar interfaces
 # Copyright (c) 2005 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
@@ -99,7 +99,7 @@
         wrapper=$(echo ${w} | sed -e 's|^./||')
         manpage=$(get_manpage ${wrapper})
         info "removing wrapper \`${wrapper}'"
-       rm -f ${Prefix}/${wrapper}
+        rm -f ${Prefix}/${wrapper}
         info "removing manual page \`${manpage}'"
         rm -f ${manpage}
     done
@@ -490,7 +490,7 @@
 # Shows an usage message and exits the program with an error condition.
 #
 usage() {
-    echo "Usage: ${Prog_Name} [-sw] [-p prefix] action [arg1 ... argN]" 1>&2
+    echo "Usage: ${Prog_Name} [-gsw] [-p prefix] action [arg1 ... argN]" 1>&2
     exit 1
 }
 
@@ -603,12 +603,15 @@
 # action.
 #
 main() {
-    args=$(getopt p:sw ${*})
+    args=$(getopt gp:sw ${*})
     [ ${?} -eq 0 ] || usage
     set -- ${args}
     what=package
     while [ ${#} -gt 0 ]; do
         case ${1} in
+            -g)
+                what=package
+                ;;
             -p)
                 Prefix=$2; shift
                 Conf_Dir=@CONFDIR@${Prefix}



Home | Main Index | Thread Index | Old Index