~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to sbin/backup

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
PREFIX=`cd "$PREFIX/.." ; pwd`
5
5
SUBDIR=`basename $PREFIX`
6
6
 
7
 
ARCHNAME=${SUBDIR}.tar
8
 
\rm -f $ARCHNAME.gz
 
7
ARCHNAME=${SUBDIR}.tar.gz
9
8
 
10
9
RUNDIR=`pwd`
11
10
 
12
 
if [ `uname -s` = Linux ] ; then
13
 
  TMPDIR=`mktemp -d /tmp/cs_backup.XXXXXX`
14
 
else
15
 
  TMPDIR=/tmp/ncs_`basename $0`
16
 
  mkdir $TMPDIR
17
 
fi
18
 
if [ $? -ne 0 ]; then
19
 
  echo "$0: Error creating temporary directory..."
20
 
  exit 1
21
 
fi
22
 
 
23
 
cp -p -r $PREFIX $TMPDIR/
24
 
cd $TMPDIR || exit 1
25
 
 
26
 
# Clean copy
27
 
 
28
 
find "$TMPDIR" -name .svn -exec \rm -rf {} \;
29
 
find "$TMPDIR" -name *~ -exec \rm {} \;
30
 
find "$TMPDIR" -name \#* -exec \rm {} \;
31
 
find "$TMPDIR" -name \.\#* -exec \rm {} \;
32
 
 
33
 
cd `basename "$PREFIX"`/doc 
34
 
if [ $? = 0 ]; then
35
 
  make distclean
36
 
  cd $TMPDIR || exit 1
37
 
fi
 
11
cd $PREFIX/.. || exit 1
38
12
 
39
13
PREFIX_BASE=`basename $PREFIX`
40
14
 
41
 
tar cvf $ARCHNAME $PREFIX_BASE/ChangeLog $PREFIX_BASE/ABOUT-NLS $PREFIX_BASE/AUTHORS \
42
 
                  $PREFIX_BASE/COPYING $PREFIX_BASE/INSTALL $PREFIX_BASE/NEWS \
43
 
                  $PREFIX_BASE/COMPATIBILITY $PREFIX_BASE/QUALITY_ASSURANCE \
44
 
                  $PREFIX_BASE/README $PREFIX_BASE/cs_config.h.in \
45
 
                  $PREFIX_BASE/config* $PREFIX_BASE/Makefile.* \
46
 
                  $PREFIX_BASE/bin $PREFIX_BASE/data $PREFIX_BASE/doc \
47
 
                  $PREFIX_BASE/examples $PREFIX_BASE/extras \
48
 
                  $PREFIX_BASE/gui $PREFIX_BASE/include \
49
 
                  $PREFIX_BASE/libsyrcs $PREFIX_BASE/patches \
50
 
                  $PREFIX_BASE/po $PREFIX_BASE/sbin $PREFIX_BASE/src \
51
 
                  $PREFIX_BASE/users
 
15
tar cvzf $ARCHNAME --exclude='*.svn'  \
 
16
                   --exclude='*.git'  \
 
17
                   --exclude='.*.swp' \
 
18
                   --exclude='build' \
 
19
                   --exclude='arch' \
 
20
                   --exclude=$ARCHNAME \
 
21
                   $PREFIX_BASE
52
22
 
53
 
gzip $ARCHNAME
54
 
mv $ARCHNAME.gz $RUNDIR
 
23
mv $ARCHNAME $RUNDIR
55
24
 
56
25
cd $RUNDIR
57
 
\rm -rf $TMPDIR
58
26