From 597c79f9ec3288bd50157dec162ce5bea2c04ba8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 25 Dec 2007 01:22:20 +0000 Subject: (special_postinsdelete): merge with moreclean. (killmorefiles): merge with killfiles. git-svn-id: svn://tug.org/texlive/trunk@5890 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/ctan2tds | 101 +++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 60 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds index 5f7010d7cb8..5e6fa516cf8 100755 --- a/Master/tlpkg/bin/ctan2tds +++ b/Master/tlpkg/bin/ctan2tds @@ -733,21 +733,6 @@ $standardins='\.ins'; ); $standardinsrunner="latex -interaction=nonstopmode"; -%specialins_postdelete = ( - 'comprehensive', 'symbols-letter.pdf', # a4 is enough - 'dateiliste', 'dateiliste.README*', # already in dist - 'ednotes', 'perpage.sty', # copy from bigfoot - 'gfsartemisia', 'A*Specimen.pdf', # nonfree - 'gfsbodoni', 'B*Specimen.pdf', # nonfree - 'gfscomplutum', 'C*Specimen.pdf', # nonfree - 'gfsdidot', '[DO]*Specimen.pdf', # nonfree - 'gfsneohellenic', 'N*Specimen.pdf', # nonfree - 'jknapltx', 'ubbold.fd', # clashes with Ubbold.fd from bbold, - # plus sauter bbold doesn't work? - 'mathexam', 'sample.tex~', - 'mh', '*.drv *.ins', # derived from dtx's -); - %specialmakeindex= ( ); $standardmakeindex='\.ist'; @@ -1192,18 +1177,28 @@ $standardxmt='\.xmt'; # which suffixes to remove after building $cleanpatt='\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot|\.bbl|\.blg|\.idx|\.ind|\.ilg|\.glo|\.gls|\.loa'; %moreclean = ( + 'AkkTeX' => 'still to do', 'bbcard' => 'bbcard.tpm', 'chessboard' => 'chessboard.pdf', 'chessfss' => 'chessfonts_gallery.pdf|chessfss.pdf', + 'comprehensive'=> 'symbols-letter.pdf', # a4 is enough + 'dateiliste' => 'dateiliste.README*', # already in dist + 'ednotes' => 'perpage.sty', # copy from bigfoot 'epslatex-fr' => 'R?Danger.eps', 'flacards' => 'flacards.pdf', - 'minitoc' => 'minitoc-texmf.zip', # should just use it, actually - 'AkkTeX' => 'still to do', + 'gfsartemisia' => 'A*Specimen.pdf', # nonfree + 'gfsbodoni' => 'B*Specimen.pdf', # nonfree + 'gfscomplutum' => 'C*Specimen.pdf', # nonfree + 'gfsdidot' => '[DO]*Specimen.pdf', # nonfree + 'gfsneohellenic'=>'N*Specimen.pdf', # nonfree + 'guitbeamer' => 'guitbeamer-de.pdf', + 'jknapltx' => 'ubbold.fd', # clashes bbold's Ubbold.fd; sauter bbold fails + 'mathexam' => 'sample.tex~', + 'mh' => '*.drv *.ins', # derived from dtx's 'piechartmp' => 'piechartmp.pdf', - 'susy' => 'susy.pdf', 'stubs' => 'stubs.pdf', - 'guitbeamer' => 'guitbeamer-de.pdf', - 'xskak' => 'xskak.pdf', + 'susy' => 'susy.pdf', # no source + 'xskak' => 'xskak.pdf', # no source ); # Read from config file to make local adjustments to above. @@ -1449,10 +1444,10 @@ sub donormal { # # this is a bit weird, but its an easy way to remove # empty directories that we never used. - &SYSTEM("rmdir $DEST/*/$whichformat/$package 2> /dev/null"); + &SYSTEM ("rmdir $DEST/*/$whichformat/$package 2>/dev/null"); - killfiles($cleanpatt); - killmorefiles($moreclean{$package}) if $moreclean{$package}; + killfiles ($cleanpatt); + killfiles ($moreclean{$package}, "more") if $moreclean{$package}; my $postaction = $specialpostaction{$package}; eval ($postaction) if $postaction; @@ -1466,8 +1461,7 @@ sub runins { &runjob ("yes | sed 5q | $insrunner $_"); } - my $postdelete = $specialins_postdelete{$package}; - &SYSTEM ("$RM $postdelete") if $postdelete; + &killfiles ($moreclean{$package}, "more") if $moreclean{$package}; } sub install { @@ -1651,59 +1645,47 @@ sub runjob { # remove additional files matching something in $moreclean # create a README.TEXLIVE which lists the removed files # -sub killmorefiles { - my ($killpatt) = @_; - my $fh; - my @delfiles; +# remove all files matching something in $killpatt. +# also remove .ps files for which we have a .pdf. +# +sub killfiles +{ + my ($killpatt,$more) = @_; + + my @delfiles = (); for (grep (/$killpatt/, @filenames)) { print "\t Remove $_\n"; - unlink $_; - push @delfiles, $_; + if (unlink ($_)) { + push (@delfiles, $_); + } else { + warn "unlink($_) failed: $!"; + } } for (grep (/\.ps$/, @filenames)) { (my $pdf = $_) =~ s/ps$/pdf/; next unless grep (/$pdf/, @filenames); print "\t Remove ps $_ (since have $pdf)\n"; - unlink $_; - push @delfiles, $_; + unlink ($_) && push (@delfiles, $_); } - # create/add some lines to README.TEXLIVE - if (@delfiles) { - open RTL, ">>README.TEXLIVE" or warn "Cannot create README.TEXLIVE\n"; + + if ($more && @delfiles) { + # create/update README.TEXLIVE. + open RTL, ">README.TEXLIVE" or warn "open(>README.TEXLIVE) failed: $!"; print RTL <