summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/ctan2tds
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin/ctan2tds')
-rwxr-xr-xMaster/tlpkg/bin/ctan2tds138
1 files changed, 79 insertions, 59 deletions
diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds
index 69bc7f27da3..ccd44aead79 100755
--- a/Master/tlpkg/bin/ctan2tds
+++ b/Master/tlpkg/bin/ctan2tds
@@ -401,10 +401,15 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw
'zefonts', "&MAKEflatten",
);
-%specialpostaction = (
- 'babel' => '&POSTbabel',
- 'fpl' => '&POSTfpl',
- 'interactiveworkbook' => '&POSTinteractiveworkbook',
+%flatten_prehook = (
+ 'ibygrk' => '&FLATTEN_PREHOOK_ibygrk',
+);
+
+%specialpostaction = (
+ 'babel' => '&POSTbabel',
+ 'fpl' => '&POSTfpl',
+ 'ibygrk' => '&POSTibygrk',
+ 'interactiveworkbook' => '&POSTinteractiveworkbook',
);
@@ -590,6 +595,7 @@ $standardsourcefmt='latex';
'fontspec', 'xelatex',
'genmisc', 'generic',
'hyplain', 'plain',
+ 'ibygrk', 'generic',
'ifxetex', 'generic',
'jadetex', 'jadetex',
'mathdots', 'generic',
@@ -680,6 +686,7 @@ $standardfmt='latex';
'hfoldsty', 'fonts',
'hieroglf', 'fonts',
'hyplain', 'plain',
+ 'ibygrk', 'fonts',
'ifxetex', 'generic',
'ijqc', 'bibtex',
'iopart-num', 'bibtex',
@@ -1157,7 +1164,8 @@ $standardmf='[0-9]\.mf';
# additional mf files to be installed but not run.
%specialmfinstall = (
'astro' => 'astrosym.(cal|cmn|mac|uni|xtr)',
- 'semaphor' => '\.mp$', # actually mt1 sources
+ 'semaphor' => '\.mp$', # mt1 source
+ 'ibygrk' => 'ibycus4\.map', # tex|mf source
);
# packages which have dvips header files
@@ -1172,8 +1180,9 @@ $standardpro='\.pro$';
$standardmap='\.map';
%specialmap = (
- 'arabxetex' => '\.(map|tec)$',
- 'kerntest' => 'NULL', # skip test map file
+ 'arabxetex' => '\.(map|tec)$',
+ 'kerntest' => 'NULL', # skip test map file
+ 'ibygrk' => 'iby\.map', # not ibycus4.map, which is tex|mf
);
$standardmapdest = "fonts/map/dvips";
%specialmapdest = (
@@ -1286,43 +1295,27 @@ for (@ARGV) {
$package = pop (@x);
$DEST_TREE = $specialdest{$package} || $standarddest;
- $TOPDEST="$TDS/$package";
- $DEST="$TOPDEST/$DEST_TREE";
+ $TOPDEST = "$TDS/$package";
+ $DEST = "$TOPDEST/$DEST_TREE";
- my $MAKE=0;
- if (-f "$packagedir/Makefile") {
- open(X,"$packagedir/Makefile");
- while (<>) {
- if (/^texlive:/) {$MAKE=1;}
- }
- close(X);
- }
+ $insrunner = $specialinsrunner{$package} || $standardinsrunner;
- 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";
+ $whichformat = $specialfmt{$package} || $standardfmt;
+ $whichdocformat = $specialdocfmt{$package}
+ || ($DEST_TREE eq "texmf-doc" ? "english" : $standarddocfmt);
- } else {
-
- $insrunner = $specialinsrunner{$package} || $standardinsrunner;
-
- $whichformat = $specialfmt{$package} || $standardfmt;
- $whichdocformat = $specialdocfmt{$package}
- || ($DEST_TREE eq "texmf-doc" ? "english" : $standarddocfmt);
-
- print "pkg=$package (fmt=$whichformat docfmt=$whichdocformat) -> $DEST\n";
- if ($special{$package}) {
- if ($special{$package} =~ s/^die //) {
- # avoid repeating the die message.
- die "$package failed: $special{$package}\n";
- } else {
- print "special: $special{$package}...\n";
- eval $special{$package};
- die "$package failed in $special{$package}: $@" if $@;
- }
+ print "pkg=$package (fmt=$whichformat docfmt=$whichdocformat) -> $DEST\n";
+ if (exists $special{$package}) {
+ if ($special{$package} =~ s/^die //) {
+ # avoid repeating the die message.
+ die "$package failed: $special{$package}\n";
} else {
- &donormal;
+ print "special: $special{$package}...\n";
+ eval $special{$package};
+ die "$package failed in $special{$package}: $@" if $@;
}
+ } else {
+ &donormal;
}
&xchdir ($startdir);
@@ -1808,25 +1801,35 @@ sub SYSTEM {
}
-sub MAKEflatten {
- &setup;
- &xchdir ("$DEST/doc/$whichdocformat/$package");
+sub MAKEflatten
+{
+ &setup;
+ &xchdir ("$DEST/doc/$whichdocformat/$package");
- print "\t SPECIAL flatten $package\n";
- # so far we've only seen README's at one level.
- &SYSTEM('for d in *; do test -r $d/README && mv $d/README README.$d; done');
-
- &SYSTEM("find . -mindepth 2 -not -type d -exec mv '\{\}' . \\;");
- #-d <*/*/*/*/*/*/.> && &SYSTEM("$MV -f */*/*/*/*/* .");
- #-d <*/*/*/*/*/.> && &SYSTEM("$MV -f */*/*/*/* .");
- #-d <*/*/*/*/.> && &SYSTEM("$MV -f */*/*/* .");
- #-d <*/*/*/.> && &SYSTEM("$MV -f */*/* .");
- #-d <*/*/.> && &SYSTEM("$MV -f */*/* .");
- #-d <*/.> && &SYSTEM("$MV -f */* .");
- &SYSTEM("find -depth -type d -print | xargs rmdir 2>/dev/null");
- &SYSTEM("find -type f -print >/tmp/find");
- &buildfilelist;
- &donormal;
+ print "\t SPECIAL flatten $package\n";
+
+ # ibygrk needs to intervene at this point.
+ my $prehook = $flatten_prehook{$package};
+ if ($prehook) {
+ print "\t FLATTEN_PREHOOK: $prehook\n";
+ eval $prehook;
+ die "$package failed in $prehook: $@" if $@;
+ }
+
+ # mv foo/README to README.foo.
+ &SYSTEM ("for r in `find . -mindepth 2 -name README`; do"
+ . ' mv $r $r.`basename \`dirname $r\``; done');
+
+ # move all non-directories to top level, but don't accidentally
+ # overwrite one with another.
+ &SYSTEM ("yes n | find . -mindepth 2 -not -type d -exec mv -i '\{\}' . \\;");
+
+ # remove newly empty directories.
+ &SYSTEM ("find -depth -type d -print | xargs rmdir 2>/dev/null");
+
+ # do the usual.
+ &buildfilelist;
+ &donormal;
}
# a ctan-ready zip file.
@@ -1903,12 +1906,12 @@ sub GENMAKEhyphenation
sub MAKEcbcoptic
{
- &GENMAKEhyphenation ("coptic", "cop", "copthyph.tex");
+ &GENMAKEhyphenation ("coptic", "cop", "copthyph.tex");
}
sub MAKEibycusbabel
{
- &GENMAKEhyphenation ("ibycus", "iby", "ibyhyph.tex");
+ &GENMAKEhyphenation ("ibycus", "iby", "ibyhyph.tex");
}
# since existing mongolian is written in a different encoding,
@@ -3000,6 +3003,7 @@ sub MAKEbardiag {
&donormal;
}
+
sub MAKEmathpazo {
&setup;
chdir("$DEST/doc/latex/$package");
@@ -3248,6 +3252,22 @@ sub POSTfpl
&SYSTEM ("$MV README.source $DEST/source/fonts/fpl/README");
}
+sub FLATTEN_PREHOOK_ibygrk
+{
+ # ibygrk has two instances of the same file ibycus4.map; it is
+ # both tex source and mf source. the usual method cannot deal, of course.
+ &SYSTEM ("$MV fonts/source/public/ibycus4/ibycus4.map .");
+ &SYSTEM ("$RM tex/generic/ibycus4/ibycus4.map");
+}
+
+sub POSTibygrk
+{
+ # after the ibygrk structure has been set up, copy ibycus4.map to the
+ # tex dir.
+ &SYSTEM ("cd $DEST && $CP fonts/source/public/ibygrk/ibycus4.map "
+ . "tex/generic/ibygrk/ibycus4.map");
+}
+
sub POSTinteractiveworkbook
{
print "\t POST $package mv .sty directory\n";