Rebase to 2.0.3

Resolves: #1986085
This commit is contained in:
Michal Domonkos 2021-07-26 18:19:44 +02:00
parent efec9bddb2
commit ac55ee8114
6 changed files with 7 additions and 125 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
/scl-utils-2.0.1.tar.bz2
/scl-utils-2.0.2.tar.bz2
/scl-utils-2.0.2.tar.gz
/scl-utils-2.0.3.tar.gz

View File

@ -1,32 +0,0 @@
From 2fd4caf035c1883ae1fd9574f26dcf3fc12dc79b Mon Sep 17 00:00:00 2001
From: Honza Horak <hhorak@redhat.com>
Date: Fri, 23 Jul 2021 08:32:12 +0200
Subject: [PATCH] Make the python3 be the default choice
This default is likely never used but since it is there, let's make it valid.
scl-utils 2.x are included only in RHEL-8, so it is likely safe to expect
python3 being available everywhere where 2.x version of scl-utils is
used.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1984598
---
rpm/brp-scl-python-bytecompile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpm/brp-scl-python-bytecompile b/rpm/brp-scl-python-bytecompile
index ef00064..c91b952 100755
--- a/rpm/brp-scl-python-bytecompile
+++ b/rpm/brp-scl-python-bytecompile
@@ -10,7 +10,7 @@ fi
[ "0$scl_path" = "0" ] && exit 0
# If we don't have a python interpreter, avoid changing anything.
-default_python=${1:-/usr/bin/python}
+default_python=${1:-/usr/bin/python3}
if [ ! -x "$default_python" ]; then
exit 0
fi
--
2.26.3

View File

@ -1,31 +0,0 @@
From 56e77e7ec51ac610b5cc263bd2de058714bbd3e8 Mon Sep 17 00:00:00 2001
From: Jun Aruga <jaruga@redhat.com>
Date: Mon, 21 Dec 2020 13:41:40 +0100
Subject: [PATCH] Replace %{__python} with %{__python3}.
To fix the following error.
```
$ rhpkg srpm
error: attempt to use unversioned python, define %__python to /usr/bin/python2 or /usr/bin/python3 explicitly
```
---
rpm/macros.scl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpm/macros.scl b/rpm/macros.scl
index 550243e..f1ee5f2 100644
--- a/rpm/macros.scl
+++ b/rpm/macros.scl
@@ -90,7 +90,7 @@ package or when debugging this package.
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
}
/usr/lib/rpm/brp-strip-static-archive %{__strip}
- /usr/lib/rpm/brp-scl-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} %{_scl_root}
+ /usr/lib/rpm/brp-scl-python-bytecompile %{__python3} %{?_python_bytecompile_errors_terminate_build} %{_scl_root}
/usr/lib/rpm/brp-python-hardlink
%{nil}}
BuildRequires: scl-utils-build
--
2.26.3

View File

@ -1,54 +0,0 @@
From 3538686a21279c60c916e82ece02efcd88ae95b9 Mon Sep 17 00:00:00 2001
From: Joe Orton <jorton@redhat.com>
Date: Thu, 8 Aug 2019 09:26:00 +0100
Subject: [PATCH] Fix crashes in "scl list-enabled":
* src/lib_common.c (merge_string_arrays):
Ensure elements of returned array are strdup()ed.
* src/scllib.c (get_enabled_collections):
Ensure all elements of returned array are strdup()ed.
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1728450
---
src/lib_common.c | 5 +++++
src/scllib.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/lib_common.c b/src/lib_common.c
index 1aa49a0..2e7d116 100644
--- a/src/lib_common.c
+++ b/src/lib_common.c
@@ -7,6 +7,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <wordexp.h>
+#include <assert.h>
#include "errors.h"
#include "scllib.h"
@@ -269,6 +270,10 @@ char **merge_string_arrays(char *const *array1, char *const *array2)
}
merged_array[++prev] = NULL;
+ for (int i = 0; i < prev; i++) {
+ merged_array[i] = xstrdup(merged_array[i]);
+ }
+
return merged_array;
}
diff --git a/src/scllib.c b/src/scllib.c
index ce8df90..3c32d65 100644
--- a/src/scllib.c
+++ b/src/scllib.c
@@ -107,8 +107,8 @@ scl_rc get_enabled_collections(char ***_enabled_collections)
sizeof(SCL_MODULES_PATH - 1))){
enabled_collections[i] += sizeof(SCL_MODULES_PATH);
- enabled_collections[i] = xstrdup(enabled_collections[i]);
}
+ enabled_collections[i] = xstrdup(enabled_collections[i]);
}
}

View File

@ -3,8 +3,8 @@
Name: scl-utils
Epoch: 1
Version: 2.0.2
Release: 21%{?dist}
Version: 2.0.3
Release: 1%{?dist}
Summary: Utilities for alternative packaging
License: GPLv2+
@ -17,11 +17,6 @@ Buildrequires: rpm-devel
Requires: %{_bindir}/modulecmd
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
Patch2: 0001-Make-the-python3-be-the-default-choice.patch
Patch3: 0001-Replace-__python-with-__python3.patch
# https://github.com/sclorg/scl-utils/pull/25
Patch100: scl-utils-2.0.2-rhbz-1728450.patch
%description
Run-time utility for alternative packaging.
@ -81,6 +76,9 @@ ln -s prefixes conf
%{_rpmconfigdir}/brp-scl-python-bytecompile
%changelog
* Mon Jul 26 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.3-1
- Rebase to 2.0.3 (#1986085)
* Mon Jul 26 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-21
- Own directory /etc/scl (#1986040)

View File

@ -1 +1 @@
SHA512 (scl-utils-2.0.2.tar.gz) = 87a89942060c7103c5ff5b1c870ce9b8f82538da96849306b9c3ce8ff13754a3a43273fde4830e618b1b6ecdf834cadf8949eab337016092b6a520f23d8babff
SHA512 (scl-utils-2.0.3.tar.gz) = 701e7bd96e501e8d968b52b49f71fa7d214d538a0f425c9a7400100bb639599869c4e7ef8a0041be9a5a26457f2931fc271249e889e7233c98f246eeb6be8933