ソースを参照

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

Adam Heath 25 年 前
コミット
d142473161
共有4 個のファイルを変更した26 個の追加1 個の削除を含む
  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>
 Wed Nov 28 17:30:16 CST 2001 Adam Heath <doogie@debian.org>
 
 
   * utils/md5sum.c: When parsing stdin, md5sum now displays '-' as the
   * 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
   * Fix format error in Dutch translation. Closes: Bug#113120
   * When parsing stdin, md5sum now displays '-' as the filename, to match
   * When parsing stdin, md5sum now displays '-' as the filename, to match
     textutils md5sum.  Closes: #121489.
     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
  -- 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
 .PP
 .B update-alternatives
 .B update-alternatives
 .RI [ options ]
 .RI [ options ]
+.B --list
+.I name
+.PP
+.B update-alternatives
+.RI [ options ]
 .B --config
 .B --config
 .I name
 .I name
 .SH DESCRIPTION
 .SH DESCRIPTION
@@ -313,6 +318,9 @@ which alternative the symlink currently points to,
 what other alternatives are available
 what other alternatives are available
 (and their corresponding slave alternatives),
 (and their corresponding slave alternatives),
 and the highest priority alternative currently installed.
 and the highest priority alternative currently installed.
+.TP
+\fB--list\fR \fIlink\fR
+Display all targets of the link group.
 .SH FILES
 .SH FILES
 .TP
 .TP
 .I /etc/alternatives/
 .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 --remove <name> <path>
        update-alternatives --auto <name>
        update-alternatives --auto <name>
        update-alternatives --display <name>
        update-alternatives --display <name>
+       update-alternatives --list <name>
        update-alternatives --config <name>
        update-alternatives --config <name>
 <name> is the name in /etc/alternatives.
 <name> is the name in /etc/alternatives.
 <path> is the name referred to.
 <path> is the name referred to.
@@ -93,7 +94,7 @@ while (@ARGV) {
         @ARGV >= 2 || &badusage("--remove needs <name> <path>");
         @ARGV >= 2 || &badusage("--remove needs <name> <path>");
         ($name,$apath,@ARGV) = @ARGV;
         ($name,$apath,@ARGV) = @ARGV;
         $mode= 'remove';
         $mode= 'remove';
-    } elsif (m/^--(display|auto|config)$/) {
+    } elsif (m/^--(display|auto|config|list)$/) {
         &checkmanymodes;
         &checkmanymodes;
         @ARGV || &badusage("--$1 needs <name>");
         @ARGV || &badusage("--$1 needs <name>");
         $mode= $1;
         $mode= $1;
@@ -194,6 +195,15 @@ if ($mode eq 'display') {
     exit 0;
     exit 0;
 }
 }
 
 
+if ($mode eq 'list') {
+    if ($dataread) {
+	for ($i = 0; $i<=$#versions; $i++) {
+	    &pr("$versions[$i]");
+	}
+    }
+    exit 0;
+}
+
 $best= '';
 $best= '';
 for ($i=0; $i<=$#versions; $i++) {
 for ($i=0; $i<=$#versions; $i++) {
     if ($best eq '' || $priorities[$i] > $bestpri) {
     if ($best eq '' || $priorities[$i] > $bestpri) {