Accepting request 146894 from home:steffens:branch:openSUSE:Tools
added support for dpkg tar file naming (${NAME}_${VERSION}.orig.tar.gz) OBS-URL: https://build.opensuse.org/request/show/146894 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-set_version?expand=0&rev=10
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package obs-service-set_version
|
# spec file for package obs-service-set_version
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
12
set_version
12
set_version
@@ -45,21 +45,25 @@ done
|
|||||||
|
|
||||||
get_version_from_file () {
|
get_version_from_file () {
|
||||||
if [ -z "$MYVERSION" ]; then
|
if [ -z "$MYVERSION" ]; then
|
||||||
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*-\([0123456789].*\).tar.*,\1,p" | head -n 1`
|
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*[-_]\([0123456789].*\).tar.*,\1,p" | head -n 1`
|
||||||
fi
|
fi
|
||||||
if [ -z "$MYVERSION" ]; then
|
if [ -z "$MYVERSION" ]; then
|
||||||
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*-\([0123456789].*\).tgz$,\1,p" | head -n 1`
|
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*[-_]\([0123456789].*\).tgz$,\1,p" | head -n 1`
|
||||||
fi
|
fi
|
||||||
if [ -z "$MYVERSION" ]; then
|
if [ -z "$MYVERSION" ]; then
|
||||||
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*-\([0123456789].*\).tbz2$,\1,p" | head -n 1`
|
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*[-_]\([0123456789].*\).tbz2$,\1,p" | head -n 1`
|
||||||
fi
|
fi
|
||||||
if [ -z "$MYVERSION" ]; then
|
if [ -z "$MYVERSION" ]; then
|
||||||
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*-\([0123456789].*\).zip$,\1,p" | head -n 1`
|
MYVERSION=`ls -1t | sed -n "s,$BASENAME.*[-_]\([0123456789].*\).zip$,\1,p" | head -n 1`
|
||||||
fi
|
fi
|
||||||
if [ -z "$MYVERSION" ]; then
|
if [ -z "$MYVERSION" ]; then
|
||||||
echo "ERROR: no version is given and can't get detected automatically"
|
echo "ERROR: no version is given and can't get detected automatically"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove trailing ".orig", used by dpkg sources
|
||||||
|
MYVERSION=`sed s/.orig$// <<<$MYVERSION`
|
||||||
|
|
||||||
echo "Detected version as $MYVERSION"
|
echo "Detected version as $MYVERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<service name="set_version">
|
<service name="set_version">
|
||||||
<summary>Updates version in spec file</summary>
|
<summary>Updates version in spec and dsc files</summary>
|
||||||
<description>This service updates a spec file according to the existing files.
|
<description>This service updates a spec file according to the existing files.
|
||||||
Can be used after download_url or tar_scm service.
|
Can be used after download_url or tar_scm service.
|
||||||
</description>
|
</description>
|
||||||
|
Reference in New Issue
Block a user