summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-04-29 23:30:07 +0000
committerKarl Berry <karl@freefriends.org>2007-04-29 23:30:07 +0000
commita1b151ad437972b837725bb02125327854fe43f7 (patch)
tree23cc6b65d7131ed861a824adb1c1ceba5dfaf45e
parentea36cf1b393aed7652593bba4164790837051671 (diff)
formatting cleanups (plenty more remain)
git-svn-id: svn://tug.org/texlive/trunk@4213 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/cdbuild/ctan2tds.pl233
1 files changed, 107 insertions, 126 deletions
diff --git a/Build/cdbuild/ctan2tds.pl b/Build/cdbuild/ctan2tds.pl
index 8d22439b854..f5854d69164 100755
--- a/Build/cdbuild/ctan2tds.pl
+++ b/Build/cdbuild/ctan2tds.pl
@@ -1081,53 +1081,49 @@ readconfig();
#
for (@ARGV) {
- $packagedir=$_;
- if (! -d $packagedir) {
- warn "$0: $packagedir not a directory, skipping.\n";
- next;
- }
-
- @x=split(/\//,$packagedir);
- $package=pop(@x);
- my $dest=$specialdest{$package} || "texmf-dist";
+ $packagedir=$_;
+ if (! -d $packagedir) {
+ warn "$0: $packagedir not a directory, skipping.\n";
+ next;
+ }
- $TOPDEST="$TDS/$package";
- $DEST="$TOPDEST/$dest";
+ @x=split(/\//,$packagedir);
+ $package=pop(@x);
+ my $dest=$specialdest{$package} || "texmf-dist";
- my $MAKE=0;
- if (-f "$packagedir/Makefile") {
- open(X,"$packagedir/Makefile");
- while (<>) {
- if (/^texlive:/) {$MAKE=1;}
- }
- close(X);
+ $TOPDEST="$TDS/$package";
+ $DEST="$TOPDEST/$dest";
+ my $MAKE=0;
+ if (-f "$packagedir/Makefile") {
+ open(X,"$packagedir/Makefile");
+ while (<>) {
+ if (/^texlive:/) {$MAKE=1;}
}
- if ($MAKE) {
+ close(X);
+ }
+
+ if ($MAKE) {
&SYSTEM("cd $packagedir; make -f Makefile texlive; mkdir -p $DEST; mv texmf/* $DEST)");
print "Package $packagedir has a TeXlive-aware Makefile. Make and send to $DEST\n";
-}
-else
-{
- $insrunner=$specialinsrunner{$package};
- if ($insrunner eq "") { $insrunner=$standardinsrunner; }
+
+ } else {
+ $insrunner = $specialinsrunner{$package} || $standardinsrunner;
$whichformat = $specialfmt{$package} || $standardfmt;
$whichdocformat = $specialdocfmt{$package}
|| ($dest eq "texmf-doc" ? "english" : $standarddocfmt);
- print "pkg=$package (fmt=$whichformat docfmt=$whichdocformat) -> $DEST\n";
- if ($special{$package} ne "") {
- eval $special{$package};
- die "failure in $special{$package} (for $package): $@" if $@;
- }
- else
- {
- &donormal;
- }
+ print "pkg=$package (fmt=$whichformat docfmt=$whichdocformat) -> $DEST\n";
+ if ($special{$package} ne "") {
+ eval $special{$package};
+ die "failure in $special{$package} (for $package): $@" if $@;
+ } else {
+ &donormal;
+ }
+ }
-}
- &xchdir ($startdir);
+ &xchdir ($startdir);
}
@@ -1268,34 +1264,31 @@ sub donormal {
killfiles($cleanpatt);
killfiles($moreclean{$package}) if $moreclean{$package};
}
-#=================================================================
-#
-# running .ins files usually works with LaTeX, but plain
-# tex is needed sometimes - textmerg at least doesnt work with LaTeX.
-# how to deal with that?
-#
+
sub runins {
- my ($thispatt) = @_;
- print "\t RUNINS $thispatt\n";
- for (grep(/$thispatt/,@filenames)) {
- print "\t RUN $_\n" ;
- &runjob("yes | $insrunner $_");
- }
-
- my $postdelete = $specialins_postdelete{$package};
- &SYSTEM ("rm -f $postdelete") if $postdelete;
+ my ($thispatt) = @_;
+ print "\t RUNINS $thispatt\n";
+ for (grep (/$thispatt/, @filenames)) {
+ print "\t RUN $_\n" ;
+ &runjob ("yes | $insrunner $_");
+ }
+
+ my $postdelete = $specialins_postdelete{$package};
+ &SYSTEM ("rm -f $postdelete") if $postdelete;
}
+
sub install {
- local($destdir,$thispatt) = @_;
- print "\t INSTALL $thispatt to $destdir\n";
- for (grep(/$thispatt/,@filenames)) {
- if (! -d $destdir) { &SYSTEM("mkdir -p $destdir") }
- &SYSTEM("$MV $_ $destdir");
- }
+ local($destdir,$thispatt) = @_;
+ print "\t INSTALL $thispatt to $destdir\n";
+ for (grep (/$thispatt/, @filenames)) {
+ &SYSTEM ("mkdir -p $destdir") unless -d $destdir;
+ &SYSTEM ("$MV $_ $destdir");
+ }
}
-sub dodvi {
+
# build the documentation files
- $dvipatt = $specialdvi{$package };
+sub dodvi {
+ $dvipatt = $specialdvi{$package};
# packages which are doc themselves rarely rebuild cleanly,
# and aren't worth it.
$dvipatt = "NULL" if $specialdest{$package} eq "texmf-doc";
@@ -1303,125 +1296,119 @@ sub dodvi {
&rundvi($dvipatt);
}
-sub domakeindex {
+# move the runtime files
+sub dotex {
+ my $texpatt = $specialtex{$package} || $standardtex;
+ &install("$DEST/tex/$whichformat/$package", $texpatt);
+}
+
# move the makeindex runtime files
- $makeindexpatt = $specialmakeindex{$package };
+sub domakeindex {
+ $makeindexpatt = $specialmakeindex{$package};
if ($makeindexpatt eq "") { $makeindexpatt=$standardmakeindex; }
&install("$DEST/makeindex/$package",$makeindexpatt);
}
-sub dotex {
-# move the runtime files
- $texpatt = $specialtex{$package };
- if ($texpatt eq "") { $texpatt=$standardtex; }
- &install("$DEST/tex/$whichformat/$package",$texpatt);
-}
-
-
+# BibTeX style files:
sub dobst {
-# there may be some BibTeX style files
- $csfpatt = $specialcsf{$package };
+ $csfpatt = $specialcsf{$package};
if ($csfpatt eq "") { $csfpatt=$standardcsf; }
&install("$DEST/bibtex/csf/$package",$csfpatt);
- $bstpatt = $specialbst{$package };
+ $bstpatt = $specialbst{$package};
if ($bstpatt eq "") { $bstpatt=$standardbst; }
&install("$DEST/bibtex/bst/$package",$bstpatt);
}
+# simple MF files, e.g., if specialfoundry eq "metafont".
sub dosimplemf {
-# there may be some simple MF files, e.g., if specialfoundry eq "metafont".
my $mfpatt = $specialmf{$package} || $standardmf;
&install ("$DEST/metafont/$package", $mfpatt);
}
+
+# MetaPost files:
sub domp {
-# there may be some Metapost files
- $mppatt = $specialmp{$package };
- if ($mppatt eq "") { $mppatt=$standardmp; }
- &install("$DEST/metapost/$package",$mppatt);
+ $mppatt = $specialmp{$package} || $standardmp;
+ &install("$DEST/metapost/$package", $mppatt);
}
+# BibTeX bibliography files:
sub dobib{
-# and some BibTeX bibliography files
- $bibpatt = $specialbib{$package };
- if ($bibpatt eq "") { $bibpatt=$standardbib; }
- &install("$DEST/bibtex/bib/$package",$bibpatt);
+ $bibpatt = $specialbib{$package} || $standardbib;
+ &install("$DEST/bibtex/bib/$package", $bibpatt);
}
+# source files:
sub dosource{
-# now the source:
- $sourceformat = $specialsourcefmt{$package };
+ $sourceformat = $specialsourcefmt{$package};
if ($sourceformat eq "") { $sourceformat=$standardsourcefmt; }
# default to using specialdocfmt, as we do in setup?
- $sourcepatt = $specialsource{$package };
+ $sourcepatt = $specialsource{$package};
if ($sourcepatt eq "") { $sourcepatt=$standardsource; }
&install("$DEST/source/$sourceformat/$package",$sourcepatt);
}
sub doomega{
- $ovfpatt = $specialovf{$package };
+ $ovfpatt = $specialovf{$package};
if ($ovfpatt eq "") { $ovfpatt=$standardovf; }
&install("$DEST/fonts/ovf/public/$package",$ovfpatt);
- $ofmpatt = $specialofm{$package };
+ $ofmpatt = $specialofm{$package};
if ($ofmpatt eq "") { $ofmpatt=$standardofm; }
&install("$DEST/fonts/ofm/public/$package",$ofmpatt);
- $ovppatt = $specialovp{$package };
+ $ovppatt = $specialovp{$package};
if ($ovppatt eq "") { $ovppatt=$standardovp; }
&install("$DEST/fonts/ovp/public/$package",$ovppatt);
- $otppatt = $specialotp{$package };
+ $otppatt = $specialotp{$package};
if ($otppatt eq "") { $otppatt=$standardotp; }
&install("$DEST/omega/otp/$package",$otppatt);
- $ocppatt = $specialocp{$package };
+ $ocppatt = $specialocp{$package};
if ($ocppatt eq "") { $ocppatt=$standardocp; }
&install("$DEST/omega/ocp/$package",$ocppatt);
}
+# the dvips and font mapping files:
sub dotype1{
-# now the dvips and font mapping files:
- $encpatt = $specialenc{$package };
- if ($encpatt eq "") { $encpatt=$standardenc; }
- &install("$DEST/fonts/enc/dvips/$package",$encpatt);
+ my $encpatt = $specialenc{$package} || $standardenc;
+ &install("$DEST/fonts/enc/dvips/$package", $encpatt);
my $mappatt = $specialmap{$package} || $standardmap;
my $mapdest = $specialmapdest{$package} || $standardmapdest;
&install ("$DEST/$mapdest/$package", $mappatt);
- $vmappatt = $specialvmap{$package };
- if ($vmappatt eq "") { $vmappatt=$standardvmap; }
- &install("$DEST/fonts/map/vtex/$package",$vmappatt);
-
- $propatt = $specialpro{$package };
- if ($propatt eq "") { $propatt=$standardpro; }
- &install("$DEST/dvips/$package",$propatt);
- $pfbpatt = $specialpfb{$package };
- if ($pfbpatt eq "") { $pfbpatt=$standardpfb; }
- &install("$DEST/fonts/type1/public/$package",$pfbpatt);
- $afmpatt = $specialafm{$package };
- if ($afmpatt eq "") { $afmpatt=$standardafm; }
- &install("$DEST/fonts/afm/public/$package",$afmpatt);
- $pfmpatt = $specialpfm{$package };
- if ($pfmpatt eq "") { $pfmpatt=$standardpfm; }
- &install("$DEST/fonts/type1/public/$package",$pfmpatt);
- if ($otfpatt eq "") { $otfpatt=$standardotf; }
- &install("$DEST/fonts/opentype/public/$package",$otfpatt);
+ my $vmappatt = $specialvmap{$package} || $standardvmap;
+ &install("$DEST/fonts/map/vtex/$package", $vmappatt);
+
+ my $propatt = $specialpro{$package} || $standardpro;
+ &install("$DEST/dvips/$package", $propatt);
+
+ my $pfbpatt = $specialpfb{$package} || $standardpfb;
+ &install("$DEST/fonts/type1/public/$package", $pfbpatt);
+
+ my $afmpatt = $specialafm{$package} || $standardafm;
+ &install("$DEST/fonts/afm/public/$package", $afmpatt);
+
+ my $pfmpatt = $specialpfm{$package} || $standardpfm;
+ &install("$DEST/fonts/type1/public/$package", $pfmpatt);
+
+ my $otfpatt = $specialotf{$package} || $standardotf;
+ &install("$DEST/fonts/opentype/public/$package", $otfpatt);
}
+# xmltex files
sub doxmt{
-# now the xmltex files:
- $xmtpatt = $specialxmt{$package };
- if ($xmtpatt eq "") { $xmtpatt=$standardxmt; }
- &install("$DEST/tex/xmltex/$package",$xmtpatt);
+ my $xmtpatt = $specialxmt{$package} || $standardxmt;
+ &install("$DEST/tex/xmltex/$package", $xmtpatt);
}
-sub domf {
# build the font files
+sub domf {
$mfpatt = $specialmf{$package} || $standardmf;
&runmf ($mfpatt);
}
sub rundvi {
local($thispatt) = @_;
- $TEX = $specialTEX{$package };
+ $TEX = $specialTEX{$package};
if ($TEX eq "") {
if ($whichformat eq 'latex') { $TEX="pdflatex"; }
else { $TEX=$whichformat; }
@@ -2242,7 +2229,7 @@ sub MAKEexpressg {
&setup;
chdir("$DEST/doc/$whichdocformat/$package");
&buildfilelist;
- $inspatt = $specialins{$package };
+ $inspatt = $specialins{$package};
&buildfilelist;
if ($inspatt eq "") {
$inspatt=$standardins;
@@ -2432,7 +2419,7 @@ sub MAKEwilson {
&buildfilelist;
# run the .ins files (if any) supplied
- $inspatt = $specialins{$package };
+ $inspatt = $specialins{$package};
&buildfilelist;
&runins($inspatt || $standardins);
&dodvi;
@@ -2852,14 +2839,8 @@ sub MAKEpict2e {
chdir("$DEST/doc/$whichdocformat/$package");
&buildfilelist;
# run the .ins files (if any) supplied
- $inspatt = $specialins{$package };
- if ($inspatt eq "") {
- $inspatt=$standardins;
- }
- $Foundry = $specialfoundry{$package };
- if ($Foundry eq "") {
- $Foundry=$standardfoundry;
- }
+ $inspatt = $specialins{$package} || $standardins;
+ $Foundry = $specialfoundry{$package} || $standardfoundry;
&runins($inspatt);
# rebuild the list of files in the directory
&SYSTEM("$MV pict2e-example.cfg pict2e.cfg");