Update to rpm 4.15.0 alpha
- New rpm-plugin-audit sub-package - Rebase patches as necessary - Drop the evil python3 string monkey-patching - Drop no longer needed LUA_COMPAT defines and friends and use %set_build_flags instead. - python and perl macros and helper scripts are gone
This commit is contained in:
parent
d958e93dd1
commit
0a7d172130
1
.gitignore
vendored
1
.gitignore
vendored
@ -32,3 +32,4 @@
|
|||||||
/rpm-4.14.2-rc2.tar.bz2
|
/rpm-4.14.2-rc2.tar.bz2
|
||||||
/rpm-4.14.2.tar.bz2
|
/rpm-4.14.2.tar.bz2
|
||||||
/rpm-4.14.2.1.tar.bz2
|
/rpm-4.14.2.1.tar.bz2
|
||||||
|
/rpm-4.14.90-git14653.tar.bz2
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
From 1da9e839bb573b9187403983f5a69853ab364306 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <1da9e839bb573b9187403983f5a69853ab364306.1554879119.git.pmatilai@redhat.com>
|
|
||||||
From: Pavlina Moravcova Varekova <pmoravco@redhat.com>
|
|
||||||
Date: Sun, 17 Mar 2019 06:47:26 +0100
|
|
||||||
Subject: [PATCH] Add flag to use strip -g instead of full strip on DSOs
|
|
||||||
(RhBug:1663264)
|
|
||||||
|
|
||||||
The find-debuginfo.sh flag -g had exactly this meaning. But from
|
|
||||||
version rpm-4.13.0-alpha flag -g changes its behavior. It affects
|
|
||||||
both libraries and executables.
|
|
||||||
|
|
||||||
For some packages the original behavior was preferred. That is why
|
|
||||||
the new find-debuginfo.sh flag --g-libs is created.
|
|
||||||
|
|
||||||
Options -g and --g-libs are mutually exclusive.
|
|
||||||
---
|
|
||||||
scripts/find-debuginfo.sh | 23 ++++++++++++++++++++++-
|
|
||||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
|
||||||
index 6e3ba2ce0..c75d176ac 100755
|
|
||||||
--- a/scripts/find-debuginfo.sh
|
|
||||||
+++ b/scripts/find-debuginfo.sh
|
|
||||||
@@ -4,6 +4,7 @@
|
|
||||||
#
|
|
||||||
# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m] [-i] [-n]
|
|
||||||
# [--keep-section SECTION] [--remove-section SECTION]
|
|
||||||
+# [--g-libs]
|
|
||||||
# [-j N] [--jobs N]
|
|
||||||
# [-o debugfiles.list]
|
|
||||||
# [-S debugsourcefiles.list]
|
|
||||||
@@ -16,6 +17,8 @@
|
|
||||||
# [builddir]
|
|
||||||
#
|
|
||||||
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
|
|
||||||
+# The --g-libs flag says to use strip -g instead of full strip ONLY on DSOs.
|
|
||||||
+# Options -g and --g-libs are mutually exclusive.
|
|
||||||
# The -r flag says to use eu-strip --reloc-debug-sections.
|
|
||||||
# Use --keep-section SECTION or --remove-section SECTION to explicitly
|
|
||||||
# keep a (non-allocated) section in the main executable or explicitly
|
|
||||||
@@ -68,6 +71,9 @@ lib_rpm_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
# With -g arg, pass it to strip on libraries or executables.
|
|
||||||
strip_g=false
|
|
||||||
|
|
||||||
+# With --g-libs arg, pass it to strip on libraries.
|
|
||||||
+strip_glibs=false
|
|
||||||
+
|
|
||||||
# with -r arg, pass --reloc-debug-sections to eu-strip.
|
|
||||||
strip_r=false
|
|
||||||
|
|
||||||
@@ -135,6 +141,9 @@ while [ $# -gt 0 ]; do
|
|
||||||
unique_debug_src_base=$2
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
+ --g-libs)
|
|
||||||
+ strip_glibs=true
|
|
||||||
+ ;;
|
|
||||||
-g)
|
|
||||||
strip_g=true
|
|
||||||
;;
|
|
||||||
@@ -204,6 +213,11 @@ if test -n "$build_id_seed" -a "$no_recompute_build_id" = "true"; then
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
+if ("$strip_g" = "true") && ("$strip_glibs" = "true"); then
|
|
||||||
+ echo >&2 "*** ERROR: -g and --g-libs cannot be used together"
|
|
||||||
+ exit 2
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
i=0
|
|
||||||
while ((i < nout)); do
|
|
||||||
outs[$i]="$BUILDDIR/${outs[$i]}"
|
|
||||||
@@ -237,6 +251,9 @@ strip_to_debug()
|
|
||||||
application/x-executable*) g=-g ;;
|
|
||||||
application/x-pie-executable*) g=-g ;;
|
|
||||||
esac
|
|
||||||
+ $strip_glibs && case "$(file -bi "$2")" in
|
|
||||||
+ application/x-sharedlib*) g=-g ;;
|
|
||||||
+ esac
|
|
||||||
eu-strip --remove-comment $r $g ${keep_remove_args} -f "$1" "$2" || exit
|
|
||||||
chmod 444 "$1" || exit
|
|
||||||
}
|
|
||||||
@@ -409,8 +426,12 @@ do_file()
|
|
||||||
# libraries. Other executable ELF files (like kernel modules) don't need it.
|
|
||||||
if [ "$include_minidebug" = "true" -a "$strip_g" = "false" ]; then
|
|
||||||
skip_mini=true
|
|
||||||
+ if [ "$strip_glibs" = "false" ]; then
|
|
||||||
+ case "$(file -bi "$f")" in
|
|
||||||
+ application/x-sharedlib*) skip_mini=false ;;
|
|
||||||
+ esac
|
|
||||||
+ fi
|
|
||||||
case "$(file -bi "$f")" in
|
|
||||||
- application/x-sharedlib*) skip_mini=false ;;
|
|
||||||
application/x-executable*) skip_mini=false ;;
|
|
||||||
application/x-pie-executable*) skip_mini=false ;;
|
|
||||||
esac
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
|||||||
From 68d383c39cef8d58b80940b13dd132d3f41a03f0 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <68d383c39cef8d58b80940b13dd132d3f41a03f0.1558430547.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Tue, 2 Apr 2019 15:22:07 +0300
|
|
||||||
Subject: [PATCH 1/2] Detect kernel modules by .modinfo section presence for
|
|
||||||
build-id generation
|
|
||||||
|
|
||||||
File extension based heuristics only work so far at best, and break
|
|
||||||
completely on compressed files with arbitrary .gz/.xz etc extension.
|
|
||||||
This isn't supposed to change any behavior as such, only provide more
|
|
||||||
reliable detection of kernel modules.
|
|
||||||
---
|
|
||||||
build/files.c | 27 ++++++++++++++++++++++++---
|
|
||||||
1 file changed, 24 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/build/files.c b/build/files.c
|
|
||||||
index dbad9a7f3..3822be3d3 100644
|
|
||||||
--- a/build/files.c
|
|
||||||
+++ b/build/files.c
|
|
||||||
@@ -1739,6 +1739,28 @@ static int addNewIDSymlink(ARGV_t *files,
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int haveModinfo(Elf *elf)
|
|
||||||
+{
|
|
||||||
+ Elf_Scn * scn = NULL;
|
|
||||||
+ size_t shstrndx;
|
|
||||||
+ int have_modinfo = 0;
|
|
||||||
+ const char *sname;
|
|
||||||
+
|
|
||||||
+ if (elf_getshdrstrndx(elf, &shstrndx) == 0) {
|
|
||||||
+ while ((scn = elf_nextscn(elf, scn)) != NULL) {
|
|
||||||
+ GElf_Shdr shdr_mem, *shdr = gelf_getshdr(scn, &shdr_mem);
|
|
||||||
+ if (shdr == NULL)
|
|
||||||
+ continue;
|
|
||||||
+ sname = elf_strptr(elf, shstrndx, shdr->sh_name);
|
|
||||||
+ if (sname && rstreq(sname, ".modinfo")) {
|
|
||||||
+ have_modinfo = 1;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return have_modinfo;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int generateBuildIDs(FileList fl, ARGV_t *files)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
@@ -1803,15 +1825,14 @@ static int generateBuildIDs(FileList fl, ARGV_t *files)
|
|
||||||
int fd = open (flp->diskPath, O_RDONLY);
|
|
||||||
if (fd >= 0) {
|
|
||||||
/* Only real ELF files, that are ET_EXEC, ET_DYN or
|
|
||||||
- kernel modules (ET_REL files with names ending in .ko)
|
|
||||||
+ kernel modules (ET_REL files with .modinfo section)
|
|
||||||
should have build-ids. */
|
|
||||||
GElf_Ehdr ehdr;
|
|
||||||
Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
|
|
||||||
if (elf != NULL && elf_kind(elf) == ELF_K_ELF
|
|
||||||
&& gelf_getehdr(elf, &ehdr) != NULL
|
|
||||||
&& (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN
|
|
||||||
- || (ehdr.e_type == ET_REL
|
|
||||||
- && rpmFileHasSuffix (flp->diskPath, ".ko")))) {
|
|
||||||
+ || (ehdr.e_type == ET_REL && haveModinfo(elf)))) {
|
|
||||||
const void *build_id;
|
|
||||||
ssize_t len = dwelf_elf_gnu_build_id (elf, &build_id);
|
|
||||||
/* len == -1 means error. Zero means no
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,656 +0,0 @@
|
|||||||
From 84920f898315d09a57a3f1067433eaeb7de5e830 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <84920f898315d09a57a3f1067433eaeb7de5e830.1554884444.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Fri, 22 Feb 2019 19:44:16 +0200
|
|
||||||
Subject: [PATCH] In Python 3, return all our string data as surrogate-escaped
|
|
||||||
utf-8 strings
|
|
||||||
|
|
||||||
In the almost ten years of rpm sort of supporting Python 3 bindings, quite
|
|
||||||
obviously nobody has actually tried to use them. There's a major mismatch
|
|
||||||
between what the header API outputs (bytes) and what all the other APIs
|
|
||||||
accept (strings), resulting in hysterical TypeErrors all over the place,
|
|
||||||
including but not limited to labelCompare() (RhBug:1631292). Also a huge
|
|
||||||
number of other places have been returning strings and silently assuming
|
|
||||||
utf-8 through use of Py_BuildValue("s", ...), which will just irrevocably
|
|
||||||
fail when non-utf8 data is encountered.
|
|
||||||
|
|
||||||
The politically Python 3-correct solution would be declaring all our data
|
|
||||||
as bytes with unspecified encoding - that's exactly what it historically is.
|
|
||||||
However doing so would by definition break every single rpm script people
|
|
||||||
have developed on Python 2. And when 99% of the rpm content in the world
|
|
||||||
actually is utf-8 encoded even if it doesn't say so (and in recent times
|
|
||||||
packages even advertise themselves as utf-8 encoded), the bytes-only route
|
|
||||||
seems a wee bit too draconian, even to this grumpy old fella.
|
|
||||||
|
|
||||||
Instead, route all our string returns through a single helper macro
|
|
||||||
which on Python 2 just does what we always did, but in Python 3 converts
|
|
||||||
the data to surrogate-escaped utf-8 strings. This makes stuff "just work"
|
|
||||||
out of the box pretty much everywhere even with Python 3 (including
|
|
||||||
our own test-suite!), while still allowing to handle the non-utf8 case.
|
|
||||||
Handling the non-utf8 case is a bit more uglier but still possible,
|
|
||||||
which is exactly how you want corner-cases to be. There might be some
|
|
||||||
uses for retrieving raw byte data from the header, but worrying about
|
|
||||||
such an API is a case for some other rainy day, for now we mostly only
|
|
||||||
care that stuff works again.
|
|
||||||
|
|
||||||
Also add test-cases for mixed data source labelCompare() and
|
|
||||||
non-utf8 insert to + retrieve from header.
|
|
||||||
---
|
|
||||||
python/header-py.c | 2 +-
|
|
||||||
python/rpmds-py.c | 8 ++++----
|
|
||||||
python/rpmfd-py.c | 6 +++---
|
|
||||||
python/rpmfi-py.c | 24 ++++++++++++------------
|
|
||||||
python/rpmfiles-py.c | 26 +++++++++++++-------------
|
|
||||||
python/rpmkeyring-py.c | 2 +-
|
|
||||||
python/rpmmacro-py.c | 2 +-
|
|
||||||
python/rpmmodule.c | 2 +-
|
|
||||||
python/rpmps-py.c | 8 ++++----
|
|
||||||
python/rpmstrpool-py.c | 2 +-
|
|
||||||
python/rpmsystem-py.h | 7 +++++++
|
|
||||||
python/rpmtd-py.c | 2 +-
|
|
||||||
python/rpmte-py.c | 16 ++++++++--------
|
|
||||||
python/rpmts-py.c | 11 ++++++-----
|
|
||||||
python/spec-py.c | 8 ++++----
|
|
||||||
tests/local.at | 1 +
|
|
||||||
tests/rpmpython.at | 34 ++++++++++++++++++++++++++++++++++
|
|
||||||
17 files changed, 102 insertions(+), 59 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/python/header-py.c b/python/header-py.c
|
|
||||||
index c9d54e869..93c241cb7 100644
|
|
||||||
--- a/python/header-py.c
|
|
||||||
+++ b/python/header-py.c
|
|
||||||
@@ -231,7 +231,7 @@ static PyObject * hdrFormat(hdrObject * s, PyObject * args, PyObject * kwds)
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
- result = Py_BuildValue("s", r);
|
|
||||||
+ result = utf8FromString(r);
|
|
||||||
free(r);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
|
|
||||||
index 39b26628e..ecc9af9d5 100644
|
|
||||||
--- a/python/rpmds-py.c
|
|
||||||
+++ b/python/rpmds-py.c
|
|
||||||
@@ -31,19 +31,19 @@ rpmds_Ix(rpmdsObject * s)
|
|
||||||
static PyObject *
|
|
||||||
rpmds_DNEVR(rpmdsObject * s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmdsDNEVR(s->ds));
|
|
||||||
+ return utf8FromString(rpmdsDNEVR(s->ds));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmds_N(rpmdsObject * s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmdsN(s->ds));
|
|
||||||
+ return utf8FromString(rpmdsN(s->ds));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmds_EVR(rpmdsObject * s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmdsEVR(s->ds));
|
|
||||||
+ return utf8FromString(rpmdsEVR(s->ds));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -261,7 +261,7 @@ rpmds_subscript(rpmdsObject * s, PyObject * key)
|
|
||||||
|
|
||||||
ix = (int) PyInt_AsLong(key);
|
|
||||||
rpmdsSetIx(s->ds, ix);
|
|
||||||
- return Py_BuildValue("s", rpmdsDNEVR(s->ds));
|
|
||||||
+ return utf8FromString(rpmdsDNEVR(s->ds));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyMappingMethods rpmds_as_mapping = {
|
|
||||||
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
|
|
||||||
index 85fb0cd24..4b05cce5f 100644
|
|
||||||
--- a/python/rpmfd-py.c
|
|
||||||
+++ b/python/rpmfd-py.c
|
|
||||||
@@ -327,17 +327,17 @@ static PyObject *rpmfd_get_closed(rpmfdObject *s)
|
|
||||||
static PyObject *rpmfd_get_name(rpmfdObject *s)
|
|
||||||
{
|
|
||||||
/* XXX: rpm returns non-paths with [mumble], python files use <mumble> */
|
|
||||||
- return Py_BuildValue("s", Fdescr(s->fd));
|
|
||||||
+ return utf8FromString(Fdescr(s->fd));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfd_get_mode(rpmfdObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", s->mode);
|
|
||||||
+ return utf8FromString(s->mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfd_get_flags(rpmfdObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", s->flags);
|
|
||||||
+ return utf8FromString(s->flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyGetSetDef rpmfd_getseters[] = {
|
|
||||||
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
|
|
||||||
index 8d2f926d0..db405c231 100644
|
|
||||||
--- a/python/rpmfi-py.c
|
|
||||||
+++ b/python/rpmfi-py.c
|
|
||||||
@@ -41,19 +41,19 @@ rpmfi_DX(rpmfiObject * s, PyObject * unused)
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_BN(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiBN(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiBN(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_DN(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiDN(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiDN(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_FN(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiFN(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiFN(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -98,7 +98,7 @@ rpmfi_Digest(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
char *digest = rpmfiFDigestHex(s->fi, NULL);
|
|
||||||
if (digest) {
|
|
||||||
- PyObject *dig = Py_BuildValue("s", digest);
|
|
||||||
+ PyObject *dig = utf8FromString(digest);
|
|
||||||
free(digest);
|
|
||||||
return dig;
|
|
||||||
} else {
|
|
||||||
@@ -109,7 +109,7 @@ rpmfi_Digest(rpmfiObject * s, PyObject * unused)
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_FLink(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiFLink(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiFLink(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -133,13 +133,13 @@ rpmfi_FMtime(rpmfiObject * s, PyObject * unused)
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_FUser(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiFUser(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiFUser(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmfi_FGroup(rpmfiObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfiFGroup(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiFGroup(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -155,7 +155,7 @@ rpmfi_FClass(rpmfiObject * s, PyObject * unused)
|
|
||||||
|
|
||||||
if ((FClass = rpmfiFClass(s->fi)) == NULL)
|
|
||||||
FClass = "";
|
|
||||||
- return Py_BuildValue("s", FClass);
|
|
||||||
+ return utf8FromString(FClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -208,7 +208,7 @@ rpmfi_iternext(rpmfiObject * s)
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
PyTuple_SET_ITEM(result, 0, Py_None);
|
|
||||||
} else
|
|
||||||
- PyTuple_SET_ITEM(result, 0, Py_BuildValue("s", FN));
|
|
||||||
+ PyTuple_SET_ITEM(result, 0, utf8FromString(FN));
|
|
||||||
PyTuple_SET_ITEM(result, 1, PyLong_FromLongLong(FSize));
|
|
||||||
PyTuple_SET_ITEM(result, 2, PyInt_FromLong(FMode));
|
|
||||||
PyTuple_SET_ITEM(result, 3, PyInt_FromLong(FMtime));
|
|
||||||
@@ -222,12 +222,12 @@ rpmfi_iternext(rpmfiObject * s)
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
PyTuple_SET_ITEM(result, 10, Py_None);
|
|
||||||
} else
|
|
||||||
- PyTuple_SET_ITEM(result, 10, Py_BuildValue("s", FUser));
|
|
||||||
+ PyTuple_SET_ITEM(result, 10, utf8FromString(FUser));
|
|
||||||
if (FGroup == NULL) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
PyTuple_SET_ITEM(result, 11, Py_None);
|
|
||||||
} else
|
|
||||||
- PyTuple_SET_ITEM(result, 11, Py_BuildValue("s", FGroup));
|
|
||||||
+ PyTuple_SET_ITEM(result, 11, utf8FromString(FGroup));
|
|
||||||
PyTuple_SET_ITEM(result, 12, rpmfi_Digest(s, NULL));
|
|
||||||
|
|
||||||
} else
|
|
||||||
@@ -313,7 +313,7 @@ rpmfi_subscript(rpmfiObject * s, PyObject * key)
|
|
||||||
|
|
||||||
ix = (int) PyInt_AsLong(key);
|
|
||||||
rpmfiSetFX(s->fi, ix);
|
|
||||||
- return Py_BuildValue("s", rpmfiFN(s->fi));
|
|
||||||
+ return utf8FromString(rpmfiFN(s->fi));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyMappingMethods rpmfi_as_mapping = {
|
|
||||||
diff --git a/python/rpmfiles-py.c b/python/rpmfiles-py.c
|
|
||||||
index bc07dbeaf..557246cae 100644
|
|
||||||
--- a/python/rpmfiles-py.c
|
|
||||||
+++ b/python/rpmfiles-py.c
|
|
||||||
@@ -41,37 +41,37 @@ static PyObject *rpmfile_dx(rpmfileObject *s)
|
|
||||||
static PyObject *rpmfile_name(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
char * fn = rpmfilesFN(s->files, s->ix);
|
|
||||||
- PyObject *o = Py_BuildValue("s", fn);
|
|
||||||
+ PyObject *o = utf8FromString(fn);
|
|
||||||
free(fn);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_basename(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesBN(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesBN(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_dirname(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesDN(s->files, rpmfilesDI(s->files, s->ix)));
|
|
||||||
+ return utf8FromString(rpmfilesDN(s->files, rpmfilesDI(s->files, s->ix)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_orig_name(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
char * fn = rpmfilesOFN(s->files, s->ix);
|
|
||||||
- PyObject *o = Py_BuildValue("s", fn);
|
|
||||||
+ PyObject *o = utf8FromString(fn);
|
|
||||||
free(fn);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_orig_basename(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesOBN(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesOBN(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_orig_dirname(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesODN(s->files, rpmfilesODI(s->files, s->ix)));
|
|
||||||
+ return utf8FromString(rpmfilesODN(s->files, rpmfilesODI(s->files, s->ix)));
|
|
||||||
}
|
|
||||||
static PyObject *rpmfile_mode(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
@@ -105,17 +105,17 @@ static PyObject *rpmfile_nlink(rpmfileObject *s)
|
|
||||||
|
|
||||||
static PyObject *rpmfile_linkto(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFLink(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFLink(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_user(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFUser(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFUser(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_group(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFGroup(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFGroup(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_fflags(rpmfileObject *s)
|
|
||||||
@@ -145,7 +145,7 @@ static PyObject *rpmfile_digest(rpmfileObject *s)
|
|
||||||
NULL, &diglen);
|
|
||||||
if (digest) {
|
|
||||||
char * hex = pgpHexStr(digest, diglen);
|
|
||||||
- PyObject *o = Py_BuildValue("s", hex);
|
|
||||||
+ PyObject *o = utf8FromString(hex);
|
|
||||||
free(hex);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
@@ -154,17 +154,17 @@ static PyObject *rpmfile_digest(rpmfileObject *s)
|
|
||||||
|
|
||||||
static PyObject *rpmfile_class(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFClass(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFClass(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_caps(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFCaps(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFCaps(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_langs(rpmfileObject *s)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmfilesFLangs(s->files, s->ix));
|
|
||||||
+ return utf8FromString(rpmfilesFLangs(s->files, s->ix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmfile_links(rpmfileObject *s)
|
|
||||||
diff --git a/python/rpmkeyring-py.c b/python/rpmkeyring-py.c
|
|
||||||
index d5f131e42..8968e0513 100644
|
|
||||||
--- a/python/rpmkeyring-py.c
|
|
||||||
+++ b/python/rpmkeyring-py.c
|
|
||||||
@@ -38,7 +38,7 @@ static PyObject *rpmPubkey_new(PyTypeObject *subtype,
|
|
||||||
static PyObject * rpmPubkey_Base64(rpmPubkeyObject *s)
|
|
||||||
{
|
|
||||||
char *b64 = rpmPubkeyBase64(s->pubkey);
|
|
||||||
- PyObject *res = Py_BuildValue("s", b64);
|
|
||||||
+ PyObject *res = utf8FromString(b64);
|
|
||||||
free(b64);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
diff --git a/python/rpmmacro-py.c b/python/rpmmacro-py.c
|
|
||||||
index 3cb1a51f5..d8a365547 100644
|
|
||||||
--- a/python/rpmmacro-py.c
|
|
||||||
+++ b/python/rpmmacro-py.c
|
|
||||||
@@ -52,7 +52,7 @@ rpmmacro_ExpandMacro(PyObject * self, PyObject * args, PyObject * kwds)
|
|
||||||
if (rpmExpandMacros(NULL, macro, &str, 0) < 0)
|
|
||||||
PyErr_SetString(pyrpmError, "error expanding macro");
|
|
||||||
else
|
|
||||||
- res = Py_BuildValue("s", str);
|
|
||||||
+ res = utf8FromString(str);
|
|
||||||
free(str);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
|
|
||||||
index 3faad23c7..05032edc7 100644
|
|
||||||
--- a/python/rpmmodule.c
|
|
||||||
+++ b/python/rpmmodule.c
|
|
||||||
@@ -237,7 +237,7 @@ static void addRpmTags(PyObject *module)
|
|
||||||
|
|
||||||
PyModule_AddIntConstant(module, tagname, tagval);
|
|
||||||
pyval = PyInt_FromLong(tagval);
|
|
||||||
- pyname = Py_BuildValue("s", shortname);
|
|
||||||
+ pyname = utf8FromString(shortname);
|
|
||||||
PyDict_SetItem(dict, pyval, pyname);
|
|
||||||
Py_DECREF(pyval);
|
|
||||||
Py_DECREF(pyname);
|
|
||||||
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
|
|
||||||
index bdc899a60..902b2ae63 100644
|
|
||||||
--- a/python/rpmps-py.c
|
|
||||||
+++ b/python/rpmps-py.c
|
|
||||||
@@ -18,12 +18,12 @@ static PyObject *rpmprob_get_type(rpmProblemObject *s, void *closure)
|
|
||||||
|
|
||||||
static PyObject *rpmprob_get_pkgnevr(rpmProblemObject *s, void *closure)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmProblemGetPkgNEVR(s->prob));
|
|
||||||
+ return utf8FromString(rpmProblemGetPkgNEVR(s->prob));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmprob_get_altnevr(rpmProblemObject *s, void *closure)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmProblemGetAltNEVR(s->prob));
|
|
||||||
+ return utf8FromString(rpmProblemGetAltNEVR(s->prob));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmprob_get_key(rpmProblemObject *s, void *closure)
|
|
||||||
@@ -38,7 +38,7 @@ static PyObject *rpmprob_get_key(rpmProblemObject *s, void *closure)
|
|
||||||
|
|
||||||
static PyObject *rpmprob_get_str(rpmProblemObject *s, void *closure)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmProblemGetStr(s->prob));
|
|
||||||
+ return utf8FromString(rpmProblemGetStr(s->prob));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *rpmprob_get_num(rpmProblemObject *s, void *closure)
|
|
||||||
@@ -59,7 +59,7 @@ static PyGetSetDef rpmprob_getseters[] = {
|
|
||||||
static PyObject *rpmprob_str(rpmProblemObject *s)
|
|
||||||
{
|
|
||||||
char *str = rpmProblemString(s->prob);
|
|
||||||
- PyObject *res = Py_BuildValue("s", str);
|
|
||||||
+ PyObject *res = utf8FromString(str);
|
|
||||||
free(str);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
diff --git a/python/rpmstrpool-py.c b/python/rpmstrpool-py.c
|
|
||||||
index 356bd1de5..a56e2b540 100644
|
|
||||||
--- a/python/rpmstrpool-py.c
|
|
||||||
+++ b/python/rpmstrpool-py.c
|
|
||||||
@@ -44,7 +44,7 @@ static PyObject *strpool_id2str(rpmstrPoolObject *s, PyObject *item)
|
|
||||||
const char *str = rpmstrPoolStr(s->pool, id);
|
|
||||||
|
|
||||||
if (str)
|
|
||||||
- ret = PyBytes_FromString(str);
|
|
||||||
+ ret = utf8FromString(str);
|
|
||||||
else
|
|
||||||
PyErr_SetObject(PyExc_KeyError, item);
|
|
||||||
}
|
|
||||||
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h
|
|
||||||
index 955d60cd3..87c750571 100644
|
|
||||||
--- a/python/rpmsystem-py.h
|
|
||||||
+++ b/python/rpmsystem-py.h
|
|
||||||
@@ -19,4 +19,11 @@
|
|
||||||
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+/* In Python 3, we return all strings as surrogate-escaped utf-8 */
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+#define utf8FromString(_s) PyUnicode_DecodeUTF8(_s, strlen(_s), "surrogateescape")
|
|
||||||
+#else
|
|
||||||
+#define utf8FromString(_s) PyBytes_FromString(_s)
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#endif /* H_SYSTEM_PYTHON */
|
|
||||||
diff --git a/python/rpmtd-py.c b/python/rpmtd-py.c
|
|
||||||
index 247c7502a..23ca10517 100644
|
|
||||||
--- a/python/rpmtd-py.c
|
|
||||||
+++ b/python/rpmtd-py.c
|
|
||||||
@@ -17,7 +17,7 @@ PyObject * rpmtd_ItemAsPyobj(rpmtd td, rpmTagClass tclass)
|
|
||||||
|
|
||||||
switch (tclass) {
|
|
||||||
case RPM_STRING_CLASS:
|
|
||||||
- res = PyBytes_FromString(rpmtdGetString(td));
|
|
||||||
+ res = utf8FromString(rpmtdGetString(td));
|
|
||||||
break;
|
|
||||||
case RPM_NUMERIC_CLASS:
|
|
||||||
res = PyLong_FromLongLong(rpmtdGetNumber(td));
|
|
||||||
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
|
|
||||||
index 99ff2f496..2b3745754 100644
|
|
||||||
--- a/python/rpmte-py.c
|
|
||||||
+++ b/python/rpmte-py.c
|
|
||||||
@@ -54,49 +54,49 @@ rpmte_TEType(rpmteObject * s, PyObject * unused)
|
|
||||||
static PyObject *
|
|
||||||
rpmte_N(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteN(s->te));
|
|
||||||
+ return utf8FromString(rpmteN(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_E(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteE(s->te));
|
|
||||||
+ return utf8FromString(rpmteE(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_V(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteV(s->te));
|
|
||||||
+ return utf8FromString(rpmteV(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_R(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteR(s->te));
|
|
||||||
+ return utf8FromString(rpmteR(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_A(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteA(s->te));
|
|
||||||
+ return utf8FromString(rpmteA(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_O(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteO(s->te));
|
|
||||||
+ return utf8FromString(rpmteO(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_NEVR(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteNEVR(s->te));
|
|
||||||
+ return utf8FromString(rpmteNEVR(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
rpmte_NEVRA(rpmteObject * s, PyObject * unused)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmteNEVRA(s->te));
|
|
||||||
+ return utf8FromString(rpmteNEVRA(s->te));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
|
|
||||||
index 1ddfc9a1e..96e3bb28e 100644
|
|
||||||
--- a/python/rpmts-py.c
|
|
||||||
+++ b/python/rpmts-py.c
|
|
||||||
@@ -230,8 +230,9 @@ rpmts_SolveCallback(rpmts ts, rpmds ds, const void * data)
|
|
||||||
|
|
||||||
PyEval_RestoreThread(cbInfo->_save);
|
|
||||||
|
|
||||||
- args = Py_BuildValue("(Oissi)", cbInfo->tso,
|
|
||||||
- rpmdsTagN(ds), rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds));
|
|
||||||
+ args = Py_BuildValue("(OiNNi)", cbInfo->tso,
|
|
||||||
+ rpmdsTagN(ds), utf8FromString(rpmdsN(ds)),
|
|
||||||
+ utf8FromString(rpmdsEVR(ds)), rpmdsFlags(ds));
|
|
||||||
result = PyEval_CallObject(cbInfo->cb, args);
|
|
||||||
Py_DECREF(args);
|
|
||||||
|
|
||||||
@@ -409,7 +410,7 @@ rpmts_HdrCheck(rpmtsObject * s, PyObject *obj)
|
|
||||||
rpmrc = headerCheck(s->ts, uh, uc, &msg);
|
|
||||||
Py_END_ALLOW_THREADS;
|
|
||||||
|
|
||||||
- return Py_BuildValue("(is)", rpmrc, msg);
|
|
||||||
+ return Py_BuildValue("(iN)", rpmrc, utf8FromString(msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
@@ -500,7 +501,7 @@ rpmtsCallback(const void * hd, const rpmCallbackType what,
|
|
||||||
/* Synthesize a python object for callback (if necessary). */
|
|
||||||
if (pkgObj == NULL) {
|
|
||||||
if (h) {
|
|
||||||
- pkgObj = Py_BuildValue("s", headerGetString(h, RPMTAG_NAME));
|
|
||||||
+ pkgObj = utf8FromString(headerGetString(h, RPMTAG_NAME));
|
|
||||||
} else {
|
|
||||||
pkgObj = Py_None;
|
|
||||||
Py_INCREF(pkgObj);
|
|
||||||
@@ -845,7 +846,7 @@ static PyObject *rpmts_get_tid(rpmtsObject *s, void *closure)
|
|
||||||
|
|
||||||
static PyObject *rpmts_get_rootDir(rpmtsObject *s, void *closure)
|
|
||||||
{
|
|
||||||
- return Py_BuildValue("s", rpmtsRootDir(s->ts));
|
|
||||||
+ return utf8FromString(rpmtsRootDir(s->ts));
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rpmts_set_scriptFd(rpmtsObject *s, PyObject *value, void *closure)
|
|
||||||
diff --git a/python/spec-py.c b/python/spec-py.c
|
|
||||||
index 4efdbf4bf..70b796531 100644
|
|
||||||
--- a/python/spec-py.c
|
|
||||||
+++ b/python/spec-py.c
|
|
||||||
@@ -57,7 +57,7 @@ static PyObject *pkgGetSection(rpmSpecPkg pkg, int section)
|
|
||||||
{
|
|
||||||
char *sect = rpmSpecPkgGetSection(pkg, section);
|
|
||||||
if (sect != NULL) {
|
|
||||||
- PyObject *ps = PyBytes_FromString(sect);
|
|
||||||
+ PyObject *ps = utf8FromString(sect);
|
|
||||||
free(sect);
|
|
||||||
if (ps != NULL)
|
|
||||||
return ps;
|
|
||||||
@@ -158,7 +158,7 @@ static PyObject * getSection(rpmSpec spec, int section)
|
|
||||||
{
|
|
||||||
const char *sect = rpmSpecGetSection(spec, section);
|
|
||||||
if (sect) {
|
|
||||||
- return Py_BuildValue("s", sect);
|
|
||||||
+ return utf8FromString(sect);
|
|
||||||
}
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
}
|
|
||||||
@@ -208,8 +208,8 @@ static PyObject * spec_get_sources(specObject *s, void *closure)
|
|
||||||
|
|
||||||
rpmSpecSrcIter iter = rpmSpecSrcIterInit(s->spec);
|
|
||||||
while ((source = rpmSpecSrcIterNext(iter)) != NULL) {
|
|
||||||
- PyObject *srcUrl = Py_BuildValue("(sii)",
|
|
||||||
- rpmSpecSrcFilename(source, 1),
|
|
||||||
+ PyObject *srcUrl = Py_BuildValue("(Nii)",
|
|
||||||
+ utf8FromString(rpmSpecSrcFilename(source, 1)),
|
|
||||||
rpmSpecSrcNum(source),
|
|
||||||
rpmSpecSrcFlags(source));
|
|
||||||
if (!srcUrl) {
|
|
||||||
diff --git a/tests/local.at b/tests/local.at
|
|
||||||
index 02ead66c9..42eef1c75 100644
|
|
||||||
--- a/tests/local.at
|
|
||||||
+++ b/tests/local.at
|
|
||||||
@@ -10,6 +10,7 @@ rm -rf "${abs_builddir}"/testing`rpm --eval '%_dbpath'`/*
|
|
||||||
|
|
||||||
m4_define([RPMPY_RUN],[[
|
|
||||||
cat << EOF > test.py
|
|
||||||
+# coding=utf-8
|
|
||||||
import rpm, sys
|
|
||||||
dbpath=rpm.expandMacro('%_dbpath')
|
|
||||||
rpm.addMacro('_dbpath', '${abs_builddir}/testing%s' % dbpath)
|
|
||||||
diff --git a/tests/rpmpython.at b/tests/rpmpython.at
|
|
||||||
index ff77f868c..58f3e84a6 100644
|
|
||||||
--- a/tests/rpmpython.at
|
|
||||||
+++ b/tests/rpmpython.at
|
|
||||||
@@ -106,6 +106,25 @@ None
|
|
||||||
'rpm.hdr' object has no attribute '__foo__']
|
|
||||||
)
|
|
||||||
|
|
||||||
+RPMPY_TEST([non-utf8 data in header],[
|
|
||||||
+str = u'älämölö'
|
|
||||||
+enc = 'iso-8859-1'
|
|
||||||
+b = str.encode(enc)
|
|
||||||
+h = rpm.hdr()
|
|
||||||
+h['group'] = b
|
|
||||||
+d = h['group']
|
|
||||||
+try:
|
|
||||||
+ # python 3
|
|
||||||
+ t = bytes(d, 'utf-8', 'surrogateescape')
|
|
||||||
+except TypeError:
|
|
||||||
+ # python 2
|
|
||||||
+ t = bytes(d)
|
|
||||||
+res = t.decode(enc)
|
|
||||||
+myprint(str == res)
|
|
||||||
+],
|
|
||||||
+[True]
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
RPMPY_TEST([invalid header data],[
|
|
||||||
h1 = rpm.hdr()
|
|
||||||
h1['basenames'] = ['bing', 'bang', 'bong']
|
|
||||||
@@ -125,6 +144,21 @@ for h in [h1, h2]:
|
|
||||||
/opt/bing,/opt/bang,/flopt/bong]
|
|
||||||
)
|
|
||||||
|
|
||||||
+RPMPY_TEST([labelCompare],[
|
|
||||||
+v = '1.0'
|
|
||||||
+r = '1'
|
|
||||||
+e = 3
|
|
||||||
+h = rpm.hdr()
|
|
||||||
+h['name'] = 'testpkg'
|
|
||||||
+h['version'] = v
|
|
||||||
+h['release'] = r
|
|
||||||
+h['epoch'] = e
|
|
||||||
+myprint(rpm.labelCompare((str(h['epoch']), h['version'], h['release']),
|
|
||||||
+ (str(e), v, r)))
|
|
||||||
+],
|
|
||||||
+[0]
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
RPMPY_TEST([vfyflags API],[
|
|
||||||
ts = rpm.ts()
|
|
||||||
dlv = ts.getVfyFlags()
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
|||||||
From 13b0ebee7cdb1e4d200b3c40d0ec9440f198a1d4 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <13b0ebee7cdb1e4d200b3c40d0ec9440f198a1d4.1554886141.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Wed, 10 Apr 2019 11:24:44 +0300
|
|
||||||
Subject: [PATCH] Monkey-patch .decode() method to our strings as a temporary
|
|
||||||
compat crutch
|
|
||||||
|
|
||||||
As a temporary crutch to support faster deployment of the sane
|
|
||||||
string behavior on python3, monkey-patch a decode method into all
|
|
||||||
strings we return. This seems to be enough to fix practically all
|
|
||||||
API users who have already adapted to the long-standing broken API
|
|
||||||
on Python 3. API users compatible with both Python 2 and 3 never needed
|
|
||||||
this anyway. Issue a warning with pointer to the relevant bug when the
|
|
||||||
fake decode() method is used to alert users to the issue.
|
|
||||||
|
|
||||||
This is certainly an evil thing to do and will be removed as soon as
|
|
||||||
the critical users have been fixed to work with the new, corrected
|
|
||||||
behavior.
|
|
||||||
---
|
|
||||||
python/rpm/__init__.py | 3 +++
|
|
||||||
python/rpmmodule.c | 1 +
|
|
||||||
python/rpmsystem-py.h | 22 ++++++++++++++++++++--
|
|
||||||
3 files changed, 24 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/python/rpm/__init__.py b/python/rpm/__init__.py
|
|
||||||
index 54728bbd4..6d69eda7b 100644
|
|
||||||
--- a/python/rpm/__init__.py
|
|
||||||
+++ b/python/rpm/__init__.py
|
|
||||||
@@ -61,6 +61,9 @@ except ImportError:
|
|
||||||
# backwards compatibility + give the same class both ways
|
|
||||||
ts = TransactionSet
|
|
||||||
|
|
||||||
+def _fakedecode(self, encoding='utf-8', errors='strict'):
|
|
||||||
+ warnings.warn("decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751", UnicodeWarning, stacklevel=2)
|
|
||||||
+ return self
|
|
||||||
|
|
||||||
def headerLoad(*args, **kwds):
|
|
||||||
"""DEPRECATED! Use rpm.hdr() instead."""
|
|
||||||
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
|
|
||||||
index 05032edc7..2a76cfbd0 100644
|
|
||||||
--- a/python/rpmmodule.c
|
|
||||||
+++ b/python/rpmmodule.c
|
|
||||||
@@ -28,6 +28,7 @@
|
|
||||||
*/
|
|
||||||
|
|
||||||
PyObject * pyrpmError;
|
|
||||||
+PyObject * fakedecode = NULL;
|
|
||||||
|
|
||||||
static PyObject * archScore(PyObject * self, PyObject * arg)
|
|
||||||
{
|
|
||||||
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h
|
|
||||||
index 25938464a..803da0fc1 100644
|
|
||||||
--- a/python/rpmsystem-py.h
|
|
||||||
+++ b/python/rpmsystem-py.h
|
|
||||||
@@ -19,12 +19,29 @@
|
|
||||||
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+PyObject * fakedecode;
|
|
||||||
+
|
|
||||||
static inline PyObject * utf8FromString(const char *s)
|
|
||||||
{
|
|
||||||
/* In Python 3, we return all strings as surrogate-escaped utf-8 */
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
|
||||||
- if (s != NULL)
|
|
||||||
- return PyUnicode_DecodeUTF8(s, strlen(s), "surrogateescape");
|
|
||||||
+ if (s != NULL) {
|
|
||||||
+ PyObject *o = PyUnicode_DecodeUTF8(s, strlen(s), "surrogateescape");
|
|
||||||
+ /* fish the fake decode function from python side if not done yet */
|
|
||||||
+ if (fakedecode == NULL) {
|
|
||||||
+ PyObject *n = PyUnicode_FromString("rpm");
|
|
||||||
+ PyObject *m = PyImport_Import(n);
|
|
||||||
+ PyObject *md = PyModule_GetDict(m);
|
|
||||||
+ fakedecode = PyDict_GetItemString(md, "_fakedecode");
|
|
||||||
+ Py_DECREF(m);
|
|
||||||
+ Py_DECREF(n);
|
|
||||||
+ }
|
|
||||||
+ if (fakedecode && o) {
|
|
||||||
+ /* monkey-patch it into the string object as "decode" */
|
|
||||||
+ PyDict_SetItemString(Py_TYPE(o)->tp_dict, "decode", fakedecode);
|
|
||||||
+ }
|
|
||||||
+ return o;
|
|
||||||
+ }
|
|
||||||
#else
|
|
||||||
if (s != NULL)
|
|
||||||
return PyBytes_FromString(s);
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
From aea53a4aead8bd71f519df35fcffd9eec76fbc01 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <aea53a4aead8bd71f519df35fcffd9eec76fbc01.1554884465.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Tue, 26 Feb 2019 11:27:51 +0200
|
|
||||||
Subject: [PATCH] Return NULL string as None from utf8FromString()
|
|
||||||
|
|
||||||
Commit 84920f898315d09a57a3f1067433eaeb7de5e830 regressed dnf install
|
|
||||||
to segfault at the end due to some NULL string passed to strlen().
|
|
||||||
Check for NULL and return it as None, make it an inline function
|
|
||||||
to make this saner.
|
|
||||||
---
|
|
||||||
python/rpmsystem-py.h | 10 ++++++++--
|
|
||||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h
|
|
||||||
index 87c750571..25938464a 100644
|
|
||||||
--- a/python/rpmsystem-py.h
|
|
||||||
+++ b/python/rpmsystem-py.h
|
|
||||||
@@ -19,11 +19,17 @@
|
|
||||||
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+static inline PyObject * utf8FromString(const char *s)
|
|
||||||
+{
|
|
||||||
/* In Python 3, we return all strings as surrogate-escaped utf-8 */
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
|
||||||
-#define utf8FromString(_s) PyUnicode_DecodeUTF8(_s, strlen(_s), "surrogateescape")
|
|
||||||
+ if (s != NULL)
|
|
||||||
+ return PyUnicode_DecodeUTF8(s, strlen(s), "surrogateescape");
|
|
||||||
#else
|
|
||||||
-#define utf8FromString(_s) PyBytes_FromString(_s)
|
|
||||||
+ if (s != NULL)
|
|
||||||
+ return PyBytes_FromString(s);
|
|
||||||
#endif
|
|
||||||
+ Py_RETURN_NONE;
|
|
||||||
+}
|
|
||||||
|
|
||||||
#endif /* H_SYSTEM_PYTHON */
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
|||||||
From 0e2b8a390e9c9b01920812a65ebd88e0fbad4d3a Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <0e2b8a390e9c9b01920812a65ebd88e0fbad4d3a.1542624780.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Mon, 1 Oct 2018 15:37:48 +0300
|
|
||||||
Subject: [PATCH] Take %_prefix into account when compressing man pages etc,
|
|
||||||
take II
|
|
||||||
|
|
||||||
brp-compress used to be all hardcoded around /usr for no good reason.
|
|
||||||
Support passing prefix as an argument and only look for things to
|
|
||||||
compress there. First attempt in 5e65f92b53ca07c6e30921688c1b84d0a6b41db7
|
|
||||||
had an embarrassing typo/thinko/case of missing brain in the assign syntax.
|
|
||||||
|
|
||||||
Based on feedback and work of Owen Taylor and Yanko Kaneti in PR #538
|
|
||||||
---
|
|
||||||
platform.in | 2 +-
|
|
||||||
scripts/brp-compress | 12 ++++++++----
|
|
||||||
2 files changed, 9 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/platform.in b/platform.in
|
|
||||||
index 6ccdaf23d..3eb67b55b 100644
|
|
||||||
--- a/platform.in
|
|
||||||
+++ b/platform.in
|
|
||||||
@@ -69,7 +69,7 @@
|
|
||||||
|
|
||||||
# Standard brp-macro naming:
|
|
||||||
# convert all '-' in basename to '_', add two leading underscores.
|
|
||||||
-%__brp_compress %{_rpmconfigdir}/brp-compress
|
|
||||||
+%__brp_compress %{_rpmconfigdir}/brp-compress %{?_prefix}
|
|
||||||
%__brp_java_gcjcompile %{_rpmconfigdir}/brp-java-bytecompile
|
|
||||||
%__brp_python_bytecompile %{_rpmconfigdir}/brp-python-bytecompile "" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}"
|
|
||||||
%__brp_strip %{_rpmconfigdir}/brp-strip %{__strip}
|
|
||||||
diff --git a/scripts/brp-compress b/scripts/brp-compress
|
|
||||||
index e6b69a9e4..e4307eff7 100755
|
|
||||||
--- a/scripts/brp-compress
|
|
||||||
+++ b/scripts/brp-compress
|
|
||||||
@@ -5,16 +5,20 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
+PREFIX=${1:-/usr}
|
|
||||||
+
|
|
||||||
cd "$RPM_BUILD_ROOT"
|
|
||||||
|
|
||||||
# Compress man pages
|
|
||||||
COMPRESS=${COMPRESS:-gzip -9 -n}
|
|
||||||
COMPRESS_EXT=${COMPRESS_EXT:-.gz}
|
|
||||||
|
|
||||||
-for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
|
|
||||||
- ./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
|
|
||||||
- ./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
|
|
||||||
- ./usr/share/doc/*/man/man* ./usr/lib/*/man/man* ./usr/share/fish/man/man*
|
|
||||||
+for d in .${PREFIX}/man/man* .${PREFIX}/man/*/man* .${PREFIX}/info \
|
|
||||||
+ .${PREFIX}/share/man/man* .${PREFIX}/share/man/*/man* \
|
|
||||||
+ .${PREFIX}/share/info .${PREFIX}/kerberos/man \
|
|
||||||
+ .${PREFIX}/X11R6/man/man* .${PREFIX}/lib/perl5/man/man* \
|
|
||||||
+ .${PREFIX}/share/doc/*/man/man* .${PREFIX}/lib/*/man/man* \
|
|
||||||
+ .${PREFIX}/share/fish/man/man*
|
|
||||||
do
|
|
||||||
[ -d $d ] || continue
|
|
||||||
for f in `find $d -type f ! -name dir`
|
|
||||||
--
|
|
||||||
2.19.1
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
From b7606b9dbebba90fb4868fd01e9c05abe05d9586 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <b7606b9dbebba90fb4868fd01e9c05abe05d9586.1559904592.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Fri, 7 Jun 2019 13:12:18 +0300
|
|
||||||
Subject: [PATCH] Use a pre-determined buildhost in test-suite to avoid DNS
|
|
||||||
usage
|
|
||||||
|
|
||||||
A misconfigured DNS can cause bogus test-suite failures and hideous
|
|
||||||
slow-down for no reason of our own. Use a preset, predictable
|
|
||||||
buildhost name to avoid such issues.
|
|
||||||
---
|
|
||||||
tests/atlocal.in | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/atlocal.in b/tests/atlocal.in
|
|
||||||
index a44c067bf..fcbf783d7 100644
|
|
||||||
--- a/tests/atlocal.in
|
|
||||||
+++ b/tests/atlocal.in
|
|
||||||
@@ -45,20 +45,20 @@ fi
|
|
||||||
|
|
||||||
function run()
|
|
||||||
{
|
|
||||||
- "$@" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
|
|
||||||
+ "$@" --define "_buildhost testhost" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
|
|
||||||
}
|
|
||||||
|
|
||||||
function rundebug()
|
|
||||||
{
|
|
||||||
cp ${top_srcdir}/macros.debug ${RPM_CONFIGDIR}/macros.d/
|
|
||||||
- "$@" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
|
|
||||||
+ "$@" --define "_buildhost testhost" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
|
|
||||||
rm -f ${RPM_CONFIGDIR}/macros.d/macros.debug
|
|
||||||
}
|
|
||||||
|
|
||||||
function runroot()
|
|
||||||
{
|
|
||||||
(unset RPM_CONFIGDIR RPM_POPTEXEC_PATH; cd ${RPMTEST} && \
|
|
||||||
- MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" --noplugins
|
|
||||||
+ MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_buildhost testhost" --define "_topdir /build" --noplugins
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
From 0917da26bf0722fcf40de1c5a61412f23982d131 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <0917da26bf0722fcf40de1c5a61412f23982d131.1554881054.git.pmatilai@redhat.com>
|
|
||||||
From: Ernestas Kulik <ekulik@redhat.com>
|
|
||||||
Date: Mon, 25 Feb 2019 16:34:06 +0100
|
|
||||||
Subject: [PATCH] find-debuginfo.sh: Handle position-independent executables
|
|
||||||
|
|
||||||
Since file 5.33, PIEs are identified by a new MIME type, meaning that,
|
|
||||||
currently, for such executables, the .gnu_debugdata section is not
|
|
||||||
added, even if -m is passed.
|
|
||||||
|
|
||||||
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
|
|
||||||
---
|
|
||||||
scripts/find-debuginfo.sh | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
|
||||||
index 967814509..6e3ba2ce0 100755
|
|
||||||
--- a/scripts/find-debuginfo.sh
|
|
||||||
+++ b/scripts/find-debuginfo.sh
|
|
||||||
@@ -412,6 +412,7 @@ do_file()
|
|
||||||
case "$(file -bi "$f")" in
|
|
||||||
application/x-sharedlib*) skip_mini=false ;;
|
|
||||||
application/x-executable*) skip_mini=false ;;
|
|
||||||
+ application/x-pie-executable*) skip_mini=false ;;
|
|
||||||
esac
|
|
||||||
$skip_mini || add_minidebug "${debugfn}" "$f"
|
|
||||||
fi
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
|||||||
From 0d2176c9a3ae44fd0a67c9983b1a5ba0a00388fd Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
||||||
Date: Mon, 15 Oct 2018 19:49:57 +0200
|
|
||||||
Subject: [PATCH] rpmfc: push name/epoch/version/release macro before invoking
|
|
||||||
depgens
|
|
||||||
|
|
||||||
Fixes: https://github.com/rpm-software-management/rpm/issues/502
|
|
||||||
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
||||||
---
|
|
||||||
build/rpmfc.c | 25 +++++++++++++++++++++++++
|
|
||||||
1 file changed, 25 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/build/rpmfc.c b/build/rpmfc.c
|
|
||||||
index 2fbfc69ab..eccd6582a 100644
|
|
||||||
--- a/build/rpmfc.c
|
|
||||||
+++ b/build/rpmfc.c
|
|
||||||
@@ -1334,9 +1334,31 @@ static rpmRC rpmfcApplyExternal(rpmfc fc)
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
+typedef const struct macroExport_s {
|
|
||||||
+ const char * name;
|
|
||||||
+ rpmTagVal tag;
|
|
||||||
+} * macroExport;
|
|
||||||
+
|
|
||||||
+static struct macroExport_s const macroExportList[] = {
|
|
||||||
+ { "name", RPMTAG_NAME },
|
|
||||||
+ { "epoch", RPMTAG_EPOCH },
|
|
||||||
+ { "version", RPMTAG_VERSION },
|
|
||||||
+ { "release", RPMTAG_RELEASE },
|
|
||||||
+ { NULL, 0 }
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
rpmRC rpmfcApply(rpmfc fc)
|
|
||||||
{
|
|
||||||
rpmRC rc;
|
|
||||||
+ Package pkg = fc->pkg;
|
|
||||||
+ macroExport me;
|
|
||||||
+ for (me = macroExportList; me->name; me++) {
|
|
||||||
+ char *val = headerGetAsString(pkg->header, me->tag);
|
|
||||||
+ if (val) {
|
|
||||||
+ rpmPushMacro(NULL, me->name, NULL, val, RMIL_SPEC);
|
|
||||||
+ free(val);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
/* If new-fangled dependency generation is disabled ... */
|
|
||||||
if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {
|
|
||||||
/* ... then generate dependencies using %{__find_requires} et al. */
|
|
||||||
@@ -1347,6 +1369,9 @@ rpmRC rpmfcApply(rpmfc fc)
|
|
||||||
/* ... otherwise generate per-file dependencies */
|
|
||||||
rc = rpmfcApplyInternal(fc);
|
|
||||||
}
|
|
||||||
+ for (me = macroExportList; me->name; me++)
|
|
||||||
+ if (headerIsEntry(pkg->header, me->tag))
|
|
||||||
+ rpmPopMacro(NULL, me->name);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.19.1
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
From d48981ad7e36abb3500161d823acf92345c94f5d Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <d48981ad7e36abb3500161d823acf92345c94f5d.1558430547.git.pmatilai@redhat.com>
|
|
||||||
In-Reply-To: <68d383c39cef8d58b80940b13dd132d3f41a03f0.1558430547.git.pmatilai@redhat.com>
|
|
||||||
References: <68d383c39cef8d58b80940b13dd132d3f41a03f0.1558430547.git.pmatilai@redhat.com>
|
|
||||||
From: Panu Matilainen <pmatilai@redhat.com>
|
|
||||||
Date: Tue, 2 Apr 2019 16:07:56 +0300
|
|
||||||
Subject: [PATCH 2/2] Support build-id generation from compressed ELF files
|
|
||||||
(elfutils >= 0.175)
|
|
||||||
|
|
||||||
Use dwelf_elf_begin() for reading ELF files for build-id generation on
|
|
||||||
versions that have it to support compressed ELF files such as kernel
|
|
||||||
modules (RhBug:1650072,1650074). Note that debugedit still cannot handle
|
|
||||||
compressed files, this is only for build-id generation.
|
|
||||||
---
|
|
||||||
build/files.c | 4 ++++
|
|
||||||
configure.ac | 4 ++++
|
|
||||||
2 files changed, 8 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/build/files.c b/build/files.c
|
|
||||||
index 3822be3d3..f72a7c866 100644
|
|
||||||
--- a/build/files.c
|
|
||||||
+++ b/build/files.c
|
|
||||||
@@ -1828,7 +1828,11 @@ static int generateBuildIDs(FileList fl, ARGV_t *files)
|
|
||||||
kernel modules (ET_REL files with .modinfo section)
|
|
||||||
should have build-ids. */
|
|
||||||
GElf_Ehdr ehdr;
|
|
||||||
+#if HAVE_DWELF_ELF_BEGIN
|
|
||||||
+ Elf *elf = dwelf_elf_begin(fd);
|
|
||||||
+#else
|
|
||||||
Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
|
|
||||||
+#endif
|
|
||||||
if (elf != NULL && elf_kind(elf) == ELF_K_ELF
|
|
||||||
&& gelf_getehdr(elf, &ehdr) != NULL
|
|
||||||
&& (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 99ce7df32..b2d7ed806 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -487,6 +487,10 @@ AS_IF([test "$WITH_LIBELF" = yes],[
|
|
||||||
# If possible we also want the strtab functions from elfutils 0.167.
|
|
||||||
# But we can fall back on the (unsupported) ebl alternatives if not.
|
|
||||||
AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes])
|
|
||||||
+ # whether libdw supports compressed ELF objects
|
|
||||||
+ AC_CHECK_LIB(dw, dwelf_elf_begin, [
|
|
||||||
+ AC_DEFINE(HAVE_DWELF_ELF_BEGIN, 1, [Have dwelf_elf_begin?])
|
|
||||||
+ ])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,118 +0,0 @@
|
|||||||
From 8390fa8515f499994646cf3bd113423744dc7bd9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Florian Festi <ffesti@redhat.com>
|
|
||||||
Date: Fri, 30 Nov 2018 11:02:52 +0100
|
|
||||||
Subject: [PATCH] Add RPMTAG_MODULARITYLABEL to distinguish packages build for
|
|
||||||
modularity
|
|
||||||
|
|
||||||
Tag can be set with a ModularityLabel: statement in the spec file preamble or
|
|
||||||
via the modularitylabel macro
|
|
||||||
---
|
|
||||||
build/parsePreamble.c | 4 ++++
|
|
||||||
build/parseSpec.c | 1 +
|
|
||||||
lib/rpmtag.h | 1 +
|
|
||||||
macros.in | 5 +++++
|
|
||||||
tests/rpmgeneral.at | 1 +
|
|
||||||
5 files changed, 12 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
|
|
||||||
index f5e06bac8..e340e5c7a 100644
|
|
||||||
--- a/build/parsePreamble.c
|
|
||||||
+++ b/build/parsePreamble.c
|
|
||||||
@@ -43,6 +43,7 @@ static const rpmTagVal copyTagsDuringParse[] = {
|
|
||||||
RPMTAG_DISTTAG,
|
|
||||||
RPMTAG_BUGURL,
|
|
||||||
RPMTAG_GROUP,
|
|
||||||
+ RPMTAG_MODULARITYLABEL,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -526,6 +527,7 @@ static struct optionalTag {
|
|
||||||
{ RPMTAG_DISTURL, "%{disturl}" },
|
|
||||||
{ RPMTAG_DISTTAG, "%{disttag}" },
|
|
||||||
{ RPMTAG_BUGURL, "%{bugurl}" },
|
|
||||||
+ { RPMTAG_MODULARITYLABEL, "%{modularitylabel}"},
|
|
||||||
{ -1, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -779,6 +781,7 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
|
|
||||||
case RPMTAG_URL:
|
|
||||||
case RPMTAG_DISTTAG:
|
|
||||||
case RPMTAG_BUGURL:
|
|
||||||
+ case RPMTAG_MODULARITYLABEL:
|
|
||||||
/* XXX TODO: validate format somehow */
|
|
||||||
case RPMTAG_VCS:
|
|
||||||
SINGLE_TOKEN_ONLY;
|
|
||||||
@@ -1018,6 +1021,7 @@ static struct PreambleRec_s const preambleList[] = {
|
|
||||||
{RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")},
|
|
||||||
{RPMTAG_ORDERNAME, 2, 0, LEN_AND_STR("orderwithrequires")},
|
|
||||||
{RPMTAG_REMOVEPATHPOSTFIXES,0, 0, LEN_AND_STR("removepathpostfixes")},
|
|
||||||
+ {RPMTAG_MODULARITYLABEL, 0, 0, LEN_AND_STR("modularitylabel")},
|
|
||||||
{0, 0, 0, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/build/parseSpec.c b/build/parseSpec.c
|
|
||||||
index bf4789942..c80802baf 100644
|
|
||||||
--- a/build/parseSpec.c
|
|
||||||
+++ b/build/parseSpec.c
|
|
||||||
@@ -517,6 +517,7 @@ static const rpmTagVal sourceTags[] = {
|
|
||||||
RPMTAG_BUGURL,
|
|
||||||
RPMTAG_HEADERI18NTABLE,
|
|
||||||
RPMTAG_VCS,
|
|
||||||
+ RPMTAG_MODULARITYLABEL,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/lib/rpmtag.h b/lib/rpmtag.h
|
|
||||||
index 973a6b69d..b9623ef24 100644
|
|
||||||
--- a/lib/rpmtag.h
|
|
||||||
+++ b/lib/rpmtag.h
|
|
||||||
@@ -368,6 +368,7 @@
|
|
||||||
RPMTAG_FILESIGNATURELENGTH = 5091, /* i */
|
|
||||||
RPMTAG_PAYLOADDIGEST = 5092, /* s[] */
|
|
||||||
RPMTAG_PAYLOADDIGESTALGO = 5093, /* i */
|
|
||||||
+ RPMTAG_MODULARITYLABEL = 5096, /* s */
|
|
||||||
|
|
||||||
RPMTAG_FIRSTFREE_TAG /*!< internal */
|
|
||||||
} rpmTag;
|
|
||||||
diff --git a/macros.in b/macros.in
|
|
||||||
index e0a1aea4e..cb4929c10 100644
|
|
||||||
--- a/macros.in
|
|
||||||
+++ b/macros.in
|
|
||||||
@@ -357,6 +357,11 @@ package or when debugging this package.\
|
|
||||||
%_javadir %{_datadir}/java
|
|
||||||
%_javadocdir %{_datadir}/javadoc
|
|
||||||
|
|
||||||
+
|
|
||||||
+# Set ModularityLabel: for packages being build
|
|
||||||
+#
|
|
||||||
+#%modularitylabel
|
|
||||||
+
|
|
||||||
# A colon separated list of paths where files should *not* be installed.
|
|
||||||
# Usually, these are network file system mount points.
|
|
||||||
#
|
|
||||||
diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at
|
|
||||||
index 509277f2c..45d38698b 100644
|
|
||||||
--- a/tests/rpmgeneral.at
|
|
||||||
+++ b/tests/rpmgeneral.at
|
|
||||||
@@ -150,6 +150,7 @@ LONGARCHIVESIZE
|
|
||||||
LONGFILESIZES
|
|
||||||
LONGSIGSIZE
|
|
||||||
LONGSIZE
|
|
||||||
+MODULARITYLABEL
|
|
||||||
N
|
|
||||||
NAME
|
|
||||||
NEVR
|
|
||||||
--
|
|
||||||
2.17.2
|
|
||||||
|
|
||||||
diff -up rpm-4.14.2.1/tests/rpmtests.zzz rpm-4.14.2.1/tests/rpmtests
|
|
||||||
--- rpm-4.14.2.1/tests/rpmtests.zzz 2018-12-19 15:30:40.536065873 +0200
|
|
||||||
+++ rpm-4.14.2.1/tests/rpmtests 2018-12-19 15:29:38.368156769 +0200
|
|
||||||
@@ -2682,6 +2682,7 @@ LONGARCHIVESIZE
|
|
||||||
LONGFILESIZES
|
|
||||||
LONGSIGSIZE
|
|
||||||
LONGSIZE
|
|
||||||
+MODULARITYLABEL
|
|
||||||
N
|
|
||||||
NAME
|
|
||||||
NEVR
|
|
@ -2,14 +2,14 @@ diff -up rpm-4.9.1.1/macros.in.jx rpm-4.9.1.1/macros.in
|
|||||||
--- rpm-4.9.1.1/macros.in.jx 2011-08-03 16:19:05.000000000 -0400
|
--- rpm-4.9.1.1/macros.in.jx 2011-08-03 16:19:05.000000000 -0400
|
||||||
+++ rpm-4.9.1.1/macros.in 2011-08-08 09:41:52.981064316 -0400
|
+++ rpm-4.9.1.1/macros.in 2011-08-08 09:41:52.981064316 -0400
|
||||||
@@ -674,9 +674,10 @@ print (t)\
|
@@ -674,9 +674,10 @@ print (t)\
|
||||||
RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
|
|
||||||
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
|
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
|
||||||
RPM_OPT_FLAGS=\"%{optflags}\"\
|
RPM_OPT_FLAGS=\"%{optflags}\"\
|
||||||
+ RPM_LD_FLAGS=\"%{?build_ldflags}\"\
|
+ RPM_LD_FLAGS=\"%{?build_ldflags}\"\
|
||||||
RPM_ARCH=\"%{_arch}\"\
|
RPM_ARCH=\"%{_arch}\"\
|
||||||
RPM_OS=\"%{_os}\"\
|
RPM_OS=\"%{_os}\"\
|
||||||
- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
|
RPM_BUILD_NCPUS=\"%{_smp_build_ncpus}\"\
|
||||||
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS\
|
- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS\
|
||||||
|
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_LD_FLAGS\
|
||||||
RPM_DOC_DIR=\"%{_docdir}\"\
|
RPM_DOC_DIR=\"%{_docdir}\"\
|
||||||
export RPM_DOC_DIR\
|
export RPM_DOC_DIR\
|
||||||
RPM_PACKAGE_NAME=\"%{NAME}\"\
|
RPM_PACKAGE_NAME=\"%{NAME}\"\
|
@ -8,5 +8,5 @@ diff -up rpm-4.11.1-rc1/macros.in.siteconfig rpm-4.11.1-rc1/macros.in
|
|||||||
+ CONFIG_SITE=${CONFIG_SITE:-NONE}\
|
+ CONFIG_SITE=${CONFIG_SITE:-NONE}\
|
||||||
+ export CONFIG_SITE\
|
+ export CONFIG_SITE\
|
||||||
\
|
\
|
||||||
%{verbose:set -x}%{!verbose:exec > /dev/null}\
|
%{verbose:set -x}\
|
||||||
umask 022\
|
umask 022\
|
64
rpm.spec
64
rpm.spec
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
%define rpmhome /usr/lib/rpm
|
%define rpmhome /usr/lib/rpm
|
||||||
|
|
||||||
%global rpmver 4.14.2.1
|
%global rpmver 4.14.90
|
||||||
#global snapver rc2
|
%global snapver git14653
|
||||||
%global rel 14
|
%global rel 1
|
||||||
|
|
||||||
%global srcver %{version}%{?snapver:-%{snapver}}
|
%global srcver %{version}%{?snapver:-%{snapver}}
|
||||||
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
|
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
|
||||||
@ -42,7 +42,7 @@ Source1: db-%{bdbver}.tar.gz
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Disable autoconf config.site processing (#962837)
|
# Disable autoconf config.site processing (#962837)
|
||||||
Patch1: rpm-4.11.x-siteconfig.patch
|
Patch1: rpm-4.15.x-siteconfig.patch
|
||||||
# In current Fedora, man-pages pkg owns all the localized man directories
|
# In current Fedora, man-pages pkg owns all the localized man directories
|
||||||
Patch3: rpm-4.9.90-no-man-dirs.patch
|
Patch3: rpm-4.9.90-no-man-dirs.patch
|
||||||
# Temporary band-aid for rpm2cpio whining on payload size mismatch (#1142949)
|
# Temporary band-aid for rpm2cpio whining on payload size mismatch (#1142949)
|
||||||
@ -51,25 +51,11 @@ Patch5: rpm-4.12.0-rpm2cpio-hack.patch
|
|||||||
Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
|
Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
|
||||||
|
|
||||||
# Patches already upstream:
|
# Patches already upstream:
|
||||||
Patch103: 0001-rpmfc-push-name-epoch-version-release-macro-before-i.patch
|
|
||||||
Patch104: 0001-Take-_prefix-into-account-when-compressing-man-pages.patch
|
|
||||||
Patch105: rpm-4.14.2-RPMTAG_MODULARITYLABEL.patch
|
|
||||||
Patch106: 0001-find-debuginfo.sh-Handle-position-independent-execut.patch
|
|
||||||
Patch107: 0001-Add-flag-to-use-strip-g-instead-of-full-strip-on-DSO.patch
|
|
||||||
Patch108: 0001-Detect-kernel-modules-by-.modinfo-section-presence-f.patch
|
|
||||||
Patch109: 0002-Support-build-id-generation-from-compressed-ELF-file.patch
|
|
||||||
Patch110: 0001-Use-a-pre-determined-buildhost-in-test-suite-to-avoi.patch
|
|
||||||
|
|
||||||
# Python 3 string API sanity
|
|
||||||
Patch150: 0001-In-Python-3-return-all-our-string-data-as-surrogate-.patch
|
|
||||||
Patch151: 0001-Return-NULL-string-as-None-from-utf8FromString.patch
|
|
||||||
# Temporary compat crutch, not upstream
|
|
||||||
Patch152: 0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch
|
|
||||||
|
|
||||||
# These are not yet upstream
|
# These are not yet upstream
|
||||||
Patch906: rpm-4.7.1-geode-i686.patch
|
Patch906: rpm-4.7.1-geode-i686.patch
|
||||||
# Probably to be upstreamed in slightly different form
|
# Probably to be upstreamed in slightly different form
|
||||||
Patch907: rpm-4.13.90-ldflags.patch
|
Patch907: rpm-4.15.x-ldflags.patch
|
||||||
|
|
||||||
# Partially GPL/LGPL dual-licensed and some bits with BSD
|
# Partially GPL/LGPL dual-licensed and some bits with BSD
|
||||||
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
|
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
|
||||||
@ -93,7 +79,7 @@ BuildRequires: fakechroot gnupg2
|
|||||||
|
|
||||||
# XXX generally assumed to be installed but make it explicit as rpm
|
# XXX generally assumed to be installed but make it explicit as rpm
|
||||||
# is a bit special...
|
# is a bit special...
|
||||||
BuildRequires: redhat-rpm-config
|
BuildRequires: redhat-rpm-config >= 94
|
||||||
BuildRequires: gcc make
|
BuildRequires: gcc make
|
||||||
BuildRequires: gawk
|
BuildRequires: gawk
|
||||||
BuildRequires: elfutils-devel >= 0.112
|
BuildRequires: elfutils-devel >= 0.112
|
||||||
@ -127,6 +113,7 @@ BuildRequires: automake libtool
|
|||||||
%if %{with plugins}
|
%if %{with plugins}
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
BuildRequires: dbus-devel
|
BuildRequires: dbus-devel
|
||||||
|
BuildRequires: audit-libs-devel
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with libimaevm}
|
%if %{with libimaevm}
|
||||||
@ -306,7 +293,16 @@ Requires: rpm-libs%{_isa} = %{version}-%{release}
|
|||||||
Useful on legacy SysV init systems if you run rpm transactions with
|
Useful on legacy SysV init systems if you run rpm transactions with
|
||||||
nice/ionice priorities. Should not be used on systemd systems.
|
nice/ionice priorities. Should not be used on systemd systems.
|
||||||
|
|
||||||
%endif # with plugins
|
%package plugin-audit
|
||||||
|
Summary: Rpm plugin for logging audit events on package operations
|
||||||
|
Group: System Environment/Base
|
||||||
|
Requires: rpm-libs%{_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description plugin-audit
|
||||||
|
%{summary}
|
||||||
|
|
||||||
|
# with plugins
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{srcver} %{?with_int_bdb:-a 1} -p1
|
%autosetup -n %{name}-%{srcver} %{?with_int_bdb:-a 1} -p1
|
||||||
@ -315,16 +311,8 @@ nice/ionice priorities. Should not be used on systemd systems.
|
|||||||
ln -s db-%{bdbver} db
|
ln -s db-%{bdbver} db
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Python madness: invoke python2 explicitly to avoid deprecation warnings
|
|
||||||
# breaking the testsuite and thus the build. Easier than managing a patch...
|
|
||||||
sed -ie 's:^python test:python2 test:g' tests/rpmtests tests/local.at
|
|
||||||
sed -ie 's:python -c:python2 -c:g' tests/atlocal.in
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CPPFLAGS="$CPPFLAGS -DLUA_COMPAT_APIINTCASTS"
|
%set_build_flags
|
||||||
CFLAGS="$RPM_OPT_FLAGS -DLUA_COMPAT_APIINTCASTS"
|
|
||||||
LDFLAGS="$LDFLAGS %{?build_ldflags}"
|
|
||||||
export CPPFLAGS CFLAGS LDFLAGS
|
|
||||||
|
|
||||||
autoreconf -i -f
|
autoreconf -i -f
|
||||||
|
|
||||||
@ -406,11 +394,6 @@ find $RPM_BUILD_ROOT -name "*.la"|xargs rm -f
|
|||||||
# These live in perl-generators and python-rpm-generators now
|
# These live in perl-generators and python-rpm-generators now
|
||||||
rm -f $RPM_BUILD_ROOT/%{rpmhome}/{perldeps.pl,perl.*,pythond*}
|
rm -f $RPM_BUILD_ROOT/%{rpmhome}/{perldeps.pl,perl.*,pythond*}
|
||||||
rm -f $RPM_BUILD_ROOT/%{_fileattrsdir}/{perl*,python*}
|
rm -f $RPM_BUILD_ROOT/%{_fileattrsdir}/{perl*,python*}
|
||||||
# Axe unused cruft
|
|
||||||
rm -f $RPM_BUILD_ROOT/%{rpmhome}/{tcl.req,osgideps.pl}
|
|
||||||
|
|
||||||
# Avoid unnecessary dependency on /usr/bin/python
|
|
||||||
chmod a-x $RPM_BUILD_ROOT/%{rpmhome}/python-macro-helper
|
|
||||||
|
|
||||||
%if %{with check}
|
%if %{with check}
|
||||||
%check
|
%check
|
||||||
@ -463,7 +446,6 @@ make check || (cat tests/rpmtests.log; exit 1)
|
|||||||
%{rpmhome}/rpm.supp
|
%{rpmhome}/rpm.supp
|
||||||
%{rpmhome}/rpm2cpio.sh
|
%{rpmhome}/rpm2cpio.sh
|
||||||
%{rpmhome}/tgpg
|
%{rpmhome}/tgpg
|
||||||
%{rpmhome}/python-macro-helper
|
|
||||||
|
|
||||||
%{rpmhome}/platform
|
%{rpmhome}/platform
|
||||||
|
|
||||||
@ -490,7 +472,11 @@ make check || (cat tests/rpmtests.log; exit 1)
|
|||||||
|
|
||||||
%files plugin-prioreset
|
%files plugin-prioreset
|
||||||
%{_libdir}/rpm-plugins/prioreset.so
|
%{_libdir}/rpm-plugins/prioreset.so
|
||||||
%endif # with plugins
|
|
||||||
|
%files plugin-audit
|
||||||
|
%{_libdir}/rpm-plugins/audit.so
|
||||||
|
# with plugins
|
||||||
|
%endif
|
||||||
|
|
||||||
%files build-libs
|
%files build-libs
|
||||||
%{_libdir}/librpmbuild.so.*
|
%{_libdir}/librpmbuild.so.*
|
||||||
@ -521,7 +507,6 @@ make check || (cat tests/rpmtests.log; exit 1)
|
|||||||
%{rpmhome}/*.req
|
%{rpmhome}/*.req
|
||||||
%{rpmhome}/config.*
|
%{rpmhome}/config.*
|
||||||
%{rpmhome}/mkinstalldirs
|
%{rpmhome}/mkinstalldirs
|
||||||
%{rpmhome}/macros.p*
|
|
||||||
%{rpmhome}/fileattrs/*
|
%{rpmhome}/fileattrs/*
|
||||||
|
|
||||||
%files sign
|
%files sign
|
||||||
@ -552,6 +537,9 @@ make check || (cat tests/rpmtests.log; exit 1)
|
|||||||
%doc doc/librpm/html/*
|
%doc doc/librpm/html/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 10 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.90-0.git14653.1
|
||||||
|
- Update to 4.15.0 alpha
|
||||||
|
|
||||||
* Mon Jun 10 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-14
|
* Mon Jun 10 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-14
|
||||||
- Drop support for sanitizer build, it never really worked anyway
|
- Drop support for sanitizer build, it never really worked anyway
|
||||||
- Drop leftover build-dependency on binutils-devel
|
- Drop leftover build-dependency on binutils-devel
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (rpm-4.14.2.1.tar.bz2) = 0aad457f91918904c15649a1764ce7cbfaf38e083678031286e866f7997be0435a6b7b73596706d97e9263cff7b4df4a3150b142d81e6e3fddbfcf67bd83f990
|
SHA512 (rpm-4.14.90-git14653.tar.bz2) = 4c4051c405378ace00704991ab4204e59a7ca05a5b24d6f630244d8a27cb02aa5b51b7d029ca1f65e6795ca0f8a0da919ac07b103f0ec0dec23771b11c9d1c2a
|
||||||
|
Loading…
Reference in New Issue
Block a user