Accepting request 1181281 from Virtualization:containers

Fix shebang of the script to use the explicit version of Python

OBS-URL: https://build.opensuse.org/request/show/1181281
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/obs-service-replace_using_package_version?expand=0&rev=8
This commit is contained in:
Ana Guerrero 2024-06-17 17:27:45 +00:00 committed by Git OBS Bridge
commit b3bdf6ae9a
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 14 18:33:15 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Fix shebang of the script to use the explicit version of Python
(bsc#1212476).
-------------------------------------------------------------------
Wed Dec 13 20:47:44 UTC 2023 - containers@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file
# spec file for package obs-service-replace_using_package_version
#
# Copyright (c) 2023 SUSE LLC
# 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
@ -29,6 +29,8 @@ Source0: %{service}.py
Source1: %{service}.service
Source2: LICENSE
BuildRequires: sed
# for the __python3 macro
BuildRequires: python-rpm-macros
Requires: python3-docopt
Requires: python3-rpm
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -51,6 +53,9 @@ sed -i "s|#!/usr/bin/env python3|#!/usr/bin/python3|g" %{service}.py
install -D -m 755 %{service}.py %{buildroot}%{_prefix}/lib/obs/service/%{service}
install -D -m 644 %{service}.service %{buildroot}%{_prefix}/lib/obs/service/%{service}.service
# Doing %%python3_fix_shebang_path old fashioned way for the backward compatibility
sed -i "1s@#\\!.*python\S*@#\\!$(realpath %__python3)@" \
%{buildroot}%{_prefix}/lib/obs/service/%{service}
%files
%defattr(-,root,root)