make-release 2.23 KB
Newer Older
1
2
3
4
#!/bin/sh

set -e

Vincent Danjean's avatar
Vincent Danjean committed
5
6
7
8
9
10
11
VERSION=$(cat progs/altree | \
	sed -e '/our.*VERSION/s/.*qv(\([0-9.]\+\)).*/\1/p;d')

if [ "$VERSION" = "" ]; then
	echo "Unable to read current version. Aborting."
	exit 1
fi
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

FORCE=""

while [ $# != 0 ]; do
  case "$1" in
  --force)
    echo "--force enabled. Disabling sanity check..."
    FORCE=yes
    ;;
  --dry-run|-n)
    echo "--dry-run enabled. No real release will be done."
    DRYRUN="echo DRY-RUN: "
    ;;
  --)
    shift
    break
    ;;
  -*)
    echo "Unknown option $1"
    echo "Aborting"
    exit 1
    ;;
  *)
    break;
    ;;
  esac
  shift
done

echo "Creating version '$VERSION'"

set -x
[ -f Makefile ] || perl Makefile.PL
make Makefile || true
make realclean
make -C Documentation distclean
set +x

Vincent Danjean's avatar
Vincent Danjean committed
50
if [ "$(git status --short --untracked)" != "" ]; then
51
52
53
   echo "************************************"
   echo "* Not all files are commited/cleaned"
   echo "* Please correct before creating a release"
Vincent Danjean's avatar
Vincent Danjean committed
54
55
   echo "* (use 'git status --short --untracked' to look for problematic files)"
   echo "* (use 'git stash -a' to remove them temporarely)"
56
57
   echo "************************************"
   if [ "$FORCE" ]; then
58
     echo "* !!! WARNING: --force enabled : type 'ENTER to continue'"
59
     echo "************************************"
60
     read a
61
62
63
64
65
66
67
   else
     exit 1
   fi
fi
  
perl Makefile.PL

68
if [ "$(make distcheck 2>&1 1>/dev/null | grep -v "^No such file: META.yml$")" != "" ]; then
69
70
71
72
73
74
   echo "************************************"
   echo "* Not all files are in MANIFEST (or removed from it)"
   echo "* Please correct before creating a release"
   echo "* (use 'make distcheck' to look for problematic files"
   echo "************************************"
   if [ "$FORCE" ]; then
75
     echo "* !!! WARNING: --force enabled : type 'ENTER to continue'"
76
     echo "************************************"
77
     read a
78
79
80
81
82
   else
     exit 1
   fi
fi
  
83
84
85
make disttest
make dist

86
87
88
89
echo "************************************"
echo "* SUCCESS !"
echo "************************************"
echo "* Release created in altree-$VERSION.tar.gz"
Vincent Danjean's avatar
Vincent Danjean committed
90
echo "* Do not forget to create a git tag and push it"
91
92
93
94
95
96
echo "* You need to copy this file to the web site"
echo "* and tell Vince to update the debian package"
echo "************************************"