Skip to content

Commit

Permalink
makefile: added new feature "make deb-chl-bumpup" - Bump upstream ver…
Browse files Browse the repository at this point in the history
…sion number in debian/changelog.
  • Loading branch information
Patrick Schleizer committed Aug 19, 2014
1 parent ce5b36b commit cfaec8f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@ uninstall:
uninstallsim:
./make-helper.bsh uninstallsim

deb-chl-bumpup:
./make-helper.bsh deb-chl-bumpup

help:
./make-helper.bsh help
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
apparmor-profile-icedove (3:0.3-1) unstable; urgency=low

* New upstream version.

-- Patrick Schleizer <adrelanos@riseup.net> Tue, 19 Aug 2014 18:41:18 +0000

apparmor-profile-icedove (3:0.2-2) unstable; urgency=low

* Fixed changelog date.
Expand Down
58 changes: 51 additions & 7 deletions make-helper.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ parse_cmd() {
exit 0
shift
;;
deb-chl-bumpup)
matched="true"
make_deb-chl-bumpup
exit 0
shift
;;
--)
shift
break
Expand Down Expand Up @@ -207,6 +213,7 @@ parse_cmd() {
}

get_variables() {
local temp
command -v dpkg-parsechangelog >/dev/null
OIFS="${IFS}"
NIFS=$'\n'
Expand All @@ -219,23 +226,26 @@ get_variables() {
## Example first:
## Version:
## Example second:
## 0.1-1
## 3:0.1-1
first="${first,,}"
## Example first:
## version
if [ "$first" = "version:" ]; then
version="$second"
## Example version:
changelog_version="$second"
## Example changelog_version:
## 3:0.1-1
revision="${version#*-}"
revision="${second#*-}"
## Example revision:
## 1
version="${version%-*}"
temp="${second%-*}"
## Example version:
## 3:0.1
version="${version#*:}"
version="${temp#*:}"
## Example version:
## 0.1
epoch="${second%:*}"
## Example epoch:
## 3
break
fi
done
Expand Down Expand Up @@ -325,7 +335,9 @@ make uninstallcheck
make uninstall
Delete all installed files.
make uninstallsim
Simulate what make uninstall would do."
Simulate what make uninstall would do.
make deb-chl-bumpup
Bump upstream version number in debian/changelog."
}

make_dist() {
Expand Down Expand Up @@ -579,4 +591,36 @@ make_uninstallsim() {
helper
}

make_deb-chl-bumpup() {
command -v debchange >/dev/null

get_variables

local new_upstream_version_without_leading_zero new_upstream_version new_changelog_version new_revision

new_upstream_version_without_leading_zero="$(bc -l <<< "scale=9 ; $version + 0.1")"
new_upstream_version="$(printf '%3.1f\n' "$new_upstream_version_without_leading_zero")"

new_revision="1"

new_changelog_version="$epoch:$new_upstream_version-$new_revision"

true "\
Bumping version from / to...
$changelog_version
$new_changelog_version"

if [ "$DEBEMAIL" = "" ]; then
export DEBEMAIL="adrelanos@riseup.net"
fi

debchange \
--newversion "$new_changelog_version" \
"New upstream version."

debchange \
--release \
""
}

parse_cmd ${1+"$@"}

0 comments on commit cfaec8f

Please sign in to comment.