summaryrefslogtreecommitdiff
path: root/Master/Tools/ctan2tl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2005-12-28 00:04:28 +0000
committerKarl Berry <karl@freefriends.org>2005-12-28 00:04:28 +0000
commite6faeef3e4205722d36bbbb86b3b3390ab6527be (patch)
treeb6bf2abd8e881f40beaca430df2e1c34c02c19ab /Master/Tools/ctan2tl
parent577983747d8680b8defbfdd03a9d50bad6fd54b7 (diff)
trunk
git-svn-id: svn://tug.org/texlive/trunk@5 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/Tools/ctan2tl')
-rwxr-xr-xMaster/Tools/ctan2tl124
1 files changed, 124 insertions, 0 deletions
diff --git a/Master/Tools/ctan2tl b/Master/Tools/ctan2tl
new file mode 100755
index 00000000000..05eeaee2212
--- /dev/null
+++ b/Master/Tools/ctan2tl
@@ -0,0 +1,124 @@
+#!/bin/sh
+# $Id: //depot/Master/Tools/ctan2tl#23 $
+# Public domain. Originally written 2005, Karl Berry.
+#
+# Takes a ctan directory, pushes it into TL. Just an initial attempt.
+# --no-place to avoid final place invocation (p4 operations).
+# See ./README for a bit more info.
+
+mydir=`dirname $0` # Master/Tools
+cd $mydir/../../Build/cdbuild/raw || exit 1
+
+if test "x$1" = x--place; then
+ place=true
+ shift
+else
+ place=false
+fi
+
+if test "x$1" = x--no-ctan; then
+ copy_from_ctan=false
+ shift
+else
+ copy_from_ctan=true
+fi
+
+if test ! -d $1; then
+ echo "$0: $1 not a directory." >&2
+ exit 1
+fi
+
+# xx this should be a separate script, also used by tpm-ctan-check.
+pkg=`basename $1`
+
+if $copy_from_ctan; then
+case "$pkg" in
+ biblio) pkg=beebe;;
+ fourier-GUT) pkg=fourier;;
+ generic) pkg=genmisc;; # $ctan/macros/generic
+ ha-prosper) pkg=HA-prosper;;
+ misc) pkg=ltxmisc;; # until we do real misc package.
+ tex-references) pkg=tex-refs;;
+ velthuis) pkg=devanagr;;
+ voss) pkg=voss-de;;
+esac
+
+# lshort is arranged by language.
+pkgdir=`dirname $1`
+up=`basename $pkgdir`
+test "$up" = lshort && pkg=lshort-$pkg
+
+# esint is split into two.
+test "$pkg" = esint && test "$up" = ps-type1 && pkg=esint-type1
+
+# vntex is in an unpacked subdir.
+test "$pkg" = unpacked && test "$up" = vntex && pkg=vntex
+
+# similarly for powerdot.
+test "$pkg" = distrib && test "$up" = powerdot && pkg=powerdot
+
+# powerdot-doc-vn is a couple subdirs down.
+test "$pkg" = doc-vn && test "$up" = contrib && pkg=powerdot-doc-vn
+
+# amslatex/vietnamese.
+test "$pkg" = vietnamese && test "$up" = amslatex && pkg=amsldoc-vn
+
+
+# remove whatever old stuff we might have.
+rm -rf $pkg
+
+if 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
+ cp -p \
+ `find $1/* '(' -type d -o -type l ')' -prune -o \
+ '(' -name '*.sty' -o -name *.tex ')' -print` \
+ $pkg
+else
+ # normal case
+ cp -pr $1 $pkg
+fi
+
+fi # end of copying from CTAN.
+
+
+printf "\n\f ctan2tds\n"
+rm -rf ../cooked/$pkg
+test -d ../cooked || mkdir ../cooked
+../ctan2tds.pl $pkg || exit 1
+
+cd ../cooked || exit 1
+printf "\n\f cooked\n"
+find -depth -type d | xargs rmdir 2>/dev/null
+find $pkg \! -type d -printf "%TY%Tm%Td.%TH%TM %p\n" | sort +1
+
+# compare to tpm.
+Master=../../../Master
+tpmfile=`ls $Master/texmf*/tpm/$pkg.tpm 2>/dev/null`
+if test -z "$tpmfile"; then
+ echo "$0: no tpm file for $pkg in `cd $Master; pwd`." >&2
+else
+ printf "\n\f compared to current tpm $tpmfile\n"
+ rm -f /tmp/pkgfiles.*
+ # remove leading text in case of lines starting with texmf.
+ # Then assume all actual files do start with texmf.
+ sed -n -e '/TPM:.*Files/,$s,^texmf,./texmf,p' $tpmfile \
+ | grep -v '\.tpm$' \
+ | sort >/tmp/pkgfiles.tpm
+ #
+ # list of files in the new package we've just cooked.
+ (cd $pkg && find \! -type d -print) | grep -v '/cooked/' \
+ | sort >/tmp/pkgfiles.tl
+ #
+ comm -3 /tmp/pkgfiles.tpm /tmp/pkgfiles.tl
+fi
+
+$place || exit 0
+
+printf "\n\f place\n"
+rm -rf $pkg.done
+../place $pkg
+p4 revert -a
+
+rm -rf ../raw/$pkg