]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/setup/general/jointar
Dang, can't remember what I changed now
[wxWidgets.git] / src / gtk1 / setup / general / jointar
CommitLineData
c801d85f
KB
1#! /bin/sh
2#
3# Written by Martin Sperl
4# (sperl@dsn.ast.univie.ac.at)
5#
6
7
8if test $# -lt 3 ; then
9 cat <<EOF
10Usage: `basename $0` <basedir> <SOURCE-FILES> <DESTINATION-FILS>
11 copies all files from the source-tar-files to the common
12 destination-tar-file with basedir as a common base directory.
13EOF
14 exit 0
15fi
16
17BaseDir="$1"
18shift
19
20Sourcefiles="$1"
21
22while test "$#" != 2 ; do
23 shift
24 Sourcefiles="$Sourcefiles $1"
25done
26
27shift
28Final=$1
29
30Destination=/tmp/join$$.tar
31
32touch $Destination
33
34curdir=`pwd`
35
36mkdir tmp$$
37mkdir tmp$$/$BaseDir
38
39#uncompress all files
40cd tmp$$/$BaseDir
41for each in $Sourcefiles ; do
42 ( \
43 if test `basename $each gz` != `basename $each` ; then \
44 gzip -dc ../../$each;\
45 else \
46 cat ../../$each;\
47 fi; \
48 ) | tar xf -
49done
50cd ..
51#now tar everything
52tar -cf $Destination *
53
54cd ..
55
56rm -fr tmp$$
57
58# goto old directory
59cd $curdir
60
61if test `basename $Final gz` != `basename $Final` ; then
62 gzip -c $Destination > $Final
63else
64 cat $Destination > $Final
65fi
66
67rm -f $Destination