From d7a031244396d200dfad86bacd26667b9f886fcc Mon Sep 17 00:00:00 2001 From: Viktor Hercinger Date: Wed, 3 Apr 2013 11:07:58 +0200 Subject: try to deduce the version automatically --- rpmtools.spec | 5 ++++- scripts/source-archive | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/rpmtools.spec b/rpmtools.spec index fb3dbf9..ab71cdb 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,6 +1,6 @@ Name: rpmtools Version: 1.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Local RPM toolkit BuildArch: noarch @@ -29,6 +29,9 @@ install -m 755 * %{buildroot}/%{_bindir} %{_bindir}/* %changelog +* Wed Apr 03 2013 Hercinger Viktor - 1.0-8 +- try to deduce the version automatically + * Tue Apr 02 2013 Hercinger Viktor - 1.0-7 - added archive source creator diff --git a/scripts/source-archive b/scripts/source-archive index 790d1b9..5a9358f 100755 --- a/scripts/source-archive +++ b/scripts/source-archive @@ -9,6 +9,20 @@ SPECDIR="$HOME/.specs" OUTPUT=$SPECDIR/$PKGNAME UPDATE_SOURCES=1 +if [ -d $OUTPUT ] +then + SPECFILE=$(find -L $SPECDIR/$PKGNAME -name '*.spec' | head -1) + if [ "x$SPECFILE" != "x" ] + then + DEDUCED_VERSION=$(sed -n 's,^\s*Version:\s*\(.*\)\s*$,\1,p' < $SPECFILE) + + if [ "x$DEDUCED_VERSION" != "x" ] + then + VERSION=$DEDUCED_VERSION + fi + fi +fi + function die { echo $@ >&2 -- cgit