From 5a1d72f62c6330d01131981439bdafd4d819c33054749b46056b413bebe728a9 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 28 Nov 2023 18:02:52 +0000 Subject: [PATCH] Accepting request 1129638 from home:eeich:branches:network:cluster - Explicitly create an Obsoletes: entry for each package version that is obsoleted by the present version. These are all published versions of the last two major releases as well as all minor versions of the present release lower than the current one (bsc#1216869 2nd part). This prevents the current version to upgrade a old Slurm version for which no upgrade path exists. OBS-URL: https://build.opensuse.org/request/show/1129638 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=279 --- slurm.changes | 11 +++++++++++ slurm.spec | 23 +++++++++++++++++++++-- upgrades | 7 +++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 upgrades diff --git a/slurm.changes b/slurm.changes index 0a57b33..61c90ca 100644 --- a/slurm.changes +++ b/slurm.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Nov 28 14:14:28 UTC 2023 - Egbert Eich + +- Explicitly create an Obsoletes: entry for each package version + that is obsoleted by the present version. These are all published + versions of the last two major releases as well as all minor + versions of the present release lower than the current one + (bsc#1216869 2nd part). + This prevents the current version to upgrade a old Slurm version + for which no upgrade path exists. + ------------------------------------------------------------------- Mon Nov 20 15:29:55 UTC 2023 - Egbert Eich diff --git a/slurm.spec b/slurm.spec index 824e5bf..632196f 100644 --- a/slurm.spec +++ b/slurm.spec @@ -18,6 +18,7 @@ # Check file META in sources: update so_version to (API_CURRENT - API_AGE) %define so_version 39 +# Make sure to update `upgrades` as well! %define ver 23.02.6 %define _ver _23_02 #%%define rc_v 0rc1 @@ -72,9 +73,26 @@ Conflicts: %{*} >= %{ver_m}.99 } %if 0%{?base_ver} > 0 && 0%{?base_ver} < %{lua:x=string.gsub(rpm.expand("%_ver"),"_","");print(x)} %define upgrade 1 %endif +%define upgrade_versions upgrades +%define do_obsoletes() %{lua: + local filename = rpm.expand("%_sourcedir") .. "/" .. rpm.expand("%upgrade_versions") + local version = rpm.expand("%version") + local arg = rpm.expand("%{1}") + local f = io.open(filename ,"r") + local em = false + if f~=nil then + f.close(f) + for line in io.lines(filename) do + if em then print('\\n') else em = true end + print("Obsoletes: " .. arg .. " = " .. line) + end + else + print("Obsoletes: " .. arg .. " < " .. version) + end } + %define upgrade_dep() %{?upgrade: # Provides: %{*} = %{version} -Obsoletes: %{*} < %{version} +%{do_obsoletes %{*}} Conflicts: %{*} } %if 0%{?suse_version} >= 1500 @@ -145,7 +163,8 @@ Group: Productivity/Clustering/Computing URL: https://www.schedmd.com Source: https://download.schedmd.com/slurm/%{pname}-%{dl_ver}.tar.bz2 #Source: https://github.com/SchedMD/slurm/archive/refs/tags/%{pname}-%{dl_ver}.tar.gz -Source1: slurm-rpmlintrc +Source1: %upgrade_versions +Source2: slurm-rpmlintrc Source10: slurmd.xml Source11: slurmctld.xml Source12: slurmdbd.xml diff --git a/upgrades b/upgrades new file mode 100644 index 0000000..55ae78f --- /dev/null +++ b/upgrades @@ -0,0 +1,7 @@ +23.02.5 +23.02.3 +23.02.0 +22.05.10 +22.05.5 +22.05.2 +22.05.0