File: merge-dist-tree

package info (click to toggle)
texlive-doc 2012.20120611-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 250,664 kB
  • sloc: xml: 18,901; perl: 13,380; makefile: 931; lisp: 394; sh: 313; awk: 205; java: 159; sed: 4
file content (38 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# merge-dist-tree
# $Id: merge-dist-tree 5047 2012-02-17 06:41:24Z preining $
# (c) 2006 Norbert Preining
#
# merge tree $1 into destination $2
# files in tree $1 with extension .uu are uudecoded installed into $2
#

src="$1"
dst="$2"

if ! [ -d "$dst" ] ; then
  echo "please first call debian/rules install!"
  exit 1
fi

if ! [ -d "$src" ] ; then
  echo "first argument must be a directory: $src"
  exit 1
fi

for f in $(cd "$src"; find . -type f) ; do
  bn=$(basename "$f")
  dn=$(dirname "$f")
  mkdir -p "$dst/$dn"
  case "$f" in
    *.uu)
      bn=$(basename "$f" .uu)
      uudecode -o "$dst/$dn/$bn" "$src/$f"
      ;;
    *)
      cp -a "$src/$f" "$dst/$dn/"
      ;;
  esac
done