From 7d6e81168508d3ac4acc27e7b158104d84c8e0d442a0f6c988afbcc293a3cc3c Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 23 Jul 2020 18:06:33 +0000 Subject: [PATCH] - Use either python2 or python3 for lsvmbus (bsc#1093910) OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=149 --- hyper-v.changes | 1 + hyper-v.spec | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hyper-v.changes b/hyper-v.changes index b855938..4c25cb2 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -4,6 +4,7 @@ Wed Jul 22 12:12:12 UTC 2020 - ohering@suse.de - Remove dependency to network-online.target now that gethostname is used in kvp_daemon (bsc#1174443, bsc#1174444) - Reopen the devices if read() or write() returns errors (9fc3c01a) +- Use either python2 or python3 for lsvmbus (bsc#1093910) ------------------------------------------------------------------- Wed Jul 22 09:12:44 UTC 2020 - Guillaume GARDET diff --git a/hyper-v.spec b/hyper-v.spec index 93605fa..a9bc016 100644 --- a/hyper-v.spec +++ b/hyper-v.spec @@ -122,11 +122,21 @@ bindir=%{helper_dir}/bin bindir=%{_sbindir} %endif mkdir -p $RPM_BUILD_ROOT${bindir} +mkdir -p $RPM_BUILD_ROOT%{_sbindir} mkdir -p $RPM_BUILD_ROOT%{helper_dir}/bin install -m755 %{hv_kvp_daemon} $RPM_BUILD_ROOT${bindir} install -m755 %{hv_vss_daemon} $RPM_BUILD_ROOT${bindir} install -m755 %{hv_fcopy_daemon} $RPM_BUILD_ROOT${bindir} -install -D -m755 %{S:0} $RPM_BUILD_ROOT%{_sbindir}/lsvmbus +sed ' +1 { +%if 0%{?suse_version} > 1315 +s@^.*@#!%{_bindir}/python3@ +%else +s@^.*@#!%{_bindir}/python2@ +%endif +} +' %{S:0} > $RPM_BUILD_ROOT%{_sbindir}/lsvmbus +chmod 0755 $RPM_BUILD_ROOT%{_sbindir}/lsvmbus cp -avL %{S:20} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_get_dhcp_info cp -avL %{S:21} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_get_dns_info cp -avL %{S:22} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_set_ifconfig