~ubuntu-branches/ubuntu/jaunty/luatex/jaunty

« back to all changes in this revision

Viewing changes to src/texk/kpathsea/mktexdir

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2007-09-24 12:56:11 UTC
  • Revision ID: james.westby@ubuntu.com-20070924125611-a8ge689azbptxvla
Tags: upstream-0.11.2
ImportĀ upstreamĀ versionĀ 0.11.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# mkinstalldirs --- make directory hierarchy (now mktexdir).
 
3
# Author: Noah Friedman <friedman@prep.ai.mit.edu>, created: 1993-05-16.
 
4
# Public domain.
 
5
 
6
# Modified for sticky directory creation, --help, --version.
 
7
# te@dbs.uni-hannover.de and kb@mail.tug.org.
 
8
 
 
9
version='$Id: mktexdir,v 1.17 2004/12/29 13:38:45 olaf Exp $'
 
10
usage="Usage: $0 DIRS...
 
11
  Create each DIR, including any missing leading directories."
 
12
mt_max_args=$#
 
13
 
 
14
# Common code for all scripts.
 
15
: ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
 
16
: ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
 
17
test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
 
18
if test ! -f "$MT_MKTEX_OPT"; then
 
19
  echo "$0: Cannot find mktex.opt; check your installation." >&2
 
20
  exit 1
 
21
fi
 
22
 
 
23
. "$MT_MKTEX_OPT"
 
24
 
 
25
test -n "$MT_MKTEXDIR_OPT" && . "$MT_MKTEXDIR_OPT"
 
26
 
 
27
test -z "$MT_APPEND_MASK" && MT_APPEND_MASK="="
 
28
 
 
29
errstatus=0
 
30
 
 
31
for file
 
32
do
 
33
   case $file in
 
34
     /*) cd /;;
 
35
     *) cd $KPSE_DOT;;
 
36
   esac
 
37
   OLDIFS=$IFS; IFS=/; set fnord `echo "./$file"`; IFS=$OLDIFS; shift
 
38
 
 
39
   pathcomp=
 
40
   for d
 
41
   do
 
42
     test -z "$d" && continue
 
43
     pathcomp="$pathcomp$d"
 
44
 
 
45
     if test ! -d "./$pathcomp"; then
 
46
        mkdir "./$pathcomp" || { errstatus=$?; break; }
 
47
        chmod `kpsestat ${MT_APPEND_MASK} "$pathcomp"/..` "./$pathcomp"
 
48
     fi
 
49
 
 
50
     pathcomp="$pathcomp/"
 
51
   done
 
52
done
 
53
 
 
54
exit $errstatus