- if ( ! -d "$TMP/usr/share/info") {
- doit("install","-d","$TMP/usr/share/info");
- }
- doit("cp",@info,"$TMP/usr/share/info");
- doit("chmod","-R", "go=rX","$TMP/usr/share/info/");
- doit("chmod","-R", "u+rw","$TMP/usr/share/info/");
- }
-
- foreach $file (@info) {
- # Only register with install-info if this is a head file in
- # a tree of info files.
- if ($file=~/\.info$/ && ! $dh{NOSCRIPTS}) {
- # Figure out what section this file goes in.
- my $section='';
- open (IN, "<$file") || die "$file: $!";
- while (<IN>) {
- if (/INFO-DIR-SECTION\s+(.*)/) {
- $section=$1;
- last;
- }
- }
- close IN;
-
- my $fn="/usr/share/info/".Dh_Lib::basename($file);
-
- if ($section ne '') {
- $section=~s:/:\\/:g; # allow / in section.
- autoscript($PACKAGE,"postinst","postinst-info",
- "s/#SECTION#/$section/g;s:#FILE#:$fn:");
- }
- else {
- autoscript($PACKAGE,"postinst","postinst-info-nosection",
- "s:#FILE#:$fn:");
- }
- autoscript($PACKAGE,"prerm","prerm-info", "s:#FILE#:$fn:");