3 # Usage: ./release NEW_VERSION [ dev | SINCE_COMMITISH ]
5 # If "dev" is supplied as the second argument, a development snapshot
6 # is done rather than a real release, i.e.:
7 # * the --snapshot --auto options are passed to git-dch
8 # * no commit or tag is created
9 # else, the second argument is passed to git-dch's --since option.
11 ### source the configuration files
14 if [ -e config
/amnesia.
local ] ; then
15 . config
/amnesia.
local
21 if [ "$2" = dev
]; then
37 [ -n "${NEW_VERSION}" ] \
38 || fatal
"the new version must be supplied on the command-line."
39 [ -n "${AMNESIA_DEV_FULLNAME}" ] \
40 || fatal
"AMNESIA_DEV_FULLNAME must be set in config/amnesia"
41 [ -n "${AMNESIA_DEV_EMAIL}" ] \
42 || fatal
"AMNESIA_DEV_EMAIL must be set in config/amnesia"
43 [ -n "${AMNESIA_DEV_KEYID}" ] \
44 || fatal
"AMNESIA_DEV_KEYID must be set in config/amnesia"
45 [ -x "`which git`" ] \
46 || fatal
"could not find git, please apt-get install git-core"
47 [ -x "`which git-dch`" ] \
48 || fatal
"could not find git-dch, please apt-get install git-buildpackage"
52 export DEBFULLNAME
="${AMNESIA_DEV_FULLNAME}"
53 export DEBEMAIL
="${AMNESIA_DEV_EMAIL}"
55 # update the Changelog
56 echo "Updating debian/changelog from Git history..."
58 `if [ ${SNAPSHOT} = yes ]; then echo '--snapshot --auto' ; fi` \
59 `if [ ${SNAPSHOT} = no -a -n ${SINCE} ]; then echo "--release --since=${SINCE}" ; fi` \
60 `if [ ${SNAPSHOT} = no -a -z ${SINCE} ]; then echo "--release --auto" ; fi` \
61 --new-version="${NEW_VERSION}" \
63 || fatal
"git-dch failed."
65 # commit and tag the release
66 # if [ "${SNAPSHOT}" = no ]; then
67 # echo "Commit'ing debian/changelog..."
68 # git commit -m "releasing version ${NEW_VERSION}" debian/changelog \
69 # || fatal "failed to commit debian/changelog"
70 # echo "Tagging new version..."
71 # git tag -u "${AMNESIA_DEV_KEYID}" -m "tagging version ${NEW_VERSION}" "${NEW_VERSION}"