From 872ea5af1b69e02aff6f1de3f93a0a2bc17fdaf6 Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Jul 11 2022 14:12:41 +0000 Subject: Fix %autosetup -S git regression wrt default git branch Found by Miro Hroncok (@churchyard) via https://bodhi.fedoraproject.org/updates/FEDORA-2022-763dfc66f1 --- 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..d5e8976 --- /dev/null +++ b/0001-Use-explicit-default-branch-in-autosetup-S-git.patch @@ -0,0 +1,40 @@ +From 8b9da98e4c9e256c7c6ecca7f1e5bdbbce29e5da Mon Sep 17 00:00:00 2001 +From: Michal Domonkos +Date: Mon, 11 Jul 2022 13:14:49 +0200 +Subject: [PATCH] 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 406622d2f..cf4f77331 100644 +--- a/macros.in ++++ b/macros.in +@@ -1163,7 +1163,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\ +@@ -1172,7 +1172,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/rpm.spec b/rpm.spec index 8745f62..58ea284 100644 --- a/rpm.spec +++ b/rpm.spec @@ -30,7 +30,7 @@ %global rpmver 4.17.1 #global snapver rc1 -%global baserelease 1 +%global baserelease 2 %global sover 9 %global srcver %{rpmver}%{?snapver:-%{snapver}} @@ -56,6 +56,7 @@ 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 # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -607,6 +608,9 @@ fi %doc docs/librpm/html/* %changelog +* Mon Jul 11 2022 Michal Domonkos - 4.17.1-2 +- Fix %%autosetup -S git regression wrt default git branch + * Fri Jul 01 2022 Michal Domonkos - 4.17.1-1 - Rebase to rpm 4.17.1 (http://rpm.org/wiki/Releases/4.17.1)