License dates changed and contents converted to UTF-8
[opentx.git] / launchpad / update-changelog.sh
bloba72d5a578b5e44b2326f0c74290d7499965d057a
1 #!/bin/sh
2 set -e
3 set -x
5 # $1 is changelog user and email, example "projectkk2glider <projectkk2glider@gmail.com>"
6 # $2 is distribution "trusty" OR "yakkety"
7 # $3 is version, example "2.2.1"
8 # $4 is suffix (optional, used for nightly builds, example "N360")
10 email=${1}
11 distro=${2%/}
12 version=${3}
13 suffix=${4}
15 echo "Updating changelog for ${distro}"
17 cd `dirname ${0}`
19 [ -z ${distro} ] && echo "Missing distribution name" && exit 1;
20 [ ! -z ${suffix} ] && version=${version}~${suffix}
22 if [ ! -d ${distro} ] ; then
23 echo "${distro} changelog not found. Most likely unsupported distribution. Aborting..."
24 exit 1
27 echo "opentx-companion22 (${version}~${distro}) ${distro}; urgency=low" > tmp-changelog
28 echo "" >> tmp-changelog
29 echo " * New release ${version}" >> tmp-changelog
30 echo "" >> tmp-changelog
31 echo " -- ${email} "`date -R` >> tmp-changelog
32 echo "" >> tmp-changelog
34 cat tmp-changelog ${distro}/changelog > new-changelog
35 mv new-changelog ${distro}/changelog
36 rm tmp-changelog
38 echo "suffix=${suffix}" > common/suffix
40 echo "Result:"
41 cat ${distro}/changelog | head -n 20