From 9ff01d9320cfcd3a7309de56431b2fe981bd288c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 24 Aug 2006 21:19:46 +0000 Subject: missed checkin git-svn-id: svn://tug.org/texlive/trunk@2009 c570f23f-e606-0410-a88d-b1316a301751 --- Build/tools/ctan2tl | 60 ++++++++++++++++++++++++++++++++++----------------- Build/tools/tlpkginfo | 7 +++++- 2 files changed, 46 insertions(+), 21 deletions(-) (limited to 'Build/tools') 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. diff --git a/Build/tools/tlpkginfo b/Build/tools/tlpkginfo index c8b0a82409f..db7e72c69e7 100755 --- a/Build/tools/tlpkginfo +++ b/Build/tools/tlpkginfo @@ -16,8 +16,13 @@ sub main if ($ARGV[0] eq "--ctan-dir") { return &find_ctan_dir ($ARGV[1]); + + } elsif ($ARGV[0] eq "--ctan-root") { + print "$CTAN\n"; + return 0; + } else { - die "Usage: $0 --ctan-dir PKGNAME (not @ARGV)\n"; + die "Usage: $0 --ctan-dir PKGNAME or --ctan-root (not @ARGV)\n"; } } -- cgit v1.2.3