Package: dpkg Version: 1.13.10 Severity: wishlist File: /usr/sbin/update-alternatives
I would like to see a --list-all option added to update-alternatives. The semantics should be obvious: list all valid arguments to, say, update-alternatives --config $i. I have attached a patch which (AFAICT) DTRT. I have no experience writing documentation, man pages in particular, but feel free to use the following text as inspiration: --list-all Display all link groups, sorted alphabetically. --Jonas Kölker -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing'), (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.8-1-686 Locale: LANG=C, LC_CTYPE=C (charmap=locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory ANSI_X3.4-1968) (ignored: LC_ALL set to iso_8859_1) Versions of packages dpkg depends on: ii coreutils [textutils] 5.2.1-2 The GNU core utilities ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an ii textutils 5.2.1-2 The GNU text file processing utili dpkg recommends no packages. -- debconf information: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = "iso_8859_1", LANG = (unset) are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory ===File ~/development/perl/alternatives/update-alternatives.patch=== *** /usr/sbin/update-alternatives Tue Jun 28 15:22:33 2005 --- update-alternatives Sun Aug 14 00:22:39 2005 *************** *** 46,51 **** --- 46,52 ---- update-alternatives --config <name> update-alternatives --set <name> <path> update-alternatives --all + update-alternatives --list-all <name> is the name in /etc/alternatives. <path> is the name referred to. <link> is the link pointing to /etc/alternatives/<name>. *************** *** 116,121 **** --- 117,124 ---- $admindir= shift(@ARGV); } elsif (m/^--all$/) { $mode = 'all'; + } elsif (m/^--list-all$/) { + $mode = 'list-all'; } else { &badusage("unknown option \`$_'"); } *************** *** 129,134 **** --- 132,139 ---- if ($mode eq 'all') { &config_all(); + } elsif ($mode eq 'list-all') { + &list_all(); } if (open(AF,"$admindir/$name")) { *************** *** 641,646 **** --- 646,660 ---- } exit(0); } + sub list_all { + opendir ADMINDIR, $admindir or die "Serious problem: $!"; + my @filenames = grep !/^\.\.?$/, readdir ADMINDIR; + close ADMINDIR; + foreach my $name (sort @filenames) { + print STDOUT "$name\n"; + } + exit(0); + } exit(0); # vim: nowrap ts=8 sw=4 ============================================================ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]