[tex-live] uninitialized variable $firstline in TLUtils.pm

Ulf-Dietrich Braumann braumann at uni-leipzig.de
Tue Sep 18 17:45:19 CEST 2012


Hello,


once I updated my Cygwin based TL2012 installation today, I noticed some 
complaint when the TLUtils.pm Perl script is executed: "use of unitialized 
value $firstline":

%tlmgr update -all
tlmgr: package repository 
http://ftp.fernuni-hagen.de/ftp-dir/pub/mirrors/www.ctan.org/systems/texlive/tlnet
tlmgr: saving backups to /usr/local/texlive/2012/tlpkg/backups
[1/4, ??:??/??:??] update: fancytabs [181k] (23839 -> 27684) ... done
[2/4, 00:08/00:41] update: fixmetodonotes [7k] (27053 -> 27685) ... done
[3/4, 00:15/01:15] update: upmethodology [436k] (16575 -> 27686) ... done
[4/4, 01:03/01:35] update: uptex [321k] (26775 -> 27683) ... done
tlmgr: package log updated at 
/usr/local/texlive/2012/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
running mtxrun --generate ...
done running mtxrun --generate.
Use of uninitialized value $firstline in chomp at 
/usr/local/texlive/2012/tlpkg/TeXLive/TLUtils.pm line 2695.
Use of uninitialized value $firstline in pattern match (m//) at 
/usr/local/texlive/2012/tlpkg/TeXLive/TLUtils.pm line 2698.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in /usr/local/texlive/2012/texmf-var
running fmtutil-sys --no-error-if-no-format --byengine euptex ...
done running fmtutil-sys --no-error-if-no-format --byengine euptex.
running fmtutil-sys --no-error-if-no-format --byengine uptex ...
done running fmtutil-sys --no-error-if-no-format --byengine uptex.
%

This is the function inside TLUtils.pm where $firstline appears 
uninitialised:

sub check_for_old_updmap_cfg {
   chomp( my $tmfsysconf = `kpsewhich -var-value=TEXMFSYSCONFIG` ) ;
   my $oldupd = "$tmfsysconf/web2c/updmap.cfg";
   return unless -r $oldupd;  # if no such file, good.

   open (OLDUPD, "<$oldupd") || die "open($oldupd) failed: $!";
   chomp( my $firstline = <OLDUPD> );
   close(OLDUPD);
   #
   if ($firstline =~ m/^# Generated by (install-tl|.*\/tlmgr) on/) {
     # assume it was our doing, rename it.
     my $nn = "$oldupd.DISABLED";
     if (-r $nn) {
       my $fh;
       ($fh, $nn) = File::Temp::tempfile(
         "updmap.cfg.DISABLED.XXXXXX", DIR => "$tmfsysconf/web2c");
     }
     print "Renaming old config file from
   $oldupd
to
   $nn
";
     if (rename($oldupd, $nn)) {
       if (system("mktexlsr", $tmfsysconf) != 0) {
         die "mktexlsr $tmfsysconf failed after updmap.cfg rename, fix fix: 
$!";
       }
       print "No further action should be necessary.\n";
     } else {
       print STDERR "
Renaming of
   $oldupd
did not succeed.  This config file should not be used anymore,
so please do what's necessary to eliminate it.
See the documentation for updmap.
";
     }

   } else {  # first line did not match
     # that is NOT a good idea, because updmap creates updmap.cfg in
     # TEXMFSYSCONFIG when called with --enable Map etc, so we should
     # NOT warn here
     # print STDERR "Apparently
#  $oldupd
# was created by hand.  This config file should not be used anymore,
# so please do what's necessary to eliminate it.
# See the documentation for updmap.
# ";
   }
}


Any ideas? I need to admit that I have installed additional fonts under 
/usr/local/texlive/texmf-local , and actually everything seems to work 
fine, I just wonder what consequences the abovementioned complaint in 
TLUtils.pm might have.

Regards - UD



More information about the tex-live mailing list