From 83570997b22b65bb5afd95e166cf94bb745c35dd Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Mon, 11 Jul 2022 14:56:35 +0200 Subject: [PATCH] Fix minor regressions --- ...it-default-branch-in-autosetup-S-git.patch | 40 +++++++++++++++++++ ...xclude-.src.rpm-from-check-buildroot.patch | 31 ++++++++++++++ rpm.spec | 8 +++- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 0001-Use-explicit-default-branch-in-autosetup-S-git.patch create mode 100644 0002-Exclude-.src.rpm-from-check-buildroot.patch diff --git a/0001-Use-explicit-default-branch-in-autosetup-S-git.patch b/0001-Use-explicit-default-branch-in-autosetup-S-git.patch new file mode 100644 index 0000000..efb042b --- /dev/null +++ b/0001-Use-explicit-default-branch-in-autosetup-S-git.patch @@ -0,0 +1,40 @@ +From fdb2de52f24111b64b7e41ab052e8751f0ec3df9 Mon Sep 17 00:00:00 2001 +From: Michal Domonkos +Date: Mon, 11 Jul 2022 13:14:49 +0200 +Subject: [PATCH 1/2] Use explicit default branch in %autosetup -S git + +Commit 3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b assumed "master" as the +default git branch to track, however the name can be changed globally, +so make it explicit. + +Given the choice now, go with "main" as the general trend, e.g: +https://fedoraproject.org/wiki/Changes/GitRepos-master-to-main +--- + macros.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/macros.in b/macros.in +index 6177e6fec..db5f5b11f 100644 +--- a/macros.in ++++ b/macros.in +@@ -1166,7 +1166,7 @@ package or when debugging this package.\ + + # Git + %__scm_setup_git(q)\ +-%{__git} init %{-q}\ ++%{__git} init %{-q} --initial-branch=main\ + %{__git} config user.name "%{__scm_username}"\ + %{__git} config user.email "%{__scm_usermail}"\ + %{__git} config gc.auto 0\ +@@ -1175,7 +1175,7 @@ package or when debugging this package.\ + --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"\ + %{__git} branch rpm-build \ + %{__git} checkout rpm-build \ +-%{__git} branch --set-upstream-to=master ++%{__git} branch --set-upstream-to=main + + %__scm_apply_git(qp:m:)\ + %{__git} apply --index --reject %{-p:-p%{-p*}} -\ +-- +2.36.1 + diff --git a/0002-Exclude-.src.rpm-from-check-buildroot.patch b/0002-Exclude-.src.rpm-from-check-buildroot.patch new file mode 100644 index 0000000..4619287 --- /dev/null +++ b/0002-Exclude-.src.rpm-from-check-buildroot.patch @@ -0,0 +1,31 @@ +From 7a9edfccdb667045ecaeeb591161bf08f14066c9 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Wed, 6 Jul 2022 13:19:59 +0200 +Subject: [PATCH 2/2] Exclude *.src.rpm from check-buildroot + +With the SRPMs now containing the expanded spec file they are bound to +have the build root included in the header. Turns out some people +package SRPMs to rebuild them locally e.g. against the local kernel. + +Resolves: rhbz#2104150 + +Backported from commit aa701a8f483e2b1f57764c5d9129e27271d96b38 +--- + scripts/check-buildroot | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/scripts/check-buildroot b/scripts/check-buildroot +index 74c3b469b..d97820633 100755 +--- a/scripts/check-buildroot ++++ b/scripts/check-buildroot +@@ -28,6 +28,7 @@ NCPUS=${RPM_BUILD_NCPUS:-1} + + find "$RPM_BUILD_ROOT" \! \( \ + -name '*.pyo' -o -name '*.pyc' -o -name '*.elc' -o -name '.packlist' \ ++ -o -name '*.src.rpm' \ + \) -type f -print0 | \ + LANG=C xargs -0r -P$NCPUS -n16 grep -lF "$RPM_BUILD_ROOT" >>$tmp + +-- +2.36.1 + diff --git a/rpm.spec b/rpm.spec index b703859..9714b4c 100644 --- a/rpm.spec +++ b/rpm.spec @@ -30,7 +30,7 @@ %global rpmver 4.18.0 %global snapver beta1 -%global baserelease 1 +%global baserelease 2 %global sover 9 %global srcver %{rpmver}%{?snapver:-%{snapver}} @@ -56,6 +56,8 @@ Patch1: rpm-4.17.x-siteconfig.patch Patch3: rpm-4.9.90-no-man-dirs.patch # Patches already upstream: +Patch100: 0001-Use-explicit-default-branch-in-autosetup-S-git.patch +Patch101: 0002-Exclude-.src.rpm-from-check-buildroot.patch # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -610,6 +612,10 @@ fi %doc docs/librpm/html/* %changelog +* Mon Jul 11 2022 Michal Domonkos - 4.18.0-0.beta1.2 +- Fix check-buildroot regression wrt bundled SRPM (#2104150) +- Fix %%autosetup -S git regression wrt default git branch + * Tue Jun 28 2022 Panu Matilainen - 4.18.0-0.beta1.1 - Rebase to 4.18.0-beta1 (https://rpm.org/wiki/Releases/4.18.0)