summaryrefslogtreecommitdiff
path: root/Build/tools/ctan2tl
diff options
context:
space:
mode:
Diffstat (limited to 'Build/tools/ctan2tl')
-rwxr-xr-xBuild/tools/ctan2tl60
1 files changed, 40 insertions, 20 deletions
diff --git a/Build/tools/ctan2tl b/Build/tools/ctan2tl
index 0c7a1bad3d6..d8442cbbab6 100755
--- a/Build/tools/ctan2tl
+++ b/Build/tools/ctan2tl
@@ -14,6 +14,8 @@
# --place, it doesn't even create any files in the repository outside of
# cdbuild/{raw,cooked}.
+unset CDPATH # avoid extraneous output
+
mydir=`cd \`dirname $0\` && pwd` # Build/tools
raw=$mydir/../cdbuild/raw
test -d $raw || mkdir $raw
@@ -47,20 +49,35 @@ fi
echo "$0: ctan dir for $1 is $ctan_dir1"
if $copy_from_ctan; then
-# annoyingly, tugboat plain and tugboat latex are stored in two
-# different places on ctan. we'll assume we're invoked with the latex
-# dir, and now arrange to also copy in the plain stuff to a `plain'
-# subdirectory, which ctan2tds.pl has a further special case to handle.
-#
-if test "$pkg" = tugboat; then
- ctan_dir2=`echo $ctan_dir1 | sed s/latex/plain/`
- destdir2=$pkg/plain
-fi
# remove whatever old stuff we might have.
rm -rf $pkg
-if test "$pkg" = genmisc; then
+# An important special case: the latex-tds project contains tds-ready
+# zip files for the base latex distribution. We want to use them.
+latex_tds_pkglist="amslatex|babel|cyrillic|graphics|psnfss|latex-tds|tools"
+
+if echo "$pkg" | egrep "^($latex_tds_pkglist)\$"; then
+ mkdir $pkg
+ ctan_root=`tlpkginfo --ctan-root`
+ #
+ # another complication: the latex-tds package for our purposes is the
+ # sources for the tools that do the process; that's in the zip file
+ # source.zip, in the latex-tds directory. Argh.
+ #
+ if test $pkg = latex-tds; then
+ zipname=source.zip
+ else
+ zipname=$pkg.zip
+ fi
+ (cd $pkg && unzip -qq $ctan_root/macros/latex/contrib/latex-tds/$zipname)
+
+elif test "$pkg" = rsc; then
+ # single bst file.
+ mkdir -p $pkg
+ cp -p $ctan_dir1 $pkg
+
+elif test "$pkg" = genmisc; then
# do not copy subdirs, symlinks, or any files but .sty and .tex
# (that is, no patch.doc or pmat.zip).
mkdir -p $pkg
@@ -69,19 +86,22 @@ if test "$pkg" = genmisc; then
'(' -name '*.sty' -o -name *.tex ')' -print` \
$pkg
-elif test "$pkg" = rsc; then
- # single bst file.
- mkdir -p $pkg
- cp -p $ctan_dir1 $pkg
-
else
# normal case (/. to deref symlinks, e.g., arabtex)
cp -pr $ctan_dir1/. $pkg
-
- # second ctan directory (e.g., tugboat).
- if test -n "$ctan_dir2"; then
- cp -r $ctan_dir2 $destdir2
- fi
+fi
+
+# Another special case: annoyingly, tugboat plain and tugboat latex are
+# stored in two different places on ctan. we'll assume we're invoked
+# with the latex dir, and now arrange to also copy in the plain stuff to
+# a `plain' subdirectory, which ctan2tds.pl has a further special case
+# to handle. Maybe we'll come across other cases like this, in which
+# case we can generalize this.
+#
+if test "$pkg" = tugboat; then
+ ctan_dir2=`echo $ctan_dir1 | sed s/latex/plain/`
+ destdir2=$pkg/plain
+ cp -r $ctan_dir2 $destdir2
fi
fi # end of copying from CTAN.