Switch to unified view

a b/src/desktop/unity-scope-recoll/mkdist.sh
1
#!/bin/sh
2
3
fatal() {
4
    echo $*
5
    exit 1
6
}
7
usage() {
8
    echo 'Usage: mkdist.sh '
9
    exit 1
10
}
11
12
VCCMD=hg
13
TAR=/usr/bin/tar
14
TAR=tar
15
16
VRECOLL=`cat ../../VERSION`
17
VLENS=`hg tip | egrep ^changeset: | awk '{print $2}' | awk -F: '{print $1}'`
18
VERSION=${VRECOLL}.${VLENS}
19
echo $VERSION
20
21
targetdir=${targetdir-/tmp}
22
23
checkmodified=${checkmodified-yes}
24
25
#editedfiles=`$VCCMD status . | egrep -v '^\?'`
26
if test "$checkmodified" = "yes" -a ! -z "$editedfiles"; then
27
  fatal  "Edited files exist: " $editedfiles
28
fi
29
30
releasename=recoll-scope-${VERSION}
31
32
topdir=$targetdir/$releasename
33
if test ! -d $topdir ; then
34
    mkdir $topdir || exit 1
35
else 
36
    echo "Removing everything under $topdir Ok ? (y/n)"
37
    read rep 
38
    if test $rep = 'y';then
39
      rm -rf $topdir/*
40
    fi
41
fi
42
43
# Clean up this dir and copy the dist-specific files 
44
#make distclean
45
yes | clean.O
46
47
$TAR chfX - excludefile .  | (cd $topdir;$TAR xf -)
48
49
out=$releasename.tar.gz
50
(cd $targetdir ; \
51
    $TAR chf - $releasename | \
52
      gzip > $out)
53
echo "$targetdir/$out created"