diff options
author | Karl Berry <karl@freefriends.org> | 2008-07-05 00:27:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-07-05 00:27:12 +0000 |
commit | f57e0777e744d6301293e19c969c8155215087ea (patch) | |
tree | 077ec67fc7437240ad6ba2dcb6f9c0b16f6e6145 /Master/tlpkg/bin | |
parent | 00ced70ffb05fb5ae5ce19c49b7c576f4b5331c8 (diff) |
ogham update; also minimize no-install and mktextfm output
git-svn-id: svn://tug.org/texlive/trunk@9259 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/ctan2tds | 119 |
1 files changed, 43 insertions, 76 deletions
diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds index 1884c1af6ff..a4119f9d677 100755 --- a/Master/tlpkg/bin/ctan2tds +++ b/Master/tlpkg/bin/ctan2tds @@ -1532,16 +1532,20 @@ sub runins &killfiles ($specialclean{$package} || $standardclean); } -sub install { +sub install +{ my ($destdir,$thispatt) = @_; return unless $thispatt; + my @files = grep (/$thispatt/, @filenames); # ugh, @filenames global + return unless @files; # avoid lots of useless output + print "\t INSTALL $thispatt to $destdir\n"; - &SYSTEM ("mkdir -p $destdir") unless -d $destdir; + &xmkdir ($destdir) unless -d $destdir; - for (grep (/$thispatt/, @filenames)) { - next if $_ eq "dtx-style.sty"; # this should never be in runtime - &SYSTEM ("$MV $_ $destdir"); + for my $file (@files) { + next if $file eq "dtx-style.sty"; # this should never be in runtime + &SYSTEM ("$MV $file $destdir"); } } @@ -1574,7 +1578,8 @@ sub domakeindex } # BibTeX style files: -sub dobst { +sub dobst +{ $csfpatt = $specialcsf{$package}; if ($csfpatt eq "") { $csfpatt=$standardcsf; } &install("$DEST/bibtex/csf/$package",$csfpatt); @@ -1725,22 +1730,25 @@ sub rundvi { } print "\t MAKEDVI done\n"; } -# + # run a &SYSTEM job, and append stderr output to log file # -sub runjob { - local($job) = @_; - if ($opt_test) { print "RUNJOB $job\n"} - else{ - $Jobid="_$$"; - &SYSTEM("$job 2> $Jobid.log"); - open(TMP,"$Jobid.log") || die("Failed to open $Jobid.log") ; - print "Now (runjob1), filenames is: ", join(", ", @filenames), ".\n"; - print ">> $_" while (<TMP>); - print "Now (runjob2), filenames is: ", join(", ", @filenames), ".\n"; - close(TMP); - unlink "$Jobid.log"; - } +sub runjob +{ + my ($job) = @_; + + if ($opt_test) { + print "WOULDRUNJOB $job\n"; + } else { + my $Jobid = "_$$"; + &SYSTEM ("$job >$Jobid.log 2>&1"); + local *TMP; + open (TMP, "$Jobid.log") || die "open($Jobid.log) failed: $!"; + my @output = (<TMP>); + print $output[$#output-1]; # successfully generated line + close (TMP); + unlink ("$Jobid.log"); + } } # remove additional files matching something in $moreclean @@ -1791,23 +1799,25 @@ EOF } # rebuild list of input files, e.g., after flattening -sub buildfilelist { +sub buildfilelist +{ print "doing buildfilelist()...\n"; - opendir(DIR,'.') || die ("ERROR: cannot open directory"); - @filenames =grep(!/^\.\.?$/,readdir(DIR)); - closedir(DIR); + opendir (DIR ,'.') || die "opendir(.) failed: $!"; + @filenames = grep (!/^\.\.?$/, readdir (DIR)); + closedir (DIR); } -sub runmf { +sub runmf +{ my ($mfpatt) = @_; - print "\t Make fonts for $package ($mfpatt)\n"; - for (grep (/$mfpatt/,@filenames)) { - ($FileBase,$Filepath,$Filesuffix) = fileparse ($_,"\.[A-z]*"); - if (! -e "$FileBase.tfm") { - print "\t\t Make TFM from $_\n"; - &runjob("mktextfm --destdir=`pwd` $FileBase.tfm"); - &SYSTEM ("$RM *pk"); # not worth the space - } + print "\t doing runmf for $package ($mfpatt)\n"; + for my $file (grep (/$mfpatt/, @filenames)) { + ($FileBase,$Filepath,$Filesuffix) = fileparse ($file, "\.[A-z]*"); + if (! -e "$FileBase.tfm") { + print "\t\t Make TFM from $file\n"; + &runjob ("mktextfm --destdir=`pwd` $FileBase.tfm"); + &SYSTEM ("$RM *pk"); # not worth the space + } } } @@ -2688,49 +2698,6 @@ sub MAKEt2 { &runjob("rm *log; mv *sty $DEST/tex/latex/t2"); } -sub MAKEcontext { -# this simply copies source files - chdir($packagedir) || die ("ERROR: cannot open directory"); - &runjob("mkdir -p $DEST"); - &runjob("$CP cont-tmf.zip cont-wrk.zip cont-uti.zip $DEST"); - chdir($DEST) || die ("ERROR: cannot open directory"); - &runjob("unzip -o cont-tmf"); - &runjob("unzip -o cont-uti"); - &runjob("unzip -o cont-wrk"); - &runjob("mkdir web2c"); - &runjob("cd tex/context/config; mv texexec.rm texexec.ini"); - &runjob("rm cont-tmf.zip cont-wrk.zip cont-uti.zip "); -open FOO,">tex/context/config/cont-cz.ini"; -print FOO "\\input cont-cz.tex\n"; -print FOO "\\endinput"; -close FOO; -open FOO,">tex/context/config/cont-de.ini"; -print FOO "\\input cont-de.tex\n"; -print FOO "\\endinput"; -close FOO; -open FOO,">tex/context/config/cont-en.ini"; -print FOO "\\input cont-en.tex\n"; -print FOO "\\endinput"; -close FOO; -open FOO,">tex/context/config/cont-nl.ini"; -print FOO "\\input cont-nl.tex\n"; -print FOO "\\endinput"; -close FOO; -open FOO,">tex/context/config/cont-uk.ini"; -print FOO "\\input cont-uk.tex\n"; -print FOO "\\endinput"; -close FOO; -open FOO,">tex/context/config/context.ini"; -print FOO "\\input context.tex\n"; -print FOO "\\endinput"; -close FOO; -# &runjob("sed 's/\#\#//' < `kpsewhich fmtutil.cnf` > /tmp/fmtutil.$Jobid"); -# &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-en"); -# &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-de"); -# &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-nl"); -# &runjob("rm /tmp/fmtutil.$Jobid"); - } - # docs in two languages. The English one is in a separate package, # mathmode. Just remove it from the copy when building the German one. # |