aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mksnapshot
blob: c766501c9228684825ad2e783a5fc38bec44633b (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Make a snapshot of the CVS head revision
#  Fixme: we should either run autoconf here or make a real distribution

set -e

ftp_dir=$1

cd $HOME/pub
PATH="$HOME/bin:$PATH"

fix_version () {
    version=$(cat $1/VERSION)
    echo "$version-snap$(date +%Y-%m-%d)" >$1/VERSION
    cat <<EOF >$1/SNAPSHOT
		  WARNING!

This is a snapshot of the current CVS head branch!

It may not compile or not work.  Please don't report
bugs about this snapshot release it is just for your
convenience and to reduce the load of out CVS server.

Thanks,

   Werner
EOF
}

build_dist () {
    set +e
    nice scripts/autogen.sh && nice ./configure && nice make dist 
    rm $ftp_dir/gnupg-*snap*-*-*.tar.gz
    mv gnupg-*.tar.gz $ftp_dir/
    set -e
}


do_export () {
    pgm=$1
    mod=$2

    rm -rf $pgm.new || true
    rm -rf $pgm.old || true
    cvs -Q export -r HEAD -d $pgm.new $mod
    fix_version $pgm.new
    if [ -n "$ftp_dir" ]; then
      here=$(pwd)
      cd $pgm.new    
      build_dist 
      cd $here
    fi
    [ -d $pgm ] && mv $pgm $pgm.old
    if ! mv $pgm.new $pgm ; then
	echo "rename failed - restoring" >&2
	mv $pgm.old $pgm
	exit 1
    fi
    rm -rf $pgm.old || true
}


do_export gnupg-snapshot gnupg


exit 0