diff --git a/obs-service-set_version.changes b/obs-service-set_version.changes index 89eb7ac..ba32715 100644 --- a/obs-service-set_version.changes +++ b/obs-service-set_version.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 8 10:06:26 UTC 2013 - jblunck@opensuse.org + +- Take Debian version and revision number from debian.changelog file + ------------------------------------------------------------------- Tue Apr 16 09:30:01 UTC 2013 - adrian@suse.de diff --git a/obs-service-set_version.spec b/obs-service-set_version.spec index 91eb27f..86e723b 100644 --- a/obs-service-set_version.spec +++ b/obs-service-set_version.spec @@ -20,7 +20,7 @@ Name: obs-service-set_version Summary: An OBS source service: Update spec file version License: GPL-2.0+ Group: Development/Tools/Building -Version: 0.2 +Version: 0.3 Release: 0 Source: set_version Source1: set_version.service diff --git a/set_version b/set_version index 453e4b9..d1c9464 100644 --- a/set_version +++ b/set_version @@ -56,6 +56,10 @@ get_version_from_file () { if [ -z "$MYVERSION" ]; then MYVERSION=`ls -1t | sed -n "s,$BASENAME.*[-_]\([0123456789].*\).zip$,\1,p" | head -n 1` fi + if [ -z "$MYVERSION" ]; then + # take version number (and optional revision) from Debian changelog + MYVERSION=`head -n 1 *debian.changelog 2>/dev/null | sed -ne 's/.*(\(.*\)).*/\1/p'` + fi if [ -z "$MYVERSION" ]; then echo "ERROR: no version is given and can't get detected automatically" exit 1