Quellcode durchsuchen

Apply patch from debian bug 120924, to give update-alternatives a --list
command.

Adam Heath vor 25 Jahren
Ursprung
Commit
d142473161
4 geänderte Dateien mit 26 neuen und 1 gelöschten Zeilen
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 8 0
      scripts/update-alternatives.8
  4. 11 1
      scripts/update-alternatives.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Wed Nov 28 17:40:52 CST 2001 Adam Heath <doogie@debian.org>
+
+  * scripts/update-alternatives.{pl,8}: Apply patch from debian bug 120924,
+    to give update-alternatives a --list command.
+
 Wed Nov 28 17:30:16 CST 2001 Adam Heath <doogie@debian.org>
 
   * utils/md5sum.c: When parsing stdin, md5sum now displays '-' as the

+ 2 - 0
debian/changelog

@@ -57,6 +57,8 @@ dpkg (1.10) unstable; urgency=low
   * Fix format error in Dutch translation. Closes: Bug#113120
   * When parsing stdin, md5sum now displays '-' as the filename, to match
     textutils md5sum.  Closes: #121489.
+  * Apply patch from bug, to give update-alternatives a --list command.
+    Closes: #120924.
 
  -- Wichert Akkerman <wakkerma@debian.org>  Mon, 20 Aug 2001 14:54:38 +0200
 

+ 8 - 0
scripts/update-alternatives.8

@@ -34,6 +34,11 @@ update-alternatives \- maintain symbolic links determining default commands
 .PP
 .B update-alternatives
 .RI [ options ]
+.B --list
+.I name
+.PP
+.B update-alternatives
+.RI [ options ]
 .B --config
 .I name
 .SH DESCRIPTION
@@ -313,6 +318,9 @@ which alternative the symlink currently points to,
 what other alternatives are available
 (and their corresponding slave alternatives),
 and the highest priority alternative currently installed.
+.TP
+\fB--list\fR \fIlink\fR
+Display all targets of the link group.
 .SH FILES
 .TP
 .I /etc/alternatives/

+ 11 - 1
scripts/update-alternatives.pl

@@ -42,6 +42,7 @@ Usage: update-alternatives --install <link> <name> <path> <priority>
        update-alternatives --remove <name> <path>
        update-alternatives --auto <name>
        update-alternatives --display <name>
+       update-alternatives --list <name>
        update-alternatives --config <name>
 <name> is the name in /etc/alternatives.
 <path> is the name referred to.
@@ -93,7 +94,7 @@ while (@ARGV) {
         @ARGV >= 2 || &badusage("--remove needs <name> <path>");
         ($name,$apath,@ARGV) = @ARGV;
         $mode= 'remove';
-    } elsif (m/^--(display|auto|config)$/) {
+    } elsif (m/^--(display|auto|config|list)$/) {
         &checkmanymodes;
         @ARGV || &badusage("--$1 needs <name>");
         $mode= $1;
@@ -194,6 +195,15 @@ if ($mode eq 'display') {
     exit 0;
 }
 
+if ($mode eq 'list') {
+    if ($dataread) {
+	for ($i = 0; $i<=$#versions; $i++) {
+	    &pr("$versions[$i]");
+	}
+    }
+    exit 0;
+}
+
 $best= '';
 for ($i=0; $i<=$#versions; $i++) {
     if ($best eq '' || $priorities[$i] > $bestpri) {