summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorViktor Hercinger <vhercing@redhat.com>2013-04-03 11:07:58 +0200
committerViktor Hercinger <vhercing@redhat.com>2013-04-03 11:07:58 +0200
commitd7a031244396d200dfad86bacd26667b9f886fcc (patch)
tree3a04597bfac4a4290017e8d444925358a7e3b664 /scripts
parentdabbf6b844672b640cc19a4f12b9cd0ecb2e3931 (diff)
downloadrpm-tools-master.tar.gz
rpm-tools-master.tar.xz
rpm-tools-master.zip
try to deduce the version automaticallyHEADmaster
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/source-archive14
1 files changed, 14 insertions, 0 deletions
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