commit 2e8d4062695c2e63cda6276690f237b51183006a50c1e4079d8e014710d4ed44 Author: Adrian Schröter Date: Tue Jul 16 11:43:47 2024 +0000 update OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-set_version?expand=0&rev=140 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..4c34250 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,20 @@ +pkgname=obs-service-set_version +pkgver=0.6.6 +pkgrel=bfb72d442449a0fb377c8568859f8f23 +pkgdesc="An OBS source service: Update spec file version" +arch=('i686' 'x86_64') +url="https://www.github.com/openSUSE/obs-service-set_version" +license=('GPL-2.0+' 'GPL-2.0') +groups=('base-devel') +depends=('python') +source=(obs-service-set_version-${pkgver}.tar.gz) +md5sums=('SKIP') + +package() { + msg "Installing build ..." + cd "${srcdir}"/obs-service-set_version-${pkgver} + mkdir -p ${pkgdir}/usr/lib/obs/service + install -m 0755 set_version ${pkgdir}/usr/lib/obs/service + install -m 0644 set_version.service ${pkgdir}/usr/lib/obs/service +} + diff --git a/_service b/_service new file mode 100644 index 0000000..e36e424 --- /dev/null +++ b/_service @@ -0,0 +1,20 @@ + + + https://github.com/openSUSE/obs-service-set_version.git + git + .git + master + @PARENT_TAG@ + master + enable + + + + *.tar + gz + + + + obs-service-set_version + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..257d481 --- /dev/null +++ b/_servicedata @@ -0,0 +1,7 @@ + + + git@github.com:openSUSE/obs-service-set_version.git + eaedc529acba421821e0e5dcb4956c66e7f315a9 + + https://github.com/openSUSE/obs-service-set_version.git + 5a4de9958df115ddff484083f2a1cb0aaa9e776a \ No newline at end of file diff --git a/debian.dsc b/debian.dsc new file mode 100644 index 0000000..c1e3e63 --- /dev/null +++ b/debian.dsc @@ -0,0 +1,9 @@ +Format: 1.0 +Source: obs-service-set_version +Version: 0.6.6-0 +Binary: obs-service-set_version +Provides: obs-service-set_version +Maintainer: Dirk Mueller +Architecture: all +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 7), python3, flake8 | python3-flake8, python3-ddt, python3-packaging diff --git a/obs-service-set_version-0.6.5.tar.gz b/obs-service-set_version-0.6.5.tar.gz new file mode 100644 index 0000000..68455ce --- /dev/null +++ b/obs-service-set_version-0.6.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3d8558e32305a339b568a3ec58caba92f9e1bca8871222b5902669d1e1c8f0c +size 23926 diff --git a/obs-service-set_version-0.6.6.tar.gz b/obs-service-set_version-0.6.6.tar.gz new file mode 100644 index 0000000..e52e3c7 --- /dev/null +++ b/obs-service-set_version-0.6.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5afcb72241f166a610f92a41dad8ebf01f99aa68a67e473c3b49229d6d798232 +size 24122 diff --git a/obs-service-set_version.changes b/obs-service-set_version.changes new file mode 100644 index 0000000..db273fe --- /dev/null +++ b/obs-service-set_version.changes @@ -0,0 +1,479 @@ +------------------------------------------------------------------- +Tue Jul 16 11:43:30 UTC 2024 - adrian@suse.de + +- Update to version 0.6.6: + * Hardcode "0" as release for PKGBUILD as well + +------------------------------------------------------------------- +Thu Jun 20 07:59:18 UTC 2024 - Dirk Müller + +- expand __python3 with python3 to work outside suse rpm packaging + +------------------------------------------------------------------- +Tue Jun 18 15:31:41 UTC 2024 - dmueller@suse.com + +- Update to version 0.6.5: + * Update spec file to the one used in the packaging + * Move revision detection into _revision_detect + +------------------------------------------------------------------- +Fri Jun 14 18:33:15 UTC 2024 - Matej Cepl + +- Fix shebang of the script to use the explicit version of Python + (bsc#1212476). + +------------------------------------------------------------------- +Tue May 14 16:03:17 UTC 2024 - dmueller@suse.com + +- Update to version 0.6.4: + * Treat LegacyVersion as InvalidVersion + * Add testing python 3.10 - 3.12 + +------------------------------------------------------------------- +Mon May 06 14:28:11 UTC 2024 - dmueller@suse.com + +- Update to version 0.6.3: + * [dist] import spec file from O:S:U + * Mute warning about missing EMAIL env variable in unit tests + * Fix unit tests + * Replace invalid use of os.errno with errno module + * Replace @VERSION@ placeholders in .dsc files + * Remove usage of deprecated imp module with importlib + * Detect revision and set pkgrel for Arch packages + +------------------------------------------------------------------- +Wed Jan 17 14:44:40 UTC 2024 - Dirk Müller + +- add support for AL2023 + +------------------------------------------------------------------- +Thu Jun 1 15:22:42 UTC 2023 - Edward Baudrez + +- Builds on CentOS_[5678] and possibly other distros failed because + their 'rpm' didn't recognize the "Recommends:" tag. I've wrapped + that tag in an "%if 0%{?suse_version}" to work around it. + Build is now passing on the CentOS distros. + +------------------------------------------------------------------- +Wed Jan 18 13:39:25 UTC 2023 - dmueller@suse.com + +- Update to version 0.6.2: + * Avoid the Flake8 warning and restore conditional import + +------------------------------------------------------------------- +Tue Jan 17 14:36:28 UTC 2023 - dmueller@suse.com + +- Update to version 0.6.1: + * Handle already converted versions gracefully + * Flake8 fixes (missing import) + * Test python3 by default + +------------------------------------------------------------------- +Thu Jan 05 09:07:08 UTC 2023 - dmueller@suse.com + +- Update to version 0.6.0: + * Test against Python 3.10 which is the Tumbleweed default + * Remove TravisCI - we switched to GitHub Actions + * handle removed packaging.version.LegacyVersion (Fixes #83) + +------------------------------------------------------------------- +Mon Dec 13 10:46:10 UTC 2021 - Dirk Müller + +- simplifiy conditions for all rhel like distros to skip testsuite + +------------------------------------------------------------------- +Wed Jul 14 09:32:33 UTC 2021 - FSchreiner@suse.com + +- Update to version 0.5.14: + * changed debugging output to logging module + * Explicitely specifying --fromfile should win over .obsinfo + * Add new switch --fromfile + * Add zst to recognized suffixes (zstd support) + +------------------------------------------------------------------- +Mon Feb 01 15:00:27 UTC 2021 - FSchreiner@suse.com + +- Update to version 0.5.13: + * add license file + * fixing suffixes - remove backslashes + * fix suffixes to begin with a dot + * enhanced debug mode + * tests for directory pristine-tar + +------------------------------------------------------------------- +Wed Aug 07 08:27:33 UTC 2019 - FSchreiner@suse.com + +- Update to version 0.5.12: + * debian: set script shebang to python3 + * debian: add python3 as a runtime dependency + * conditionally define PYTHON in Makefile + * debian: use python3 for building + * try to fix set_version:157:13: E117 over-indented (comment) + +------------------------------------------------------------------- +Thu May 16 15:13:14 UTC 2019 - John Whately + +- Modified .spec file to better suit Fedora OS (let's just assume all Fedora versions has python 3) + +------------------------------------------------------------------- +Thu May 16 13:11:28 UTC 2019 - FSchreiner@suse.com + +- Update to version 0.5.11: + * try to fix set_version:157:13: E117 over-indented (comment) + +------------------------------------------------------------------- +Tue May 14 13:33:02 UTC 2019 - Adrian Schröter + +- enable test suite by default + * if it does not build, it can also not be executed on the distro +- fix requires for SLE 12 distro + +------------------------------------------------------------------- +Thu May 9 10:33:23 UTC 2019 - John Whately + +- Changed source files to support python 3 + +------------------------------------------------------------------- +Sat May 4 05:25:59 UTC 2019 - John Whately + +- fix for Fedora 30/Rawhide + +------------------------------------------------------------------- +Mon Nov 26 18:04:26 CET 2018 - ro@suse.de + +- for now obs_scm_testsuite only for > 1315, needed python stuff + not available otherwise + +------------------------------------------------------------------- +Fri Nov 16 18:09:57 UTC 2018 - opensuse-packaging@opensuse.org + +- Update to version 0.5.11: + * fix code to pass flake8 tests for python3 + * fix zipfile crash also for python2.7 + * avoid error with latest flake8 about unused variable + * allow running tests with python3 + * second place where zip file handling can crash + * avoid crashes due to false is_zipfile() response + * Add python-flake8 to test suite package list + * Fix indentation of condition + * Fix basename to match documentation (#54) + +------------------------------------------------------------------- +Wed Sep 19 06:28:24 UTC 2018 - adrian@suse.de + +- Update to version 0.5.10: + * fix zipfile crash also for python2.7 + +------------------------------------------------------------------- +Mon Sep 17 10:21:44 UTC 2018 - olaf@aepfle.de + +- Wrap make check in bcond obs_scm_testsuite + +------------------------------------------------------------------- +Mon Sep 17 09:28:09 UTC 2018 - adrian@suse.de + +- Update to version 0.5.9: + * avoid crashes due to false is_zipfile() response +- enable test suite + +------------------------------------------------------------------- +Mon Dec 11 15:50:24 UTC 2017 - fschreiner@suse.de + +- Update to version 0.5.8: + * fixes boo#1072359 + * code cleanup and some refactoring + * cli options --debug and --regex + * new targets (test/clean) for Makefile + * initial .gitignore + * Mention that tests may take some time in README.md + * Fix pip/zypper tests for python3 + * enforce files to be decoded as UTF-8 + * Don't let version check get beyond path boundary + * Slightly reorganize README.md file + +------------------------------------------------------------------- +Mon Nov 6 16:16:21 UTC 2017 - adrian@suse.de + +- add requires to python3, since Leap 15.0 still does not have + the fileprovides + +------------------------------------------------------------------- +Mon Nov 06 15:33:21 UTC 2017 - adrian@suse.de + +- Update to version 0.5.7: + * added gitignore + * added target 'clean' in Makefile + * Added new target 'test' to Makefile + * fix flake8 error 'do not use bare except' + * Reverting patch for setlocale as it breaks in containers + +------------------------------------------------------------------- +Mon Oct 30 15:59:17 UTC 2017 - adrian@suse.de + +- Update to version 0.5.7: + * workaround for python3 locale problems in factory + * add a hint to flake8 + * satisfy flake8 + * skip also sha256sums check for Arch + +------------------------------------------------------------------- +Tue Oct 10 07:39:43 UTC 2017 - dmueller@suse.com + +- switch to python3 for less ancient distros + +------------------------------------------------------------------- +Tue Sep 19 12:26:06 UTC 2017 - opensuse-packaging@opensuse.org + +- Avoid half-converting Debian native pkgs to non-native pkgs +- Simplify the pip version handling +- travis: Do not use "--use-mirrors" when using pip +- travis: Test python 3.6 + +------------------------------------------------------------------- +Mon Jul 3 07:21:33 UTC 2017 - adrian@suse.de + +- try to avoid python-packaging to support non-SUSE distros + +------------------------------------------------------------------- +Thu Apr 27 12:48:11 UTC 2017 - adrian@suse.de + +- Update to version 0.5.6: + * strip \n from version in obsinfo + +------------------------------------------------------------------- +Thu Mar 02 09:23:45 UTC 2017 - adrian@suse.de + +- Update to version 0.5.5: + * read version from .obsinfo file if available + * Add support for Collax build recipes + +------------------------------------------------------------------- +Fri Jan 13 13:06:53 UTC 2017 - adrian@suse.de + +- Update to version 0.5.4: + * support obscpio archives + * do not strip release number in debian, but setting it back + +------------------------------------------------------------------- +Thu Apr 21 11:54:41 UTC 2016 - opensuse-packaging@opensuse.org + +- Update to version 0.5.3: + * VersionDetector._autodetect: prioritize the directory name over the file name + +------------------------------------------------------------------- +Fri Apr 08 13:28:43 UTC 2016 - tbechtold@suse.com + +- Update to version 0.5.3: + * Don't add unconverted_version unconditionally + +------------------------------------------------------------------- +Thu Mar 03 16:42:56 UTC 2016 - tbechtold@suse.com + +- Update to version 0.5.3: + + Use old version from testing data instead of hardcoding + + Fix replacement of empty tags + + Fix empty version checks for debian/changelog + + fix when switching from .dev to non-dev version + +------------------------------------------------------------------- +Thu Sep 03 07:21:55 UTC 2015 - adrian@suse.de + +- Update to version 0.5.3: + + Set pkgver and pkgrel for PKGBUILD files (fixes #21) + + Fix python3 compat + +------------------------------------------------------------------- +Mon Aug 17 15:14:11 UTC 2015 - adrian@suse.de + +- Update to version 0.5.2: + + fix it ... it only worked with "disabledrun" mode by luck + +------------------------------------------------------------------- +Tue Jul 28 06:17:48 UTC 2015 - adrian@suse.de + +- Update to version 0.5.1: + + Make python-packaging runtime dep optional + + Fix %setup handling for python spec files + +------------------------------------------------------------------- +Mon Jul 27 08:50:38 UTC 2015 - adrian@suse.de + +- Recommends python-packaging + +------------------------------------------------------------------- +Fri Jul 24 08:12:15 UTC 2015 - tbechtold@suse.com + +- Require python-packaging + +------------------------------------------------------------------- +Fri Jul 24 06:27:51 UTC 2015 - adrian@suse.de + +- Update to version 0.5.0: + + Add Makefile with install target + + Change debian source format to 'native' + + Fix tar file detection for PKGBUILD + + Add Testsuite and README.md + + - empty dummy commit to test travis hook + + Disable py26, enable py{33,34} for tests + + Add basic test for debian changelogs + + Add travis build status image to README + + Also do negative test for debian/changelog + + Move testdata to .json files + + Move _write_tarfile() to base test class + + Remove python 2.6 compat import + + Reuse test data for debian changelog tests + + Rewrite set_version in python + + Install devscripts in travis-ci test env + + Restructure version detection code + + Allow files in test tarballs + + Add package type detection for python + + Add version converter for python packages + + Run python version converter tests with dpkg + + Add function to add or replace a %define + + Fix problem with replacing tags in spec files + + Add function to replace %{version} in %setup + + Add custom line support for _write_specfile func + + Finally use version conversion for python packages + + Skip some tests if zypper or dpkg are unavailable + + Use python binary from virtualenv + +------------------------------------------------------------------- +Thu Sep 11 12:44:10 UTC 2014 - jblunck@infradead.org + +- Update to version 0.4.2: + + Release 0.4.2 - Update Debian changelog + +------------------------------------------------------------------- +Wed Sep 10 15:40:33 UTC 2014 - adrian@suse.de + +- Update to version 0.4.2: + + the extension needs to be \. + + test with defined() at ./set_version line 118. + + Fix processing of --file parameter + + Add support for setting the version in debian.changelog + + Sort local file list based on modification time (newest first) + +------------------------------------------------------------------- +Wed Jul 9 12:02:43 UTC 2014 - jblunck@infradead.org + +- Update to version 0.4.1: + + Add support to automatically detect version based on Debian changelog file + + Initial debianization + + Handle PKGBUILD files generated by services + +------------------------------------------------------------------- +Mon Mar 17 09:52:56 UTC 2014 - adrian@suse.de + +- Update to version 0.4.1: + + - drop old bash version + + - fix PKGBUILD version setting + + fix help text + + support detection from tar ball content + + use warnings pragma + + - replace bash script with a more secure perl version + + fix urgent quoting bugs + + Be more liberal in root-dir version detection + +------------------------------------------------------------------- +Mon Mar 17 09:51:15 UTC 2014 - adrian@suse.de + +- Update to version 0.4.1: + + - drop old bash version + + - fix PKGBUILD version setting + + fix help text + +------------------------------------------------------------------- +Fri Mar 7 12:06:41 UTC 2014 - adrian@suse.de + +- Update to version 0.4.0: + + support detection from tar ball content + + use warnings pragma + +------------------------------------------------------------------- +Thu Mar 6 11:03:52 UTC 2014 - adrian@suse.de + +- Update to version 0.4.0: + This is a rewrite in perl + This fixes also a sed commandline injection (bnc#866966 CVE-2014-0593) + +------------------------------------------------------------------- +Thu Mar 6 09:43:52 UTC 2014 - adrian@suse.de + +- Update to version 0.3.3: + + ERROR: git log --pretty=format:%s --no-merges 4b090f0cad..4fc9fcb0c2 failed; aborting! + +------------------------------------------------------------------- +Thu Mar 6 07:07:51 UTC 2014 - adrian@suse.de + +- Update to version 0.3.3: + + - drop two echo lines which can be used to run random commands + +------------------------------------------------------------------- +Tue Feb 11 16:29:02 UTC 2014 - speilicke@suse.com + +- Update to version 0.3.2: + + Be more liberal in root-dir version detection + +------------------------------------------------------------------- +Mon Feb 10 09:53:00 UTC 2014 - speilicke@suse.com + +- Update to version 0.3.1: + + Check tarball content's root-dir for version + + Use a for-loop for different endings + +------------------------------------------------------------------- +Tue Oct 29 13:47:13 UTC 2013 - speilicke@suse.com + +- Move service to github.com/openSUSE/obs-service-set_version +- Add _service file to update package from there +- Drop local sources and use tarball from source services + +------------------------------------------------------------------- +Tue Oct 8 10:06:26 UTC 2013 - jblunck@opensuse.org + +- Take Debian version and revision number from debian.changelog file + +------------------------------------------------------------------- +Tue Apr 16 09:30:01 UTC 2013 - adrian@suse.de + +- add support for PKGBUILD aka Arch Linux files + +------------------------------------------------------------------- +Tue Jun 26 15:01:27 UTC 2012 - saschpe@suse.de + +- Preserve whitespaces in Version: and Requires: lines + +------------------------------------------------------------------- +Tue Feb 14 20:01:13 GMT 2012 - aspiers@suse.com + +- only change the first occurrence of Version: header +- output useful info during run +- when auto-detecting the version, use the newest matching file + +------------------------------------------------------------------- +Tue Feb 14 17:54:29 GMT 2012 - aspiers@suse.com + +- patch License to follow spdx.org standard + +------------------------------------------------------------------- +Mon Jan 30 17:54:19 GMT 2012 - aspiers@suse.com + +- add --basename to usage help text + +------------------------------------------------------------------- +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 + +- support detecting the version from *.tbz2 files + +------------------------------------------------------------------- +Sun Dec 5 19:36:00 UTC 2010 - adrian@suse.de + +- initial package of service +- fix set version, when also release number is reset + diff --git a/obs-service-set_version.spec b/obs-service-set_version.spec new file mode 100644 index 0000000..ca7ae3d --- /dev/null +++ b/obs-service-set_version.spec @@ -0,0 +1,78 @@ +# +# spec file for package obs-service-set_version +# +# Copyright (c) 2024 SUSE LLC +# +# 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 https://bugs.opensuse.org/ +# + + +%if 0%{?rhel} || 0%{?amzn} || ( 0%{?suse_version} && 0%{?suse_version} <= 1315 ) +%bcond_with obs_scm_testsuite +%else +%bcond_without obs_scm_testsuite +%endif +%define service set_version + +Name: obs-service-%{service} +Version: 0.6.6 +Release: 0 +Summary: An OBS source service: Update spec file version +License: GPL-2.0-or-later +Group: Development/Tools/Building +URL: https://github.com/openSUSE/obs-service-%{service} +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + +%if %{with obs_scm_testsuite} +BuildRequires: python3-ddt +BuildRequires: python3-flake8 +BuildRequires: python3-packaging +%endif + +%if !0%{?suse_version} +Requires: python3 +%endif +%if 0%{?suse_version} +Recommends: python3-packaging +%endif + +%description +This is a source service for openSUSE Build Service. + +Very simply script to update the version in .spec or .dsc files according to +a given version or to the existing files. + +%prep +%setup -q + +%build +%if %{with obs_scm_testsuite} +%check +make test PYTHON=python3 +%endif + +%install +mkdir -p %{buildroot}%{_prefix}/lib/obs/service +install -m 0755 set_version %{buildroot}%{_prefix}/lib/obs/service +install -m 0644 set_version.service %{buildroot}%{_prefix}/lib/obs/service +# Doing %%python3_fix_shebang_path old fashioned way for the backward compatibility +sed -i "1s@#\\!.*python\S*@#\\!$(realpath /usr/bin/python3)@" \ + %{buildroot}%{_prefix}/lib/obs/service/set_version + +%files +%defattr(-,root,root) +%dir %{_prefix}/lib/obs +%{_prefix}/lib/obs/service + +%changelog