Accepting request 75901 from home:anubisg1:branches:openSUSE:Tools

do not delete mandriva/fedora macros in release when reset the release number

OBS-URL: https://build.opensuse.org/request/show/75901
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-set_version?expand=0&rev=5
This commit is contained in:
Lars Vogdt 2011-07-12 06:12:48 +00:00 committed by Git OBS Bridge
parent 05d6126ea1
commit d5929060a1
3 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jul 8 15:43:23 UTC 2011 - andrea@opensuse.org
- do not delete mandriva/fedora macros in release when reset the
release number
-------------------------------------------------------------------
Tue Dec 14 06:50:01 UTC 2010 - reddwarf@opensuse.org

View File

@ -1,3 +1,21 @@
#
# spec file for package obs-service-set_version
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: obs-service-set_version
License: GPL v2 or later
@ -22,7 +40,6 @@ a given version or to the existing files.
%build
%install
mkdir -p $RPM_BUILD_ROOT/usr/lib/obs/service
install -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/usr/lib/obs/service
@ -33,3 +50,4 @@ install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/obs/service
%dir /usr/lib/obs
/usr/lib/obs/service
%changelog

View File

@ -74,8 +74,9 @@ for i in $FILES; do
sed "s,^Version:.*,Version: $MYVERSION," "$FILE" > "$MYOUTDIR/$FILE" || exit 1
if [ "${FILE%.spec}" != "$FILE" ]; then
# set release back to zero after version upgrade, will be increased by OBS during build
sed -i "s,^Release:.*,Release: 0," "$MYOUTDIR/$FILE" || exit 1
fi
# also keep macros in release in case of fedora/mandriva
sed -r -i 's,^Release:[^%]*,Release: 0,' "$MYOUTDIR/$FILE" || exit 1
fi
if [ "${FILE#_service:}" != "$FILE" ]; then
# we can remove service files, no need to store them twice