From: Wichert Akkerman Date: Wed, 18 Apr 2001 16:03:36 +0000 (+0000) Subject: modify install-info to take relative filesnames, and add a --remove-exactly option... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d591e9cf3d6a667d1eaf00b947f8edd07861584;p=dpkg modify install-info to take relative filesnames, and add a --remove-exactly option to only remove exact matches (Rob Browning) --- diff --git a/ChangeLog b/ChangeLog index 88b0087b..edf4147e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Wed Apr 18 18:01:21 CEST 2001 Wichert Akkerman + + * scripts/install-info.{8,pl}: modify install-info to take relative + filesnames, and add a --remove-exactly option to only remove exact + matches (Rob Browning) + +Sun Apr 15 22:42:11 CEST 2001 Wichert Akkerman + + * config.sub, config.guess: updated + * archtable: add hppa64-linux-gnu + * po/ja.po: remove some translations that gettext can't handle on hppa + Thu Apr 12 13:12:16 CEST 2001 Wichert Akkerman * po/it.po: installed new version from Lele Gaifax diff --git a/scripts/install-info.8 b/scripts/install-info.8 index badf5a7b..fd5684cd 100644 --- a/scripts/install-info.8 +++ b/scripts/install-info.8 @@ -10,7 +10,8 @@ install\-info \- create or update entry in Info directory .B install\-info [\-\-version] [\-\-help] [\-\-debug] [\-\-maxwidth=nnn] [\-\-section regexp title] [\-\-infodir=xxx] [\-\-align=nnn] -[\-\-quiet] [\-\-menuentry=xxx] [\-\-description=xxx] [\-\-remove] +[\-\-quiet] [\-\-menuentry=xxx] [\-\-description=xxx] +[\-\-remove | \-\-remove-exactly ] [\-\-] filename .SH DESCRIPTION .PP @@ -31,10 +32,16 @@ file. .TP .BI "[\-\-] " filename Gives the filename of the Info file whose menu entry is to be created, -updated or removed. The basename of this filename is used as the -referent of the menu entry which is created. This file must therefore -exist (or be about to be installed, or have previously existed when -removing an entry) in the same directory as the +updated or removed. If +.B \-\-remove-exactly +is specified, then +.I filename +should be the exact entry name to be removed (i.e. "emacs-20/emacs" or +"gcc"), otherwise the basename of this filename is used as the +referent of the menu entry which is created, unless there's an +overriding START-INFO-DIR entry inside the given file. This file must +therefore exist (or be about to be installed, or have previously +existed when removing an entry) in the same directory as the .B dir file (see the .B \-\-infodir @@ -86,6 +93,24 @@ is specified the .BR \-\-maxwidth ", " \-\-align " and " \-\-calign formatting options are silently ignored. .TP +.B \-\-remove-exactly +This option is essentially the same as +.B \-\-remove +except that +.I filename +is taken as the exact entry to be removed, rather than as the name +of an existing file. This can be important when trying to remove +entries that refer to info files in subdirectories +(i.e. "emacs-20/emacs") because +.B \-\-remove +will operate on the basename of the given +.I filename +rather than the exact name given. (i.e. +.B \-\-remove +"emacs-20/emacs" would cause +.B install-info +to look for "emacs", not "emacs-20/emacs"). +.TP .BI "\-\-section " "regexp title" Specifies that, if a new entry is to be made, it should be placed in a section of the diff --git a/scripts/install-info.pl b/scripts/install-info.pl index ed3d7dba..4305ada9 100755 --- a/scripts/install-info.pl +++ b/scripts/install-info.pl @@ -18,7 +18,9 @@ sub usage { usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] [--section regexp title] [--infodir=xxx] [--align=nnn] [--calign=nnn] [--quiet] [--menuentry=xxx] [--info-dir=xxx] - [--keep-old] [--description=xxx] [--test] [--remove] [--] + [--keep-old] [--description=xxx] [--test] + [--remove | --remove-exactly ] + [--] filename END } @@ -39,6 +41,8 @@ $keepold=0; $debug=0; $remove=0; +my $remove_exactly; + $0 =~ m|[^/]+$|; $name= $&; while ($ARGV[0] =~ m/^--/) { @@ -54,6 +58,9 @@ while ($ARGV[0] =~ m/^--/) { $keepold=1; } elsif ($_ eq '--remove') { $remove=1; + } elsif ($_ eq '--remove-exactly') { + $remove=1; + $remove_exactly=1; } elsif ($_ eq '--help') { &usage; exit 0; } elsif ($_ eq '--debug') { @@ -100,7 +107,15 @@ print STDERR "$name: test mode - dir file will not be updated\n" umask(umask(0777) & ~0444); +if($remove_exactly) { + $remove_exactly = $filename; +} + $filename =~ m|[^/]+$|; $basename= $&; $basename =~ s/(\.info)?(\.gz)?$//; + +# The location of the info files from the dir entry, i.e. (emacs-20/emacs). +my $fileinentry; + &dprint("infodir='$infodir' filename='$filename' maxwidth='$maxwidth'\nmenuentry='$menuentry' basename='$basename'\ndescription='$description' remove=$remove"); if (!$remove) { @@ -124,11 +139,15 @@ if (!$remove) { } while() { last if m/^END-INFO-DIR-ENTRY$/; $asread.= $_; } close(IF); &checkpipe; - if ($asread =~ m/(\* *[^:]+: *\([^\)]+\).*\. *.*\n){2,}/) { - $infoentry= $asread; $multiline= 1; + if ($asread =~ m/(\*\s*[^:]+:\s*\(([^\)]+)\).*\. *.*\n){2,}/) { + $infoentry= $asread; + $multiline= 1; + $fileinentry = $2; &dprint("multiline '$asread'"); - } elsif ($asread =~ m/^\* *([^:]+):( *\([^\)]+\)\.|:)\s*/) { - $menuentry= $1; $description= $'; + } elsif ($asread =~ m/^\*\s*([^:]+):(\s*\(([^\)]+)\)\.|:)\s*/) { + $menuentry= $1; + $description= $'; + $fileinentry = $3; &dprint("infile menuentry '$menuentry' description '$description'"); } elsif (length($asread)) { print STDERR <