From 538c212c22537200401615b40bc3f01afaee4d0044e7446f454e1aff287702ed Mon Sep 17 00:00:00 2001 From: Ruediger Oertel Date: Sun, 3 Jul 2011 22:17:27 +0000 Subject: [PATCH] - leave Version lines intact (fix issue with multiple version lines in a package, for example in if-constructs) OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=13 --- obs-service-format_spec_file.changes | 6 ++++++ obs-service-format_spec_file.spec | 6 ++++++ prepare_spec | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index 06621a9..2ec3fea 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 4 00:16:05 CEST 2011 - ro@suse.de + +- leave Version lines intact (fix issue with multiple version + lines in a package, for example in if-constructs) + ------------------------------------------------------------------- Fri Jun 17 07:27:18 UTC 2011 - coolo@novell.com diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index e39cab5..c15aae5 100644 --- a/obs-service-format_spec_file.spec +++ b/obs-service-format_spec_file.spec @@ -30,6 +30,7 @@ Requires: osc-source_validator BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch + %description This is a source service for openSUSE Build Service. @@ -43,17 +44,22 @@ spec file instead of creating a new one. %setup -q -D -T 0 -n . + %build + %install mkdir -p $RPM_BUILD_ROOT/usr/lib/obs/service/format_spec_file.files install -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/usr/lib/obs/service install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/obs/service install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/obs/service/format_spec_file.files + %files %defattr(-,root,root) %dir /usr/lib/obs /usr/lib/obs/service + + %changelog diff --git a/prepare_spec b/prepare_spec index 01f1f11..4f3f699 100644 --- a/prepare_spec +++ b/prepare_spec @@ -450,7 +450,7 @@ sub read_and_parse_old_spec { $version{$current_package} = $_; $version{$current_package} =~ s/^Version:\s*(.*)\s*/$1/; $replace_hash{"XXXVERSION $current_package"} = sprintf("%-16s%s","Version:",$version{$current_package}); - push @oldspec, "XXXVERSION $current_package"; + push @oldspec, $replace_hash{"XXXVERSION $current_package"}; push @oldspec, "XXXRELEASE $current_package"; next; }