From 94785c87ff48411c4901c0d61482a00fd816f507ad194d13a401b962f486a14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 25 May 2011 15:34:58 +0000 Subject: [PATCH 1/9] avoid double files OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=2 --- format_spec_file | 2 ++ obs-service-format_spec_file.changes | 5 +++++ obs-service-format_spec_file.spec | 20 -------------------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/format_spec_file b/format_spec_file index da13fda..b97f59c 100644 --- a/format_spec_file +++ b/format_spec_file @@ -21,6 +21,8 @@ done RETURN=0 for i in *.spec; do /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 + # remove all file files which are indendical to committed files + cmp "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" done exit $RETURN diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index 7d0c5c9..f4040cc 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 25 15:34:28 UTC 2011 - adrian@suse.de + +- do not generate new spec files when no changes happened + ------------------------------------------------------------------- Wed May 25 14:00:35 CEST 2011 - ro@suse.de diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index 5fe92e6..93ac8c1 100644 --- a/obs-service-format_spec_file.spec +++ b/obs-service-format_spec_file.spec @@ -1,22 +1,3 @@ -# -# spec file for package obs-service-format_spec_file -# -# 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-format_spec_file License: GPL v2 or later Group: Development/Tools/Building @@ -55,4 +36,3 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/obs/service/format_spec_file. %defattr(-,root,root) %dir /usr/lib/obs /usr/lib/obs/service -%changelog From 4e56b120e71587f9eb192c3edbbfb034ec09ac7c0fa2324eccf56563ea8ea2fc Mon Sep 17 00:00:00 2001 From: OBS User _service Date: Wed, 25 May 2011 15:35:01 +0000 Subject: [PATCH 2/9] generated via source service OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=3 --- ...pec_file:obs-service-format_spec_file.spec | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec new file mode 100644 index 0000000..b86d579 --- /dev/null +++ b/_service:format_spec_file:obs-service-format_spec_file.spec @@ -0,0 +1,63 @@ +# +# spec file for package obs-service-format_spec_file +# +# 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-format_spec_file +License: GPL v2 or later +Group: Development/Tools/Building +Summary: An OBS source service: reformats a spec file to SUSE standard. +Version: 0.1 +Release: 1 +Source: format_spec_file +Source1: format_spec_file.service +Source2: prepare_spec +Requires: osc-source_validator +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + + +%description +This is a source service for openSUSE Build Service. + +This source service is formating the spec file to SUSE standard. The rational +behind is to make it easier to review spec files from unknown packagers. + +This should be used in "trylocal" mode, so that osc is adapting the existing +spec file instead of creating a new one. + +%prep + +%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 From a8865f7aa75d2629177d1288baf93b9fd5a8994ec43e661927de1652e655a6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 31 May 2011 08:03:54 +0000 Subject: [PATCH 3/9] do not fail for non-spec file packages OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=4 --- ...pec_file:obs-service-format_spec_file.spec | 63 ------------------- format_spec_file | 4 ++ obs-service-format_spec_file.changes | 5 ++ obs-service-format_spec_file.spec | 25 ++++++++ 4 files changed, 34 insertions(+), 63 deletions(-) delete mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec deleted file mode 100644 index b86d579..0000000 --- a/_service:format_spec_file:obs-service-format_spec_file.spec +++ /dev/null @@ -1,63 +0,0 @@ -# -# spec file for package obs-service-format_spec_file -# -# 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-format_spec_file -License: GPL v2 or later -Group: Development/Tools/Building -Summary: An OBS source service: reformats a spec file to SUSE standard. -Version: 0.1 -Release: 1 -Source: format_spec_file -Source1: format_spec_file.service -Source2: prepare_spec -Requires: osc-source_validator -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - - -%description -This is a source service for openSUSE Build Service. - -This source service is formating the spec file to SUSE standard. The rational -behind is to make it easier to review spec files from unknown packagers. - -This should be used in "trylocal" mode, so that osc is adapting the existing -spec file instead of creating a new one. - -%prep - -%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/format_spec_file b/format_spec_file index b97f59c..c6acb6e 100644 --- a/format_spec_file +++ b/format_spec_file @@ -20,6 +20,10 @@ done RETURN=0 for i in *.spec; do + if [ "$i" == '*.spec' ]; then + print "WARNING: no spec file found" + exit 0 + fi /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 # remove all file files which are indendical to committed files cmp "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index f4040cc..7911eca 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 31 08:03:34 UTC 2011 - adrian@suse.de + +- do not fail on kiwi packages + ------------------------------------------------------------------- Wed May 25 15:34:28 UTC 2011 - adrian@suse.de diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index 93ac8c1..b86d579 100644 --- a/obs-service-format_spec_file.spec +++ b/obs-service-format_spec_file.spec @@ -1,3 +1,22 @@ +# +# spec file for package obs-service-format_spec_file +# +# 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-format_spec_file License: GPL v2 or later Group: Development/Tools/Building @@ -11,6 +30,7 @@ Requires: osc-source_validator BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch + %description This is a source service for openSUSE Build Service. @@ -24,15 +44,20 @@ 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 From baea406d7c5c482da2119697dbd55e80dd3408b73d52e6a43a57e6eb6d02f206 Mon Sep 17 00:00:00 2001 From: OBS User _service Date: Tue, 31 May 2011 08:03:59 +0000 Subject: [PATCH 4/9] generated via source service OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=5 --- ...pec_file:obs-service-format_spec_file.spec | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec new file mode 100644 index 0000000..4b9e4e0 --- /dev/null +++ b/_service:format_spec_file:obs-service-format_spec_file.spec @@ -0,0 +1,65 @@ +# +# spec file for package obs-service-format_spec_file +# +# 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-format_spec_file +License: GPL v2 or later +Group: Development/Tools/Building +Summary: An OBS source service: reformats a spec file to SUSE standard. +Version: 0.1 +Release: 1 +Source: format_spec_file +Source1: format_spec_file.service +Source2: prepare_spec +Requires: osc-source_validator +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + + +%description +This is a source service for openSUSE Build Service. + +This source service is formating the spec file to SUSE standard. The rational +behind is to make it easier to review spec files from unknown packagers. + +This should be used in "trylocal" mode, so that osc is adapting the existing +spec file instead of creating a new one. + +%prep + +%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 From e12911c772ae056e399a3fa73d3d106131510657c714101898acdf7f58b5e537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 31 May 2011 08:08:57 +0000 Subject: [PATCH 5/9] typo OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=6 --- ...pec_file:obs-service-format_spec_file.spec | 65 ------------------- format_spec_file | 2 +- obs-service-format_spec_file.spec | 2 + 3 files changed, 3 insertions(+), 66 deletions(-) delete mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec deleted file mode 100644 index 4b9e4e0..0000000 --- a/_service:format_spec_file:obs-service-format_spec_file.spec +++ /dev/null @@ -1,65 +0,0 @@ -# -# spec file for package obs-service-format_spec_file -# -# 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-format_spec_file -License: GPL v2 or later -Group: Development/Tools/Building -Summary: An OBS source service: reformats a spec file to SUSE standard. -Version: 0.1 -Release: 1 -Source: format_spec_file -Source1: format_spec_file.service -Source2: prepare_spec -Requires: osc-source_validator -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - - -%description -This is a source service for openSUSE Build Service. - -This source service is formating the spec file to SUSE standard. The rational -behind is to make it easier to review spec files from unknown packagers. - -This should be used in "trylocal" mode, so that osc is adapting the existing -spec file instead of creating a new one. - -%prep - -%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/format_spec_file b/format_spec_file index c6acb6e..01c0a36 100644 --- a/format_spec_file +++ b/format_spec_file @@ -21,7 +21,7 @@ done RETURN=0 for i in *.spec; do if [ "$i" == '*.spec' ]; then - print "WARNING: no spec file found" + echo "WARNING: no spec file found" exit 0 fi /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index b86d579..4b9e4e0 100644 --- a/obs-service-format_spec_file.spec +++ b/obs-service-format_spec_file.spec @@ -60,4 +60,6 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/obs/service/format_spec_file. %dir /usr/lib/obs /usr/lib/obs/service + + %changelog From 196d88cadbf8e614b930d10c7a7caf6dc4063e9bd3ad378f7134e2b769fd7595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 15 Jun 2011 12:24:13 +0000 Subject: [PATCH 6/9] silence OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=8 --- format_spec_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format_spec_file b/format_spec_file index 01c0a36..e6da271 100644 --- a/format_spec_file +++ b/format_spec_file @@ -26,7 +26,7 @@ for i in *.spec; do fi /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 # remove all file files which are indendical to committed files - cmp "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" + cmp -s "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" done exit $RETURN From 524cf00804c6a9adf743fdff59f60d914f8ff245a969c64704fd3d6b6aae45e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 17 Jun 2011 07:46:56 +0000 Subject: [PATCH 7/9] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=9 --- ...pec_file:obs-service-format_spec_file.spec | 64 +++++++++++++++++++ format_spec_file | 6 -- obs-service-format_spec_file.changes | 10 --- obs-service-format_spec_file.spec | 7 -- 4 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec new file mode 100644 index 0000000..4292245 --- /dev/null +++ b/_service:format_spec_file:obs-service-format_spec_file.spec @@ -0,0 +1,64 @@ +# +# spec file for package obs-service-format_spec_file +# +# 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-format_spec_file +License: GPL v2 or later +Group: Development/Tools/Building +Summary: An OBS source service: reformats a spec file to SUSE standard. +Version: 0.1 +Release: 1 +Source: format_spec_file +Source1: format_spec_file.service +Source2: prepare_spec +Requires: osc-source_validator +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + + +%description +This is a source service for openSUSE Build Service. + +This source service is formating the spec file to SUSE standard. The rational +behind is to make it easier to review spec files from unknown packagers. + +This should be used in "trylocal" mode, so that osc is adapting the existing +spec file instead of creating a new one. + +%prep + +%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/format_spec_file b/format_spec_file index e6da271..da13fda 100644 --- a/format_spec_file +++ b/format_spec_file @@ -20,13 +20,7 @@ done RETURN=0 for i in *.spec; do - if [ "$i" == '*.spec' ]; then - echo "WARNING: no spec file found" - exit 0 - fi /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 - # remove all file files which are indendical to committed files - cmp -s "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" done exit $RETURN diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index 7911eca..7d0c5c9 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,13 +1,3 @@ -------------------------------------------------------------------- -Tue May 31 08:03:34 UTC 2011 - adrian@suse.de - -- do not fail on kiwi packages - -------------------------------------------------------------------- -Wed May 25 15:34:28 UTC 2011 - adrian@suse.de - -- do not generate new spec files when no changes happened - ------------------------------------------------------------------- Wed May 25 14:00:35 CEST 2011 - ro@suse.de diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index 4b9e4e0..5fe92e6 100644 --- a/obs-service-format_spec_file.spec +++ b/obs-service-format_spec_file.spec @@ -30,7 +30,6 @@ Requires: osc-source_validator BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch - %description This is a source service for openSUSE Build Service. @@ -44,22 +43,16 @@ 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 From 456d646f73c560dfab9879ac5923bd38e4a76c5b3753b674a7edb174609b9455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 17 Jun 2011 07:50:25 +0000 Subject: [PATCH 8/9] merge OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=10 --- ...pec_file:obs-service-format_spec_file.spec | 64 ------------------- format_spec_file | 6 ++ obs-service-format_spec_file.changes | 10 +++ obs-service-format_spec_file.spec | 7 ++ 4 files changed, 23 insertions(+), 64 deletions(-) delete mode 100644 _service:format_spec_file:obs-service-format_spec_file.spec diff --git a/_service:format_spec_file:obs-service-format_spec_file.spec b/_service:format_spec_file:obs-service-format_spec_file.spec deleted file mode 100644 index 4292245..0000000 --- a/_service:format_spec_file:obs-service-format_spec_file.spec +++ /dev/null @@ -1,64 +0,0 @@ -# -# spec file for package obs-service-format_spec_file -# -# 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-format_spec_file -License: GPL v2 or later -Group: Development/Tools/Building -Summary: An OBS source service: reformats a spec file to SUSE standard. -Version: 0.1 -Release: 1 -Source: format_spec_file -Source1: format_spec_file.service -Source2: prepare_spec -Requires: osc-source_validator -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - - -%description -This is a source service for openSUSE Build Service. - -This source service is formating the spec file to SUSE standard. The rational -behind is to make it easier to review spec files from unknown packagers. - -This should be used in "trylocal" mode, so that osc is adapting the existing -spec file instead of creating a new one. - -%prep - -%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/format_spec_file b/format_spec_file index da13fda..e6da271 100644 --- a/format_spec_file +++ b/format_spec_file @@ -20,7 +20,13 @@ done RETURN=0 for i in *.spec; do + if [ "$i" == '*.spec' ]; then + echo "WARNING: no spec file found" + exit 0 + fi /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i" || RETURN=1 + # remove all file files which are indendical to committed files + cmp -s "$i" "$MYOUTDIR/$i" && rm "$MYOUTDIR/$i" done exit $RETURN diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index 7d0c5c9..7911eca 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue May 31 08:03:34 UTC 2011 - adrian@suse.de + +- do not fail on kiwi packages + +------------------------------------------------------------------- +Wed May 25 15:34:28 UTC 2011 - adrian@suse.de + +- do not generate new spec files when no changes happened + ------------------------------------------------------------------- Wed May 25 14:00:35 CEST 2011 - ro@suse.de diff --git a/obs-service-format_spec_file.spec b/obs-service-format_spec_file.spec index 5fe92e6..4b9e4e0 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,16 +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 From 8f0d67775667c4228dea75c491e23a4ce1b88f4e63423d5e3ff8cdf303782223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 17 Jun 2011 07:52:59 +0000 Subject: [PATCH 9/9] Accepting request 73966 from home:coolo:branches:openSUSE:Factory fix invalid licenses OBS-URL: https://build.opensuse.org/request/show/73966 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=11 --- obs-service-format_spec_file.changes | 6 ++++++ prepare_spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index 7911eca..06621a9 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 17 07:27:18 UTC 2011 - coolo@novell.com + +- do not replace licenses without knowing them (not sure this + is necessary at all) + ------------------------------------------------------------------- Tue May 31 08:03:34 UTC 2011 - adrian@suse.de diff --git a/prepare_spec b/prepare_spec index e27a4d0..01f1f11 100644 --- a/prepare_spec +++ b/prepare_spec @@ -592,7 +592,7 @@ while (@oldspec) { if ($line =~ /^%package/ && $line !~ /\\$/) { $line =~ s/^(%\w+)/lc($1)/e; my ($current_package, $current_lang) = set_current_pkg ( $line ); - unless ($please_replace{"XXXLICENSE $current_package"}) { + unless ($please_replace{"XXXLICENSE $current_package"} || !$replace_hash{"XXXLICENSE $current_package"}) { print $replace_hash{"XXXLICENSE $current_package"}."\n"; } }