From f0861f5a89471d7def19271bd1a4c23584becb2a Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 24 Dec 2000 04:29:53 +0000 Subject: [PATCH] Add --truename option. --- ChangeLog | 4 ++++ debian/changelog | 1 + scripts/dpkg-divert.8 | 7 ++++++- scripts/dpkg-divert.pl | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cf72e99f..c982d658 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Dec 23 22:24:23 CST 2000 Adam Heath + + * scripts/dpkg-divert.pl: Add --truename option. + Sat Dec 23 21:40:32 CST 2000 Adam Heath * main/dpkg.8: Document COLUMNS environment variable. diff --git a/debian/changelog b/debian/changelog index 1b1ac2e1..9eca204e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ dpkg (1.8.0) unstable; urgency=low + * Add --truename option to dpkg-divert. Closes: #68489. * Documented COLUMNS in dpkg(8). Closes: #77001. * Modified DPKG_C_GCC_TRY_WARNS() to call AC_SUBST, so that we can use the result of the test during build time. Closes: Bug#75138 diff --git a/scripts/dpkg-divert.8 b/scripts/dpkg-divert.8 index 3aebe9dc..81404359 100644 --- a/scripts/dpkg-divert.8 +++ b/scripts/dpkg-divert.8 @@ -14,6 +14,10 @@ dpkg-divert -- override a package's version of a file [options] --list .I +.B dpkg-divert +[options] --truename +.I +.br .SH DESCRIPTION File `diversions' are a way of forcing dpkg not to install a file into its location, but to a `diverted' location. Diversions can be used through the @@ -26,7 +30,8 @@ contains those files. .B dpkg-divert is the utility used to set up and update the list of diversions. It functions in three basic modes - adding, removing, and listing diversions. -The options are --add, --remove, and --list, respectively. Other options +The options are --add, --remove, and --list, respectively. Additionally, +it can print out the real name for a diverted file. Other options (listed below) may also be specified. .SH OPTIONS .TP diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl index f176d8fb..310b8675 100755 --- a/scripts/dpkg-divert.pl +++ b/scripts/dpkg-divert.pl @@ -25,6 +25,7 @@ Usage: dpkg-divert [options] [--add] - add a diversion dpkg-divert [options] --remove - remove the diversion dpkg-divert [options] --list [] - show file diversions + dpkg-divert [options] --truname - return the diverted file Options: --package name of the package whose copy of @@ -82,6 +83,9 @@ while (@ARGV) { } elsif (m/^--list$/) { &checkmanymodes; $mode= 'list'; + } elsif (m/^--truename$/) { + &checkmanymodes; + $mode= 'truename'; } elsif (m/^--divert$/) { @ARGV || &badusage("--divert needs a divert-to argument"); $divertto= shift(@ARGV); @@ -177,6 +181,16 @@ if ($mode eq 'add') { print &infon($i),"\n"; } exit(0); +} elsif ($mode eq 'truename') { + @ARGV == 1 || &badusage("--truename needs a single argument"); + $file= $ARGV[0]; + for ($i=0; $i<=$#contest; $i++) { + next unless $file eq $contest[$i]; + print $altname[$i], "\n"; + exit(0); + } + print $file, "\n"; + exit(0); } else { &quit("internal error - bad mode \`$mode'"); } -- 2.39.5