Accepting request 1223366 from home:michals

- Bump debugedit version (bsc#1233156)

OBS-URL: https://build.opensuse.org/request/show/1223366
OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=674
This commit is contained in:
Michael Schröder 2024-11-12 10:16:55 +00:00 committed by Git OBS Bridge
commit 093b7580da
62 changed files with 8824 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,122 @@
From fc04a1bde1941d2c61a9e33e55c5c492327674ba Mon Sep 17 00:00:00 2001
From: Jan Zerebecki <jan.suse@zerebecki.de>
Date: Thu, 15 Feb 2024 09:57:35 +0100
Subject: [PATCH 1/3] Add option to set mtime of files in rpms
to SOURCE_DATE_EPOCH.
For backwards compatibility the option clamp / limit the maximum mtime
is retained.
Setting it ouright avoids problems with an incorrectly older clock. It
also avoids problems with build scrips that incorrectly change file
mtimes when SOURCE_DATE_EPOCH_MTIME is in use.
mtimes are required to increase with new versions and releases
of an rpm with the same name, as rsync without --checksum and similar
tools would get confused if the content changes without newer mtime.
If SOURCE_DATE_EPOCH_MTIME is set use it instead for file modification time
stamps. It is supposed to be newer. This can be used if we might want to
compare if the file content remains the same when a build dependency
changes while a build script embeds SOURCE_DATE_EPOCH in the file
content.
This can be used to support automatic rebuilds. Normally automatic
rebuilds work, but together with reproducible builds an undesirable
situation may occur. If a build e.g. embeds SOURCE_DATE_EPOCH in the
output, then the output changes every time such a rebuild happens, which
can be very often. This is to be avoided as updating packages without
necessity is too expensive.
---
build/files.c | 33 ++++++++++++++++++++++++++++-----
docs/manual/buildprocess.md | 5 +++--
2 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/build/files.c b/build/files.c
index c403c806e..cec7999ca 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1033,14 +1033,34 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
rpm_loff_t totalFileSize = 0;
Header h = pkg->header; /* just a shortcut */
int override_date = 0;
+ int set_mtime = 0;
time_t source_date_epoch = 0;
char *srcdate = getenv("SOURCE_DATE_EPOCH");
+ char *msrcdate = getenv("SOURCE_DATE_EPOCH_MTIME");
- /* Limit the maximum date to SOURCE_DATE_EPOCH if defined
- * similar to the tar --clamp-mtime option
+ /* If SOURCE_DATE_EPOCH_MTIME is set use it for file modification time
+ * stamps, it is supposed to be newer. This can be used if we might want to
+ * compare if the file content remains the same when a build dependency
+ * changes while a build script embeds SOURCE_DATE_EPOCH in the file
+ * content. mtimes are required to increase with new versions and releases
+ * of an rpm with the same name, as rsync without --checksum and similar
+ * tools would get confused if the content changes without newer mtime. */
+ if (msrcdate != NULL) {
+ srcdate = msrcdate;
+ }
+
+ /* Set the file mtime to SOURCE_DATE_EPOCH it if requested to make the
+ * resulting rpm reproducible.
* https://reproducible-builds.org/specs/source-date-epoch/
+ *
+ * For backwards compatibility clamp / limit the maximum mtime if requested
+ * similar the tar --clamp-mtime option. Setting it ouright avoids problems
+ * with an incorrectly older clock. It also avoids problems with build
+ * scrips that incorrectly change file mtimes when SOURCE_DATE_EPOCH_MTIME
+ * is in use.
*/
- if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) {
+ if (srcdate && (rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")
+ || rpmExpandNumeric("%{?set_mtime_to_source_date_epoch}"))) {
char *endptr;
errno = 0;
source_date_epoch = strtol(srcdate, &endptr, 10);
@@ -1049,6 +1069,9 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
fl->processingFailed = 1;
}
override_date = 1;
+ if (rpmExpandNumeric("%{?set_mtime_to_source_date_epoch}")) {
+ set_mtime = 1;
+ }
}
/*
@@ -1191,8 +1214,8 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
totalFileSize += flp->fl_size;
}
}
-
- if (override_date && flp->fl_mtime > source_date_epoch) {
+
+ if (override_date && (flp->fl_mtime > source_date_epoch || set_mtime)) {
flp->fl_mtime = source_date_epoch;
}
/*
diff --git a/docs/manual/buildprocess.md b/docs/manual/buildprocess.md
index 1ceb47a7e..64cd35626 100644
--- a/docs/manual/buildprocess.md
+++ b/docs/manual/buildprocess.md
@@ -94,13 +94,14 @@ Macro name | Description
`%_build_pkgcheck` | Progam to run on each generated binary package
`%_build_pkcheck_set` | Program to run on the generated binary package set
-### Reproducability
+### Reproducibility
Macro name | Description
--------------------------------------|-----------
`%source_date_epoch_from_changelog` | Set `SOURCE_DATE_EPOCH` from latest `%changelog` entry
`%use_source_date_epoch_as_buildtime` | Set package BuildTime to `SOURCE_DATE_EPOCH`
-`%clamp_mtime_to_source_date_epoch` | Ensure file timestamps are not newer than `SOURCE_DATE_EPOCH`
+`%set_mtime_to_source_date_epoch` | Set file modification timestamps to `SOURCE_DATE_EPOCH_MTIME` or as fallback to `SOURCE_DATE_EPOCH`
+`%clamp_mtime_to_source_date_epoch` | You should use the above instead, it is for backwards compatibility only. Ensure file timestamps are not newer than `SOURCE_DATE_EPOCH`
### Vendor defaults
--
2.30.2

View File

@ -0,0 +1,29 @@
From e0a8b84f68993fccbe70c4fb1cd8402fa7371147 Mon Sep 17 00:00:00 2001
From: Jan Zerebecki <jan.suse@zerebecki.de>
Date: Thu, 15 Feb 2024 07:58:44 +0100
Subject: [PATCH 2/3] log build time if it is set from SOURCE_DATE_EPOCH
---
build/build.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/build/build.c b/build/build.c
index f2cf98c8b..2693d80b3 100644
--- a/build/build.c
+++ b/build/build.c
@@ -35,8 +35,11 @@ static rpm_time_t getBuildTime(void)
epoch = strtol(srcdate, &endptr, 10);
if (srcdate == endptr || *endptr || errno != 0)
rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
- else
+ else {
buildTime = (uint32_t) epoch;
+ rpmlog(RPMLOG_NOTICE, _("using %s with value %ld as build time\n"),
+ "SOURCE_DATE_EPOCH", buildTime);
+ }
} else
buildTime = (uint32_t) time(NULL);
--
2.30.2

View File

@ -0,0 +1,30 @@
From 973f94bafea8e641ed747d3c420ea1bc2e1cb37f Mon Sep 17 00:00:00 2001
From: Jan Zerebecki <jan.suse@zerebecki.de>
Date: Thu, 15 Feb 2024 08:03:05 +0100
Subject: [PATCH 3/3] Error out on a missing changelog date
if it is needed as the source for SOURCE_DATE_EPOCH, instead of only
logging a warning.
---
build/build.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build/build.c b/build/build.c
index 2693d80b3..ce7bc8b88 100644
--- a/build/build.c
+++ b/build/build.c
@@ -344,8 +344,10 @@ static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
setenv("SOURCE_DATE_EPOCH", sdestr, 0);
rpmtdFreeData(&td);
} else {
- rpmlog(RPMLOG_WARNING, _("source_date_epoch_from_changelog set but "
+ rpmlog(RPMLOG_ERR, _("source_date_epoch_from_changelog set but "
"%%changelog is missing\n"));
+ rc = RPMRC_FAIL;
+ goto exit;
}
}
--
2.30.2

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<flavor>python-rpm</flavor>
</multibuild>

27
assumeexec.diff Normal file
View File

@ -0,0 +1,27 @@
--- tools/elfdeps.c.orig 2014-06-26 06:51:55.768815677 +0000
+++ tools/elfdeps.c 2014-08-04 13:02:16.981081591 +0000
@@ -17,6 +17,7 @@ int soname_only = 0;
int fake_soname = 1;
int filter_soname = 1;
int require_interp = 0;
+int assume_exec = 0;
typedef struct elfInfo_s {
Elf *elf;
@@ -299,7 +300,7 @@ static int processFile(const char *fn, i
if (ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC) {
ei->marker = mkmarker(ehdr);
ei->isDSO = (ehdr->e_type == ET_DYN);
- ei->isExec = (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
+ ei->isExec = assume_exec || (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
processProgHeaders(ei, ehdr);
processSections(ei);
@@ -364,6 +365,7 @@ int main(int argc, char *argv[])
{ "no-fake-soname", 0, POPT_ARG_VAL, &fake_soname, 0, NULL, NULL },
{ "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL },
{ "require-interp", 0, POPT_ARG_VAL, &require_interp, -1, NULL, NULL },
+ { "assume-exec", 0, POPT_ARG_VAL, &assume_exec, -1, NULL, NULL },
POPT_AUTOHELP
POPT_TABLEEND
};

View File

@ -0,0 +1,36 @@
Index: build/parseSpec.c
===================================================================
--- build/parseSpec.c.orig
+++ build/parseSpec.c
@@ -942,7 +942,30 @@ static rpmSpec parseSpec(const char *spe
&(spec->buildrequires));
break;
case PART_BUILD:
- parsePart = parseSimpleScript(spec, "%build", &(spec->build));
+ if (spec->build) {
+ rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), spec->lineNum, "%build");
+ parsePart = PART_ERROR;
+ break;
+ }
+ spec->build = newStringBuf();
+ appendLineStringBuf(spec->build,
+ "ref=/usr/lib/rpm\n"
+ "mints=0\n"
+ "case $(uname -m) in\n"
+ " aarch64) mints=20120610;;\n"
+ " ppc64le) mints=20130610;;\n"
+ " riscv64) mints=20160911;;\n"
+ "esac\n"
+ "for s in guess sub; do\n"
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
+ " grep -q config-patches@ $c || continue\n"
+ " timestamp=$(sed -n \"/^timestamp=/{s///;s/[-'\\\"]//g;p;q;}\" $c)\n"
+ " test -n \"$timestamp\" || timestamp=0\n"
+ " test $timestamp -ge $mints || install -m 755 $ref/config.$s $c\n"
+ " done\n"
+ "done\n"
+ );
+ parsePart = parseLines(spec, STRIP_NOTHING, NULL, &(spec->build));
break;
case PART_INSTALL:
parsePart = parseSimpleScript(spec, "%install", &(spec->install));

3
baselibs.conf Normal file
View File

@ -0,0 +1,3 @@
rpm
arch ppc package rpm-devel
arch sparcv9 package rpm-devel

11
brp-compress-no-img.patch Normal file
View File

@ -0,0 +1,11 @@
--- scripts/brp-compress.orig 2022-12-02 13:18:54.498881077 +0000
+++ scripts/brp-compress 2022-12-02 13:20:00.038727777 +0000
@@ -52,6 +52,8 @@ do
while IFS= read -r -d '' f; do
[ -f "$f" ] || continue
+ case $(file "$f") in *"image data"*) continue;; esac
+
case "$f" in
*.gz|*.Z) gunzip -f "$f" || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.\(gz\|Z\)$//'`;;
*.bz2) bunzip2 -f "$f" || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.bz2$//'`;;

21
brp.diff Normal file
View File

@ -0,0 +1,21 @@
--- scripts/brp-strip-comment-note.orig 2023-09-19 10:10:10.000000000 +0000
+++ scripts/brp-strip-comment-note 2023-10-09 12:22:27.504732553 +0000
@@ -15,7 +15,7 @@ esac
# Strip .comment and .note sections (the latter only if it is not allocated)
# for already stripped elf files in the build root
-for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -print0 | xargs -0 -r -P$NCPUS -n32 sh -c "file \"\\$@\" | grep -v \"^${RPM_BUILD_ROOT}/\?usr/lib/debug\" | sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'" ARG0`; do
+for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -print0 | xargs -0 -r -P$NCPUS -n32 sh -c "file \"\\$@\" | grep -v \"^${RPM_BUILD_ROOT}/\?usr/lib/debug\" | grep -v ' shared object,' | grep -v '/lib/modules/' | sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'" ARG0`; do
note="-R .note"
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
grep ALLOC >/dev/null; then
--- scripts/brp-strip.orig 2023-09-19 10:10:10.000000000 +0000
+++ scripts/brp-strip 2023-10-09 12:24:36.920521652 +0000
@@ -35,6 +35,7 @@ strip_elf_binaries()
! -regex "${RPM_BUILD_ROOT}/*usr/lib/debug.*" \
! -name "*.go" -links "${nlinks}" -print0 | \
xargs -0 -r -P${nprocs} -n${MAX_ARGS} sh -c "file \"\$@\" | \
+ grep -v ' shared object,' | grep -v '/lib/modules/ | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p' | \
grep -v 'no machine' | \
xargs -I\{\} $STRIP -g \{\}" ARG0

80
brpcompress.diff Normal file
View File

@ -0,0 +1,80 @@
--- scripts/brp-compress.orig 2022-04-07 11:13:19.072518377 +0000
+++ scripts/brp-compress 2022-12-02 13:12:31.239774558 +0000
@@ -5,6 +5,9 @@ if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_B
exit 0
fi
+LC_ALL=
+LANG=
+LC_TIME=POSIX
PREFIX=${1:-/usr}
cd "$RPM_BUILD_ROOT"
@@ -13,6 +16,30 @@ cd "$RPM_BUILD_ROOT"
COMPRESS=${COMPRESS:-gzip -9 -n}
COMPRESS_EXT=${COMPRESS_EXT:-.gz}
+check_for_hard_link()
+{
+ dir=$1
+ b=$2
+
+ inode=`ls -i $b | awk '{ print $1 }'`
+ others=`find $dir -type f -inum $inode`
+ for afile in $others ; do
+ [ "$afile" != "$b" ] && rm -f "$afile"
+ done
+
+ case $b in
+ *.Z|*.gz) gunzip $b ;;
+ *.bz2) bunzip2 $b ;;
+ *.xz|*.lzma) unxz $b ;;
+ *.zst|*.zstd) unzstd --rm $b ;;
+ esac
+
+ type=${b##*.}
+ for afile in $others ; do
+ [ "${afile%.$type}" != "${b%.$type}" ] && ln ${b%.$type} ${afile%.$type}
+ done
+}
+
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 \
@@ -26,10 +53,10 @@ do
[ -f "$f" ] || continue
case "$f" in
- *.gz|*.Z) gunzip -f "$f"; b=`echo "$f" | sed -e 's/\.\(gz\|Z\)$//'`;;
- *.bz2) bunzip2 -f "$f"; b=`echo "$f" | sed -e 's/\.bz2$//'`;;
- *.xz|*.lzma) unxz -f "$f"; b=`echo "$f" | sed -e 's/\.\(xz\|lzma\)$//'`;;
- *.zst|*.zstd) unzstd -f --rm $f; b=`echo "$f" | sed -e 's/\.\(zst\|zstd\)$//'`;;
+ *.gz|*.Z) gunzip -f "$f" || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.\(gz\|Z\)$//'`;;
+ *.bz2) bunzip2 -f "$f" || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.bz2$//'`;;
+ *.xz|*.lzma) unxz -f "$f" || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.\(xz\|lzma\)$//'`;;
+ *.zst|*.zstd) unzstd -f --rm $f || check_for_hard_link $d "$f"; b=`echo "$f" | sed -e 's/\.\(zst\|zstd\)$//'`;;
*) b="$f";;
esac
@@ -38,7 +65,7 @@ do
others="`find $d -type f -inum $inode`"
if [ -n "$others" ]; then
for afile in $others ; do
- [ "$afile" != "$b" ] && rm -f $afile
+ [ "$afile" != "$b" ] && rm -f "$afile"
done
$COMPRESS -f "$b"
for afile in $others ; do
@@ -52,9 +79,9 @@ do
find $d -type l -print0 |
while IFS= read -r -d '' f; do
- l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\|zst\|zstd\)$//'`
- rm -f $f
- b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\|zst\|zstd\)$//'`
+ l=`ls -l "$f" | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\|zst\|zstd\)$//'`
+ rm -f "$f"
+ b=`echo "$f" | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\|zst\|zstd\)$//'`
ln -sf "$l$COMPRESS_EXT" "$b$COMPRESS_EXT"
done
done

3
build-aux.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69ead89491a66ae6c1a960977b7cc567e56f74d535a022fc193334d78be838f1
size 21222

14
build.diff Normal file
View File

@ -0,0 +1,14 @@
--- installplatform.orig 2023-09-19 10:10:10.000000000 +0000
+++ installplatform 2023-10-09 12:56:44.709209329 +0000
@@ -210,6 +210,11 @@ for ARCH in noarch `grep ^arch_canon $RP
PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
[ -d $PPD ] || mkdir -p $PPD
+ if [ "$VENDOR" = suse ] ; then
+ # suse doesn't do colors
+ CANONCOLOR=0
+ fi
+
cat $PLATFORM \
| sed -e "s,=RPMRC_OPTFLAGS=,$RPMRC_OPTFLAGS," \
-e "s,=RPMCANONARCH=,$CANONARCH,g" \

32
canongnu.diff Normal file
View File

@ -0,0 +1,32 @@
--- CMakeLists.txt.orig 2024-02-07 09:57:31.944781372 +0000
+++ CMakeLists.txt 2024-02-07 09:57:51.924739495 +0000
@@ -138,14 +138,26 @@ function(makemacros)
list(GET db_backends 0 DB_BACKEND)
- set(host_cpu ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ if (RPM_HOST_SYSTEM_CPU)
+ set(host_cpu ${RPM_HOST_SYSTEM_CPU})
+ else()
+ set(host_cpu ${CMAKE_HOST_SYSTEM_PROCESSOR})
+ endif()
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} host_os)
set(host_vendor ${RPM_VENDOR})
- set(host ${host_cpu}-${host_vendor}-${host_os})
+ if (RPM_HOST_SYSTEM_ABI)
+ set(host ${host_cpu}-${host_vendor}-${host_os}-${RPM_HOST_SYSTEM_ABI})
+ else()
+ set(host ${host_cpu}-${host_vendor}-${host_os})
+ endif()
set(RPMCANONVENDOR ${host_vendor})
set(RPMCANONOS ${host_os})
- set(RPMCANONGNU -gnu)
+ if (RPM_HOST_SYSTEM_ABI)
+ set(RPMCANONGNU -${RPM_HOST_SYSTEM_ABI})
+ else()
+ set(RPMCANONGNU -gnu)
+ endif()
if (ENABLE_CUTF8)
set(C_LOCALE "C.UTF-8")

12
checkfilesnoinfodir.diff Normal file
View File

@ -0,0 +1,12 @@
Exclude /usr/share/info/dir from check-files. Probably only
interesting for SUSE.
--- scripts/check-files.orig 2020-09-30 12:36:56.398762048 +0000
+++ scripts/check-files 2020-09-30 12:41:15.294176572 +0000
@@ -28,5 +28,5 @@ trap "rm -f \"${FILES_DISK}\"" 0 2 3 5 1
# Find non-directory files in the build root and compare to the manifest.
# TODO: regex chars in last sed(1) expression should be escaped
find "${RPM_BUILD_ROOT}" -type f -o -type l | LC_ALL=C sort > "${FILES_DISK}"
-LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n 's!^\(-\|< \)'"${RPM_BUILD_ROOT}"'\(.*\)$! \2!gp'
+LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n -e 's!^\(-\|< \)'"${RPM_BUILD_ROOT}"'/usr/share/info/dir$!!' -e 's!^\(-\|< \)'"${RPM_BUILD_ROOT}"'\(.*\)$! \2!gp'

68
checksepwarn.diff Normal file
View File

@ -0,0 +1,68 @@
--- build/parseReqs.c.orig 2019-06-26 14:17:31.396985719 +0000
+++ build/parseReqs.c 2019-10-02 12:10:51.879570016 +0000
@@ -42,7 +42,7 @@ static rpmRC checkEpoch(const char *s, c
return RPMRC_OK;
}
-static rpmRC checkDep(rpmSpec spec, char *N, char *EVR, char **emsg)
+static rpmRC checkDep(rpmSpec spec, rpmsenseFlags tagflags, char *N, char *EVR, char **emsg)
{
/*
* Tokens must begin with alphanumeric, _, or /, but we don't know
@@ -65,6 +65,11 @@ static rpmRC checkDep(rpmSpec spec, char
if (rpmExpandNumeric("%{?_wrong_version_format_terminate_build}"))
return RPMRC_FAIL;
+ if (tagflags & (RPMSENSE_FIND_REQUIRES|RPMSENSE_FIND_PROVIDES))
+ rpmlog(RPMLOG_WARNING, "%s\n", *emsg);
+ else
+ rpmlog(RPMLOG_WARNING, _("line %d: %s: %s\n"), spec->lineNum, *emsg, spec->line);
+ *emsg = _free(*emsg);
}
}
return RPMRC_OK;
@@ -72,6 +77,7 @@ static rpmRC checkDep(rpmSpec spec, char
struct parseRCPOTRichData {
rpmSpec spec;
+ rpmsenseFlags tagflags;
StringBuf sb;
};
@@ -109,7 +115,7 @@ static rpmRC parseRCPOTRichCB(void *cbda
appendStringBuf(sb, rel);
appendStringBuf(sb, EVR);
}
- rc = checkDep(data->spec, N, EVR, emsg);
+ rc = checkDep(data->spec, data->tagflags, N, EVR, emsg);
_free(N);
_free(EVR);
} else if (type == RPMRICH_PARSE_OP) {
@@ -223,6 +229,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
goto exit;
}
data.spec = spec;
+ data.tagflags = tagflags;
data.sb = newStringBuf();
if (rpmrichParseForTag(&r, &emsg, parseRCPOTRichCB, &data, nametag) != RPMRC_OK) {
freeStringBuf(data.sb);
@@ -274,7 +281,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
}
/* check that dependency is well-formed */
- if (checkDep(spec, N, EVR, &emsg))
+ if (checkDep(spec, tagflags, N, EVR, &emsg))
goto exit;
if (nametag == RPMTAG_OBSOLETENAME) {
--- macros.in.orig 2019-10-02 12:10:45.431583601 +0000
+++ macros.in 2019-10-02 12:10:51.879570016 +0000
@@ -452,7 +452,7 @@ package or when debugging this package.\
%_invalid_encoding_terminates_build 1
# Should invalid version format in requires, provides, ... terminate a build?
-%_wrong_version_format_terminate_build 1
+%_wrong_version_format_terminate_build 0
#
# Should rpm try to download missing sources at build-time?

15
cmake_python_version.diff Normal file
View File

@ -0,0 +1,15 @@
--- CMakeLists.txt.orig 2024-02-01 13:24:18.665660569 +0000
+++ CMakeLists.txt 2024-02-01 13:25:07.917586376 +0000
@@ -238,7 +238,11 @@ endif()
list(APPEND db_backends dummy)
if (ENABLE_PYTHON)
- find_package(Python3 3.2 COMPONENTS Interpreter Development REQUIRED)
+ if (WITH_PYTHON_VERSION)
+ find_package(Python3 ${WITH_PYTHON_VERSION} EXACT COMPONENTS Interpreter Development REQUIRED)
+ else()
+ find_package(Python3 3.2 COMPONENTS Interpreter Development REQUIRED)
+ endif()
endif()
if (WITH_CAP)

169
db_conversion.diff Normal file
View File

@ -0,0 +1,169 @@
--- lib/backend/bdb_ro.c.orig 2022-04-07 11:13:18.994517848 +0000
+++ lib/backend/bdb_ro.c 2022-12-02 13:22:16.726408071 +0000
@@ -793,6 +793,7 @@ static unsigned int bdbro_pkgdbKey(dbiIn
struct rpmdbOps_s bdbro_dbops = {
.name = "bdb_ro",
.path = "Packages",
+ .readonly = 1,
.open = bdbro_Open,
.close = bdbro_Close,
--- lib/backend/dbi.c.orig 2022-04-07 11:13:18.994517848 +0000
+++ lib/backend/dbi.c 2022-12-02 13:22:16.726408071 +0000
@@ -138,11 +138,20 @@ exit:
}
rdb->db_descr = rdb->db_ops->name;
+ rdb->db_ops_config = cfg;
if (db_backend)
free(db_backend);
}
+int dbiNeedConversion(rpmdb rdb)
+{
+ if (!rdb->db_ops)
+ dbDetectBackend(rdb);
+ return rdb->db_ops->readonly && rdb->db_ops_config
+ && rdb->db_ops_config->path && !rdb->db_ops_config->readonly;
+}
+
const char * dbiName(dbiIndex dbi)
{
return dbi->dbi_file;
--- lib/backend/dbi.h.orig 2022-04-07 11:13:18.994517848 +0000
+++ lib/backend/dbi.h 2022-12-02 13:22:16.726408071 +0000
@@ -13,6 +13,7 @@ enum rpmdbFlags {
RPMDB_FLAG_REBUILD = (1 << 1),
RPMDB_FLAG_VERIFYONLY = (1 << 2),
RPMDB_FLAG_SALVAGE = (1 << 3),
+ RPMDB_FLAG_CONVERT = (1 << 4),
};
typedef enum dbCtrlOp_e {
@@ -53,6 +54,7 @@ struct rpmdb_s {
int db_buildindex; /*!< Index rebuild indicator */
const struct rpmdbOps_s * db_ops; /*!< backend ops */
+ const struct rpmdbOps_s * db_ops_config; /*!< configured backend ops */
/* dbenv and related parameters */
void * db_dbenv; /*!< Backend private handle */
@@ -197,6 +199,14 @@ RPM_GNUC_INTERNAL
const char * dbiName(dbiIndex dbi);
/** \ingroup dbi
+ * Check if the database needs to be converted to a different format
+ * @param db rpm database
+ * @return boolean
+ */
+RPM_GNUC_INTERNAL
+int dbiNeedConversion(rpmdb rdb);
+
+/** \ingroup dbi
* Open a database cursor.
* @param dbi index database handle
* @param flags DBC_WRITE if writing, or 0 (DBC_READ) for reading
@@ -240,6 +250,7 @@ const void * idxdbKey(dbiIndex dbi, dbiC
struct rpmdbOps_s {
const char *name; /* backend name */
const char *path; /* main database name */
+ int readonly; /* cannot modify database */
int (*open)(rpmdb rdb, rpmDbiTagVal rpmtag, dbiIndex * dbip, int flags);
int (*close)(dbiIndex dbi, unsigned int flags);
--- lib/backend/ndb/rpmpkg.c.orig 2022-04-07 11:13:18.997517869 +0000
+++ lib/backend/ndb/rpmpkg.c 2022-12-02 13:22:16.726408071 +0000
@@ -1116,11 +1116,12 @@ static int rpmpkgPutInternal(rpmpkgdb pk
if (rpmpkgWriteBlob(pkgdb, pkgidx, blkoff, blkcnt, blob, blobl, pkgdb->generation)) {
return RPMRC_FAIL;
}
+ /* update nextpkgidx if needed */
+ if (pkgidx >= pkgdb->nextpkgidx) {
+ pkgdb->nextpkgidx = pkgidx + 1;
+ }
/* write slot */
slotno = oldslot ? oldslot->slotno : pkgdb->freeslot;
- if (!slotno) {
- return RPMRC_FAIL;
- }
if (rpmpkgWriteslot(pkgdb, slotno, pkgidx, blkoff, blkcnt)) {
free(pkgdb->slots);
pkgdb->slots = 0;
--- lib/rpmdb.c.orig 2022-09-20 12:08:27.197920294 +0000
+++ lib/rpmdb.c 2022-12-02 13:24:02.830159868 +0000
@@ -469,7 +469,12 @@ static int openDatabase(const char * pre
/* Open just bare minimum when rebuilding a potentially damaged db */
int justPkgs = (db->db_flags & RPMDB_FLAG_REBUILD) &&
((db->db_mode & O_ACCMODE) == O_RDONLY);
- rc = doOpen(db, justPkgs);
+ if (!db->db_pkgs && !justCheck && (mode & O_ACCMODE) == O_RDWR && dbiNeedConversion(db)) {
+ rc = rpmdbRebuild(prefix, NULL, NULL, RPMDB_REBUILD_FLAG_CONVERT);
+ db->db_ops = NULL; /* force re-detection of backend */
+ }
+ if (!rc)
+ rc = doOpen(db, justPkgs);
if (!db->db_descr)
db->db_descr = "unknown db";
@@ -2228,6 +2233,15 @@ int rpmdbAdd(rpmdb db, Header h)
if (db == NULL)
return 0;
+ if ((db->db_flags & RPMDB_FLAG_CONVERT) != 0) {
+ /* keep old instance numbers when converting */
+ hdrNum = headerGetInstance(h);
+ if (hdrNum == 0) {
+ ret = -1;
+ goto exit;
+ }
+ }
+
hdrBlob = headerExport(h, &hdrLen);
if (hdrBlob == NULL || hdrLen == 0) {
ret = -1;
@@ -2423,7 +2437,22 @@ int rpmdbRebuild(const char * prefix, rp
}
rootdbpath = rpmGetPath(prefix, dbpath, NULL);
- newdbpath = rpmGetPath("%{?_dbpath_rebuild}", NULL);
+ if ((rebuildflags & RPMDB_REBUILD_FLAG_CONVERT) != 0) {
+ char lbuf[PATH_MAX];
+ ssize_t s = readlink(rootdbpath, lbuf, PATH_MAX);
+ if (s > 0 && s < PATH_MAX) {
+ lbuf[s] = 0;
+ free(dbpath);
+ if (lbuf[0] == '/')
+ dbpath = strdup(lbuf);
+ else
+ dbpath = rpmGetPath("%{?_dbpath}", "/../", lbuf, NULL);
+ free(rootdbpath);
+ rootdbpath = rpmGetPath(prefix, dbpath, NULL);
+ }
+ newdbpath = strdup("");
+ } else
+ newdbpath = rpmGetPath("%{?_dbpath_rebuild}", NULL);
if (rstreq(newdbpath, "") || rstreq(newdbpath, dbpath)) {
newdbpath = _free(newdbpath);
rasprintf(&newdbpath, "%srebuilddb.%d", dbpath, (int) getpid());
@@ -2449,7 +2478,9 @@ int rpmdbRebuild(const char * prefix, rp
goto exit;
}
if (openDatabase(prefix, newdbpath, &newdb,
- (O_RDWR | O_CREAT), 0644, RPMDB_FLAG_REBUILD)) {
+ (O_RDWR | O_CREAT), 0644, RPMDB_FLAG_REBUILD |
+ (rebuildflags & RPMDB_REBUILD_FLAG_CONVERT ?
+ RPMDB_FLAG_CONVERT : 0))) {
rc = 1;
goto exit;
}
--- lib/rpmdb_internal.h.orig 2022-04-07 11:13:19.014517984 +0000
+++ lib/rpmdb_internal.h 2022-12-02 13:22:16.726408071 +0000
@@ -25,6 +25,7 @@ extern "C" {
enum rpmdbRebuildFlags_e {
RPMDB_REBUILD_FLAG_SALVAGE = (1 << 0),
+ RPMDB_REBUILD_FLAG_CONVERT = (1 << 1),
};
/** \ingroup rpmdb

11
emptymanifest.diff Normal file
View File

@ -0,0 +1,11 @@
--- macros.in.orig 2017-01-20 10:15:12.677868723 +0000
+++ macros.in 2017-01-20 10:15:30.385819715 +0000
@@ -403,7 +403,7 @@ package or when debugging this package.\
# Should empty %files manifest file terminate a build?
#
# Note: The default value should be 0 for legacy compatibility.
-%_empty_manifest_terminate_build 1
+%_empty_manifest_terminate_build 0
#
# Should binaries in noarch packages terminate a build?

View File

@ -0,0 +1,34 @@
--- lib/rpmscript.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/rpmscript.c 2023-10-09 13:10:38.011654503 +0000
@@ -463,7 +463,7 @@ rpmRC rpmScriptRun(rpmScript script, int
if (script == NULL) return RPMRC_OK;
ARGV_t args = NULL;
- rpmlogLvl lvl = (script->flags & RPMSCRIPT_FLAG_CRITICAL) ?
+ rpmlogLvl lvl = (rpmScriptFlags(script) & RPMSCRIPT_FLAG_CRITICAL) ?
RPMLOG_ERR : RPMLOG_WARNING;
rpmRC rc;
int script_type = RPMSCRIPTLET_FORK | RPMSCRIPTLET_EXEC;
@@ -723,5 +723,8 @@ rpmscriptTypes rpmScriptType(rpmScript s
rpmscriptFlags rpmScriptFlags(rpmScript script)
{
- return (script != NULL) ? script->flags : 0;
+ rpmscriptFlags flags = (script != NULL) ? script->flags : 0;
+ if (script && script->tag == RPMTAG_POSTIN && rpmExpandNumeric("%{_fail_on_postinstall_errors}"))
+ flags |= RPMSCRIPT_FLAG_CRITICAL;
+ return flags;
}
--- macros.in.orig 2023-10-09 13:10:35.043659922 +0000
+++ macros.in 2023-10-09 13:10:38.015654495 +0000
@@ -1377,5 +1377,10 @@ end
end
}
+# Should errors in %post scriptlet be propagated as errors?
+#
+# Note: set to 1 for legacy compatibility.
+%_fail_on_postinstall_errors 0
+
# \endverbatim
#*/

26
fileattrs.diff Normal file
View File

@ -0,0 +1,26 @@
--- fileattrs/elf.attr.orig 2023-09-19 10:10:10.000000000 +0000
+++ fileattrs/elf.attr 2023-10-09 13:07:09.252042587 +0000
@@ -1,4 +1,4 @@
%__elf_provides %{_rpmconfigdir}/elfdeps --provides
%__elf_requires %{_rpmconfigdir}/elfdeps --requires
%__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$
-%__elf_exclude_path ^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$
+%__elf_exclude_path (^/usr/lib/debug/)|(^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$)
--- fileattrs/perl.attr.orig 2023-09-19 10:10:10.000000000 +0000
+++ fileattrs/perl.attr 2023-10-09 12:58:36.893003334 +0000
@@ -1,3 +1,4 @@
-%__perl_requires %{_rpmconfigdir}/perl.req
+# disabled for now
+#%__perl_requires %{_rpmconfigdir}/perl.req
%__perl_magic ^.*[Pp]erl .*$
%__perl_flags exeonly
--- fileattrs/perllib.attr.orig 2023-09-19 10:10:10.000000000 +0000
+++ fileattrs/perllib.attr 2023-10-09 12:58:36.893003334 +0000
@@ -1,5 +1,6 @@
%__perllib_provides %{_rpmconfigdir}/perl.prov
-%__perllib_requires %{_rpmconfigdir}/perl.req
+#disabled for now
+#%__perllib_requires %{_rpmconfigdir}/perl.req
%__perllib_magic ^Perl[[:digit:]] module source.*
%__perllib_path \\.pm$
%__perllib_flags magic_and_path

13
find-lang-qt-qm.patch Normal file
View File

@ -0,0 +1,13 @@
--- scripts/find-lang.sh.orig 2021-09-23 19:57:49.046595975 +0000
+++ scripts/find-lang.sh 2021-09-23 19:59:36.182374732 +0000
@@ -305,7 +305,9 @@ s:%lang(C) ::
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$QT"'s:\(.*/'"$NAME"'_\([a-zA-Z]\+\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:\(.*/locale/\)\([^/]\+\)\(/.\+/\)\([^/]\+_qt\.qm$\):%lang(\2) \1\2\3\4:
+'"$NO_ALL_NAME$QT"'s:\(.*/locale/\)\([^/]\+\)\(/.\+/\)\('"$NAME"'_qt\.qm$\):%lang(\2) \1\2\3\4:
+'"$NO_ALL_NAME$QT"'s:^\([^%].*/'"$NAME"'_\([a-zA-Z]\+\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\+[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\+\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/_]\+_\([a-zA-Z]\+[_@].*\)\.qm$\):%lang(\2) \1:

215
findlang.diff Normal file
View File

@ -0,0 +1,215 @@
--- scripts/find-lang.sh.orig 2023-09-19 10:10:10.000000000 +0000
+++ scripts/find-lang.sh 2023-10-09 12:32:44.303726903 +0000
@@ -37,11 +37,11 @@ the top of the tree containing the files
PACKAGE_NAME is the %{name} of the package. This should also be
the basename of the .mo files. the output is written to
PACKAGE_NAME.lang unless \$3 is given in which case output is written
-to \$3.
+to \$3 (note that \$3 is appended to if given).
Additional options:
- --with-gnome find GNOME help files
+ --without-gnome do not find GNOME help files
--with-mate find MATE help files
- --with-kde find KDE help files
+ --without-kde do not find KDE help files
--with-qt find Qt translation files
--with-html find HTML files
--with-man find localized man pages
@@ -66,9 +66,9 @@ else NAMES[0]=$1
fi
shift
-GNOME=#
+GNOME=
MATE=#
-KDE=#
+KDE=
QT=#
MAN=#
HTML=#
@@ -91,6 +91,14 @@ while test $# -gt 0 ; do
KDE=
shift
;;
+ --without-gnome )
+ GNOME=#
+ shift
+ ;;
+ --without-kde )
+ KDE=#
+ shift
+ ;;
--with-qt )
QT=
shift
@@ -124,11 +132,13 @@ while test $# -gt 0 ; do
shift
;;
esac
-done
+done
-if [ -f $MO_NAME ]; then
- rm $MO_NAME
+if ! test -s $MO_NAME ; then
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
fi
+MO_NAME_NEW=$MO_NAME.tmp.$$
+rm -f $MO_NAME_NEW
for NAME in ${NAMES[@]}; do
@@ -138,7 +148,7 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
@@ -146,27 +156,27 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f|sed '
s:'"$TOP_DIR"'::
@@ -174,7 +184,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
@@ -187,14 +197,14 @@ s:'"$TOP_DIR"'::
s:%lang(.*) .*/mate/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MATE"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f|sed '
s:'"$TOP_DIR"'::
@@ -202,7 +212,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
if [ x"$KDE3_HTML" != x ] && [ -d "$TOP_DIR$KDE3_HTML" ]; then
@@ -214,7 +224,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
@@ -227,7 +237,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
KF5_HTML=`kf5-config --expandvars --install html 2>/dev/null`
@@ -240,7 +250,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
find "$TOP_DIR" -type d|sed '
@@ -251,7 +261,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$HTML"'s:\(.*/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
@@ -264,7 +274,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\+\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
@@ -272,22 +282,25 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f -o -type l|sed -r 's/\.(bz2|gz|xz|lzma|Z)$//g' | sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
done # for NAME in ${NAMES[@]}
-if ! grep -q / $MO_NAME; then
- echo "No translations found for ${NAME} in ${TOP_DIR}"
+if ! grep -q / $MO_NAME_NEW; then
+ echo "No translations found for ${NAMES[*]} in ${TOP_DIR}"
+ rm -f $MO_NAME_NEW
exit 1
fi
+sort -u $MO_NAME_NEW >> $MO_NAME
+rm -f $MO_NAME_NEW
if [[ "$SUBPKGS" == "NO" ]]; then
exit 0

16
findsupplements.diff Normal file
View File

@ -0,0 +1,16 @@
--- scripts/CMakeLists.txt.orig 2023-10-09 13:14:50.011193421 +0000
+++ scripts/CMakeLists.txt 2023-10-09 13:15:00.395174379 +0000
@@ -5,6 +5,7 @@ install(PROGRAMS
check-files check-prereqs
check-buildroot check-rpaths check-rpaths-worker
find-lang.sh find-requires find-provides
+ find-supplements
perl.prov perl.req
pkgconfigdeps.sh
ocamldeps.sh
--- scripts/find-supplements.orig 2023-10-09 13:14:37.371216603 +0000
+++ scripts/find-supplements 2023-10-09 13:14:37.371216603 +0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/lib/rpm/rpmdeps --define="_use_internal_dependency_generator 1" --supplements

55
headeradddb.diff Normal file
View File

@ -0,0 +1,55 @@
Add rpmtsHeaderAddDB and rpmtsHeaderRemoveDB so that
convertdb1 will build again.
--- lib/rpmts.c.orig 2011-05-12 13:21:03.000000000 +0000
+++ lib/rpmts.c 2011-05-12 13:26:25.000000000 +0000
@@ -159,6 +159,24 @@ int rpmtsVerifyDB(rpmts ts)
return rc;
}
+int rpmtsHeaderAddDB(rpmts ts, Header h)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbRemove(rpmtsGetRdb(ts), hdrNum) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
/* keyp might no be defined. */
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen)
--- include/rpm/lib/rpmts.h.orig 2011-05-12 13:21:11.000000000 +0000
+++ include/rpm/rpmts.h 2011-05-12 13:28:32.000000000 +0000
@@ -264,6 +264,22 @@ int rpmtsRebuildDB(rpmts ts);
int rpmtsVerifyDB(rpmts ts);
/** \ingroup rpmts
+ * Add a header to the database used by the transaction.
+ * @param ts transaction set
+ * @param h header to add
+ * @return 0 on success
+ */
+int rpmtsHeaderAddDB(rpmts ts, Header h);
+
+/** \ingroup rpmts
+ * Remove a header from the database used by the transaction.
+ * @param ts transaction set
+ * @param hdrNum index of header to remove
+ * @return 0 on success
+ */
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum);
+
+/** \ingroup rpmts
* Return transaction database iterator.
* @param ts transaction set
* @param rpmtag database index tag

12
headerchk2.diff Normal file
View File

@ -0,0 +1,12 @@
--- lib/header.c.orig 2017-12-01 15:54:04.254399473 +0000
+++ lib/header.c 2017-12-01 15:55:36.389131237 +0000
@@ -929,7 +929,8 @@ rpmRC hdrblobImport(hdrblob blob, int fa
rdlen += REGION_TAG_COUNT;
- if (rdlen != blob->dl)
+ /* should be equality test, but can be off if entries are not perfectly aligned */
+ if (rdlen > blob->dl)
goto errxit;
}

33
ignore-auxv.diff Normal file
View File

@ -0,0 +1,33 @@
--- lib/rpmrc.c.orig 2020-09-30 07:48:01.215567727 +0000
+++ lib/rpmrc.c 2020-09-30 12:22:46.612692258 +0000
@@ -78,10 +78,12 @@ struct rpmOption {
int localize;
};
+#if defined(__linux__) && (defined(__powerpc__) || defined(__sparc__) || (defined(__arm__) && defined(__ARM_PCS_VFP)))
static struct rpmat_s {
const char *platform;
uint64_t hwcap;
} rpmat;
+#endif
typedef struct defaultEntry_s {
char * name;
@@ -948,7 +950,7 @@ static int is_geode(void)
#endif
-#if defined(__linux__)
+#if defined(__linux__) && (defined(__powerpc__) || defined(__sparc__) || (defined(__arm__) && defined(__ARM_PCS_VFP)))
/**
* Populate rpmat structure with auxv values
*/
@@ -1004,7 +1006,7 @@ static void defaultMachine(rpmrcCtx ctx,
canonEntry canon;
int rc;
-#if defined(__linux__)
+#if defined(__linux__) && (defined(__powerpc__) || defined(__sparc__) || (defined(__arm__) && defined(__ARM_PCS_VFP)))
/* Populate rpmat struct with hw info */
read_auxv();
#endif

125
langnoc.diff Normal file
View File

@ -0,0 +1,125 @@
--- macros.in.orig 2023-10-09 13:07:58.463949074 +0000
+++ macros.in 2023-10-09 13:08:04.079938403 +0000
@@ -1192,6 +1192,7 @@ Supplements: (%{name} = %{version}-%{r
# %files -f %{name}.lang
#
%find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
+%no_lang_C --without-C
# Commands + opts to use for retrieving remote files
# Proxy opts can be set through --httpproxy/--httpport popt aliases,
--- scripts/find-lang.sh.orig 2023-10-09 13:07:58.475949051 +0000
+++ scripts/find-lang.sh 2023-10-09 13:08:04.079938403 +0000
@@ -77,6 +77,8 @@ SUBPKGS=NO
MO_NAME=${NAMES[0]}.lang
ALL_NAME=#
NO_ALL_NAME=
+ONLY_C=#
+NO_C=#
while test $# -gt 0 ; do
case "${1}" in
--with-gnome )
@@ -124,6 +126,14 @@ while test $# -gt 0 ; do
SUBPKGS=YES
shift
;;
+ --with-only-C )
+ ONLY_C=
+ shift
+ ;;
+ --without-C )
+ NO_C=
+ shift
+ ;;
* )
if [ $MO_NAME != ${NAMES[$#]}.lang ]; then
NAMES[${#NAMES[@]}]=$MO_NAME
@@ -164,6 +174,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -172,19 +184,23 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3\4/:
'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%lang(C) %dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%lang(C) %dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -200,6 +216,8 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -240,6 +258,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -253,6 +273,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -290,6 +312,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\+[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\+\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -298,6 +322,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -305,6 +331,8 @@ find "$TOP_DIR" -type f -o -type l|sed -
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW

196
localetag.diff Normal file
View File

@ -0,0 +1,196 @@
Convert output to the current locale. Assumes utf8 input if the
decoding works, otherwise iso-8859-1.
--- lib/tagexts.c.orig 2021-06-21 12:00:44.615612184 +0000
+++ lib/tagexts.c 2021-09-23 18:58:58.461872258 +0000
@@ -2,6 +2,7 @@
* \file lib/formats.c
*/
+#include <wchar.h>
#include "system.h"
#include <rpm/rpmtypes.h>
@@ -197,6 +198,114 @@ typedef enum tMode_e {
TRANSFILETRIGGER = 2,
} tMode;
+static char * strtolocale(char *str)
+{
+ wchar_t *wstr, *wp;
+ const unsigned char *cp;
+ char *cc;
+ int state = 0;
+ int c;
+ int ccl, cca, mb_cur_max;
+ size_t l;
+ mbstate_t ps;
+ int strisutf8 = 1;
+ int locisutf8 = 1;
+
+ if (!str)
+ return 0;
+ if (!*str)
+ return str;
+ wstr = (wchar_t *)xmalloc((strlen(str) + 1) * sizeof(*wstr));
+ wp = wstr;
+ cp = (const unsigned char *)str;
+ while ((c = *cp++) != 0) {
+ if (state) {
+ if ((c & 0xc0) != 0x80) {
+ /* encoding error */
+ break;
+ }
+ c = (c & 0x3f) | (state << 6);
+ if (!(state & 0x40000000)) {
+ /* check for overlong sequences */
+ if ((c & 0x820823e0) == 0x80000000)
+ c = 0xfdffffff;
+ else if ((c & 0x020821f0) == 0x02000000)
+ c = 0xfff7ffff;
+ else if ((c & 0x000820f8) == 0x00080000)
+ c = 0xffffd000;
+ else if ((c & 0x0000207c) == 0x00002000)
+ c = 0xffffff70;
+ }
+ } else {
+ /* new sequence */
+ if (c >= 0xfe)
+ c = 0xfffd;
+ else if (c >= 0xfc)
+ c = (c & 0x01) | 0xbffffffc; /* 5 bytes to follow */
+ else if (c >= 0xf8)
+ c = (c & 0x03) | 0xbfffff00; /* 4 */
+ else if (c >= 0xf0)
+ c = (c & 0x07) | 0xbfffc000; /* 3 */
+ else if (c >= 0xe0)
+ c = (c & 0x0f) | 0xbff00000; /* 2 */
+ else if (c >= 0xc2)
+ c = (c & 0x1f) | 0xfc000000; /* 1 */
+ else if (c >= 0xc0)
+ c = 0xfdffffff; /* overlong */
+ else if (c >= 0x80)
+ c = 0xfffd;
+ }
+ state = (c & 0x80000000) ? c : 0;
+ if (state)
+ continue;
+ *wp++ = (wchar_t)c;
+ }
+ if (state) {
+ /* encoding error, assume latin1 */
+ strisutf8 = 0;
+ cp = (const unsigned char *)str;
+ wp = wstr;
+ while ((c = *cp++) != 0) {
+ *wp++ = (wchar_t)c;
+ }
+ }
+ *wp = 0;
+ mb_cur_max = MB_CUR_MAX;
+ memset(&ps, 0, sizeof(ps));
+ cc = xmalloc(mb_cur_max);
+ /* test locale encoding */
+ if (wcrtomb(cc, 0x20ac, &ps) != 3 || memcmp(cc, "\342\202\254", 3))
+ locisutf8 = 0;
+ if (locisutf8 == strisutf8) {
+ wstr = _free(wstr);
+ return str;
+ }
+ str = _free((char *)str);
+ memset(&ps, 0, sizeof(ps));
+ ccl = cca = 0;
+ for (wp = wstr; ; wp++) {
+ l = wcrtomb(cc + ccl, *wp, &ps);
+ if (*wp == 0)
+ break;
+ if (l == (size_t)-1) {
+ if (*wp < (wchar_t)256 && mbsinit(&ps)) {
+ cc[ccl] = *wp;
+ l = 1;
+ } else
+ l = wcrtomb(cc + ccl, (wchar_t)'?', &ps);
+ }
+ if (l == 0 || l == (size_t)-1)
+ continue;
+ ccl += l;
+ if (ccl > cca) {
+ cca = ccl + 16;
+ cc = xrealloc(cc, cca + mb_cur_max);
+ }
+ }
+ wstr = _free(wstr);
+ return (char *)cc;
+}
+
/**
* Retrieve trigger info.
* @param mode type of trigger (see tMode_e)
@@ -607,10 +716,41 @@ static int i18nTag(Header h, rpmTag tag,
#endif
rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (rc && td->data) {
+ td->data = strtolocale(td->data);
+ }
return rc;
}
/**
+ * Retrieve text and convert to locale.
+ */
+static int localeTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
+{
+ int rc;
+ rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (!rc)
+ return 0;
+ if (td->type == RPM_STRING_TYPE) {
+ td->data = strtolocale(td->data);
+ td->count = 1;
+ } else if (td->type == RPM_STRING_ARRAY_TYPE) {
+ char **arr;
+ int i;
+ arr = xmalloc(td->count * sizeof(*arr));
+ for (i = 0; i < td->count; i++) {
+ arr[i] = xstrdup(((char **)td->data)[i]);
+ arr[i] = strtolocale(arr[i]);
+ }
+ _free(td->data);
+ td->data = arr;
+ td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED;
+ }
+ return rc;
+}
+
+
+/**
* Retrieve summary text.
* @param h header
* @param[out] td tag data container
@@ -634,6 +774,16 @@ static int descriptionTag(Header h, rpmt
return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags);
}
+static int changelognameTag(Header h, rpmtd td, headerGetFlags hgflags)
+{
+ return localeTag(h, RPMTAG_CHANGELOGNAME, td, hgflags);
+}
+
+static int changelogtextTag(Header h, rpmtd td, headerGetFlags hgflags)
+{
+ return localeTag(h, RPMTAG_CHANGELOGTEXT, td, hgflags);
+}
+
/**
* Retrieve group text.
* @param h header
@@ -971,6 +1121,8 @@ static const struct headerTagFunc_s rpmH
{ RPMTAG_LONGARCHIVESIZE, longarchivesizeTag },
{ RPMTAG_LONGSIZE, longsizeTag },
{ RPMTAG_LONGSIGSIZE, longsigsizeTag },
+ { RPMTAG_CHANGELOGNAME, changelognameTag },
+ { RPMTAG_CHANGELOGTEXT, changelogtextTag },
{ RPMTAG_DBINSTANCE, dbinstanceTag },
{ RPMTAG_EVR, evrTag },
{ RPMTAG_NVR, nvrTag },

138
macrosin.diff Normal file
View File

@ -0,0 +1,138 @@
--- macros.in.orig 2023-10-09 12:34:52.359518015 +0000
+++ macros.in 2023-10-09 12:34:56.915510497 +0000
@@ -161,6 +161,7 @@
%{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
%{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
%{?_find_debuginfo_dwz_opts} \\\
+ %{lua:if posix.access(rpm.expand("%_sourcedir/baselibs.conf"), "r") then print("--dwz-single-file-mode") end} \\\
%{?_find_debuginfo_opts} \\\
%{?_debugsource_packages:-S debugsourcefiles.list} \\\
"%{_builddir}/%{?buildsubdir}"\
@@ -211,7 +212,8 @@ Supplements: (%{name} = %{version}-%{r
%files langpack-%{1}\
%{nil}
-%_defaultdocdir %{_datadir}/doc
+%_defaultdocdir %{_datadir}/doc/packages
+%_docdir_fmt %%{NAME}
%_defaultlicensedir %{_datadir}/licenses
# Following macros for filtering auto deps must not be used in spec files.
@@ -277,7 +279,8 @@ Supplements: (%{name} = %{version}-%{r
%_tmppath %{_var}/tmp
# Path to top of build area.
-%_topdir %{getenv:HOME}/rpmbuild
+%_topdir %{expand:%%global _topdir %{lua:if posix.access(rpm.expand("%{_usrsrc}/packages"), "w") then print "%{_usrsrc}/packages" else print "%{getenv:HOME}/rpmbuild" end} \
+}%_topdir
#==============================================================================
# ---- Optional rpmrc macros.
@@ -379,7 +382,7 @@ Supplements: (%{name} = %{version}-%{r
# "w.ufdio" uncompressed
#
#%_source_payload w9.gzdio
-#%_binary_payload w9.gzdio
+%_binary_payload w19.zstdio
# Algorithm to use for generating file checksum digests on build.
# If not specified or 0, MD5 is used.
@@ -489,6 +492,19 @@ Supplements: (%{name} = %{version}-%{r
#
#%_include_minidebuginfo 1
+# Number of debugging information entries (DIEs) above which
+# dwz will stop considering file for multifile optimizations
+# and enter a low memory mode, in which it will optimize
+# in about half the memory needed otherwise.
+%_dwz_low_mem_die_limit 10000000
+# Number of DIEs above which dwz will stop processing
+# a file altogether.
+%_dwz_max_die_limit 50000000
+
+%_find_debuginfo_dwz_opts --run-dwz\\\
+ --dwz-low-mem-die-limit %{_dwz_low_mem_die_limit}\\\
+ --dwz-max-die-limit %{_dwz_max_die_limit}
+
#
# Include a .gdb_index section in the .debug files.
# Requires _enable_debug_packages and gdb-add-index installed.
@@ -521,39 +537,39 @@ Supplements: (%{name} = %{version}-%{r
# Same as for "separate" but if the __debug_package global is set then
# the -debuginfo package will have a compatibility link for the main
# ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy
-%_build_id_links compat
+%_build_id_links alldebug
# Whether build-ids should be made unique between package version/releases
# when generating debuginfo packages. If set to 1 this will pass
# --build-id-seed "%{VERSION}-%{RELEASE}" to find-debuginfo.sh which will
# pass it onto debugedit --build-id-seed to be used to prime the build-id
# note hash.
-%_unique_build_ids 1
+#%_unique_build_ids 1
# Do not recompute build-ids but keep whatever is in the ELF file already.
# Cannot be used together with _unique_build_ids (which forces recomputation).
# Defaults to undefined (unset).
-#%_no_recompute_build_ids 1
+%_no_recompute_build_ids 1
# Whether .debug files should be made unique between package version,
# release and architecture. If set to 1 this will pass
# --unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch} find-debuginfo.sh
# to create debuginfo files which end in -<ver>-<rel>.<arch>.debug
# Requires _unique_build_ids.
-%_unique_debug_names 1
+#%_unique_debug_names 1
# Whether the /usr/debug/src/<package> directories should be unique between
# package version, release and architecture. If set to 1 this will pass
# --unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}" to
# find-debuginfo.sh to name the directory under /usr/debug/src as
# <name>-<ver>-<rel>.<arch>.
-%_unique_debug_srcs 1
+#%_unique_debug_srcs 1
# Whether rpm should put debug source files into its own subpackage
-#%_debugsource_packages 1
+%_debugsource_packages 1
# Whether rpm should create extra debuginfo packages for each subpackage
-#%_debuginfo_subpackages 1
+%_debuginfo_subpackages 1
#
# Use internal dependency generator rather than external helpers?
@@ -572,6 +588,7 @@ Supplements: (%{name} = %{version}-%{r
%__find_requires %{_rpmconfigdir}/find-requires
#%__find_conflicts ???
#%__find_obsoletes ???
+%__find_supplements %{_rpmconfigdir}/find-supplements
#
# Path to file attribute classifications for automatic dependency
@@ -984,7 +1001,7 @@ Supplements: (%{name} = %{version}-%{r
%_build_vendor %{_host_vendor}
%_build_os %{_host_os}
%_host @host@
-%_host_alias @host_alias@%{nil}
+%_host_alias @host@%{nil}
%_host_cpu @host_cpu@
%_host_vendor @host_vendor@
%_host_os @host_os@
@@ -1109,11 +1126,13 @@ Supplements: (%{name} = %{version}-%{r
#------------------------------------------------------------------------------
# arch macro for all supported 32-bit ARM processors
-%arm32 armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
+%arm32 armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
#------------------------------------------------------------------------------
# arch macro for all supported 32-bit ARM processors (legacy, use %%arm32 instead)
%arm %{arm32}
+%arml armv3l armv4l armv5l armv5tel armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
+%armb armv4b armv5b armv5teb
#------------------------------------------------------------------------------
# arch macro for all supported 64-bit ARM processors

View File

@ -0,0 +1,68 @@
--- lib/rpmdb.c.orig 2020-11-27 13:09:17.968992873 +0000
+++ lib/rpmdb.c 2020-11-27 13:14:21.524165780 +0000
@@ -2679,6 +2679,48 @@ int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl
return dbctrl ? dbCtrl(db, dbctrl) : 1;
}
+const unsigned char *rpmdbNextIteratorHeaderBlob(rpmdbMatchIterator mi, unsigned int *size)
+{
+ dbiIndex dbi = NULL;
+ unsigned char * uh;
+ unsigned int uhlen;
+ int rc;
+ if (mi == NULL || mi->mi_re != NULL)
+ return NULL;
+ if (pkgdbOpen(mi->mi_db, 0, &dbi))
+ return NULL;
+ if (mi->mi_dbc == NULL)
+ mi->mi_dbc = dbiCursorInit(dbi, mi->mi_cflags);
+ miFreeHeader(mi, dbi);
+ uh = NULL;
+ uhlen = 0;
+ do {
+ if (mi->mi_set) {
+ if (!(mi->mi_setx < mi->mi_set->count))
+ return NULL;
+ mi->mi_offset = dbiIndexRecordOffset(mi->mi_set, mi->mi_setx);
+ mi->mi_filenum = dbiIndexRecordFileNumber(mi->mi_set, mi->mi_setx);
+ } else {
+ rc = pkgdbGet(dbi, mi->mi_dbc, 0, &uh, &uhlen);
+ if (rc == 0)
+ mi->mi_offset = pkgdbKey(dbi, mi->mi_dbc);
+
+ /* Terminate on error or end of keys */
+ if (rc || (mi->mi_setx && mi->mi_offset == 0))
+ return NULL;
+ }
+ mi->mi_setx++;
+ } while (mi->mi_offset == 0);
+ if (uh == NULL) {
+ rc = pkgdbGet(dbi, mi->mi_dbc, mi->mi_offset, &uh, &uhlen);
+ if (rc || uh == NULL)
+ return NULL;
+ }
+ if (size)
+ *size = uhlen;
+ return uh;
+}
+
char *rpmdbCookie(rpmdb db)
{
void *cookie = NULL;
--- include/rpm/rpmdb.h.orig 2020-11-27 13:09:17.968992873 +0000
+++ include/rpm/rpmdb.h 2020-11-27 13:09:36.352942782 +0000
@@ -253,6 +253,14 @@ int rpmdbStat(const char *prefix, struct
*/
int rpmdbFStat(rpmdb db, struct stat *statbuf);
+/** \ingroup rpmdb
+ * Return next unverified package header blob from iteration.
+ * @param mi rpm database iterator
+ * @retval size header blob size in bytes
+ * @return NULL on end of iteration.
+ */
+const unsigned char *rpmdbNextIteratorHeaderBlob(rpmdbMatchIterator mi, unsigned int *size);
+
#ifdef __cplusplus
}
#endif

14
nobuildcolor.diff Normal file
View File

@ -0,0 +1,14 @@
Disable file coloring for SUSE systems
--- build/rpmfc.c.orig 2020-09-30 13:06:07.502865543 +0000
+++ build/rpmfc.c 2020-09-30 13:07:08.530734545 +0000
@@ -1607,7 +1607,8 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
goto exit;
/* Add per-file colors(#files) */
- headerPutUint32(pkg->header, RPMTAG_FILECOLORS, fc->fcolor, fc->nfiles);
+ if (rpmExpandNumeric("%{?_transaction_color}") != 0)
+ headerPutUint32(pkg->header, RPMTAG_FILECOLORS, fc->fcolor, fc->nfiles);
/* Add classes(#classes) */
for (rpmsid id = 1; id <= rpmstrPoolNumStr(fc->cdict); id++) {

13
nomagiccheck.diff Normal file
View File

@ -0,0 +1,13 @@
Don't let rpm complain about a missing /etc/magic.mgc file
--- build/rpmfc.c.orig 2020-09-30 13:08:18.770584384 +0000
+++ build/rpmfc.c 2020-09-30 13:08:54.306508417 +0000
@@ -1159,7 +1159,7 @@ static uint32_t getElfColor(const char *
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
{
- int msflags = MAGIC_CHECK | MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS | MAGIC_ERROR;
+ int msflags = MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS | MAGIC_ERROR;
int mimeflags = msflags | MAGIC_MIME_TYPE;
int nerrors = 0;
rpmRC rc = RPMRC_FAIL;

20
noprereqdeprec.diff Normal file
View File

@ -0,0 +1,20 @@
--- build/parsePreamble.c.orig 2019-10-02 11:38:15.807736662 +0000
+++ build/parsePreamble.c 2019-10-02 11:39:12.495617575 +0000
@@ -1032,7 +1032,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_SUGGESTNAME, 0, 0, 0, LEN_AND_STR("suggests")},
{RPMTAG_SUPPLEMENTNAME, 0, 0, 0, LEN_AND_STR("supplements")},
{RPMTAG_ENHANCENAME, 0, 0, 0, LEN_AND_STR("enhances")},
- {RPMTAG_PREREQ, 2, 1, 0, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 2, 0, 0, LEN_AND_STR("prereq")},
{RPMTAG_CONFLICTNAME, 0, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETENAME, 0, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_PREFIXES, 0, 0, 1, LEN_AND_STR("prefixes")},
@@ -1041,7 +1041,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarchitectures")},
{RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarch")},
{RPMTAG_BUILDCONFLICTS, 0, 0, 0, LEN_AND_STR("buildconflicts")},
- {RPMTAG_BUILDPREREQ, 0, 1, 0, LEN_AND_STR("buildprereq")},
+ {RPMTAG_BUILDPREREQ, 0, 0, 0, LEN_AND_STR("buildprereq")},
{RPMTAG_BUILDREQUIRES, 0, 0, 0, LEN_AND_STR("buildrequires")},
{RPMTAG_AUTOREQPROV, 0, 0, 0, LEN_AND_STR("autoreqprov")},
{RPMTAG_AUTOREQ, 0, 0, 0, LEN_AND_STR("autoreq")},

33
platformin.diff Normal file
View File

@ -0,0 +1,33 @@
--- platform.in.orig 2023-09-19 10:10:10.000000000 +0000
+++ platform.in 2023-10-09 12:37:30.431256940 +0000
@@ -41,7 +41,7 @@
%_oldincludedir @oldincludedir@
%_infodir @infodir@
%_mandir @mandir@
-%_initddir %{_sysconfdir}/rc.d/init.d
+%_initddir %{_sysconfdir}/init.d
# Deprecated misspelling, present for backwards compatibility.
%_initrddir %{_initddir}
%_rundir @rundir@
@@ -96,3 +96,21 @@
=apple=#
=apple=%_use_internal_dependency_generator 0
=apple=%__so dylib
+=suse=#---------------------------------------------------------------------
+=suse=# Expanded at end of %prep
+=suse=#
+=suse=%__id_u %{__id} -u
+=suse=%__chown_Rhf %{__chown} -Rhf
+=suse=%__chgrp_Rhf %{__chgrp} -Rhf
+=suse=%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
+=suse=%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root
+=suse=%_fixperms %{__chmod} -Rf a+rX,u+w,g-w,o-w
+=suse=
+=suse=#---------------------------------------------------------------------
+=suse=# Expanded at start of %build
+=suse=#
+=suse=%__spec_build_pre %{___build_pre}\
+=suse=%{?buildroot: %__rm -rf "$RPM_BUILD_ROOT"\
+=suse= %__mkdir_p `dirname "$RPM_BUILD_ROOT"`\
+=suse= %__mkdir "$RPM_BUILD_ROOT"\
+=suse=}

389
posttrans.diff Normal file
View File

@ -0,0 +1,389 @@
--- include/rpm/rpmcli.h.orig 2023-09-19 10:10:10.000000000 +0000
+++ include/rpm/rpmcli.h 2023-10-12 11:43:59.662617302 +0000
@@ -306,6 +306,7 @@ enum rpmInstallFlags_e {
INSTALL_ALLMATCHES = (1 << 9), /*!< from --allmatches */
INSTALL_REINSTALL = (1 << 10), /*!< from --reinstall */
INSTALL_RESTORE = (1 << 11), /*!< from --restore */
+ INSTALL_RUNPOSTTRANS = (1 << 12), /*!< from --runposttrans */
};
typedef rpmFlags rpmInstallFlags;
@@ -396,6 +397,15 @@ int rpmErase(rpmts ts, struct rpmInstall
int rpmRestore(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
/** \ingroup rpmcli
+ * Run posttrans scriptlets
+ * @param ts transaction set
+ * @param ia control args/bits
+ * @param argv array of trigger manifest file names (NULL terminated)
+ * @return 0 on success
+ */
+int rpmRunPostTrans(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
+
+/** \ingroup rpmcli
*/
extern struct rpmInstallArguments_s rpmIArgs;
--- include/rpm/rpmts.h.orig 2023-10-12 11:43:35.870664176 +0000
+++ include/rpm/rpmts.h 2023-10-12 11:43:59.662617302 +0000
@@ -253,6 +253,15 @@ int rpmtsOrder(rpmts ts);
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
/** \ingroup rpmts
+ * Run all posttrans scriptlets described in the manifest data.
+ *
+ * @param ts transaction set
+ * @param manifest the manifest data
+ * @return 0 on success, -1 on error
+ */
+int rpmtsRunPostTrans(rpmts ts, ARGV_const_t manifest);
+
+/** \ingroup rpmts
* Reference a transaction set instance.
* @param ts transaction set
* @return new transaction set reference
--- lib/poptI.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/poptI.c 2023-10-12 11:43:59.662617302 +0000
@@ -283,6 +283,10 @@ struct poptOption rpmInstallPoptTable[]
&rpmIArgs.installInterfaceFlags, (INSTALL_RESTORE),
N_("restore package(s)"),
N_("<packagefile>+") },
+ { "runposttrans", '\0', POPT_BIT_SET,
+ &rpmIArgs.installInterfaceFlags, INSTALL_RUNPOSTTRANS,
+ N_("run posttrans scriptlet"),
+ N_("<posttransmanifest>") },
POPT_TABLEEND
};
--- lib/psm.c.orig 2023-10-12 11:43:35.850664215 +0000
+++ lib/psm.c 2023-10-12 11:43:59.662617302 +0000
@@ -1001,7 +1001,7 @@ static rpmRC rpmPackageErase(rpmts ts, r
}
if (rc) break;
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) {
+ if (ts->dump_posttrans || !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) {
/* Prepare post transaction uninstall triggers */
rpmtriggersPrepPostUnTransFileTrigs(psm->ts, psm->te);
}
--- lib/rpminstall.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/rpminstall.c 2023-10-12 11:43:59.662617302 +0000
@@ -6,6 +6,8 @@
#include <string.h>
+#include <errno.h>
+
#include <rpm/rpmcli.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmlib.h> /* rpmReadPackageFile, vercmp etc */
@@ -830,3 +832,32 @@ int rpmInstallSource(rpmts ts, const cha
return rc;
}
+int rpmRunPostTrans(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t fileArgv)
+{
+ ARGV_t manifest = NULL;
+ FILE *f;
+ char line[BUFSIZ], *s, *p;
+ int rc = 1;
+
+ if (fileArgv == NULL) return 0;
+ if (!fileArgv[0] || fileArgv[1] != NULL) {
+ rpmlog(RPMLOG_ERR, _("runposttrans needs exactly one manifest file\n"));
+ goto exit;
+ }
+ if (!(f = fopen(fileArgv[0], "r"))) {
+ rpmlog(RPMLOG_ERR, _("cannot open %s: %s\n"), fileArgv[0], strerror(errno));
+ goto exit;
+ }
+ while ((s = fgets(line, sizeof(line) - 1, f)) != 0) {
+ if (p = strrchr(s, '\n'))
+ *p = 0;
+ argvAdd(&manifest, s);
+ }
+ fclose(f);
+ rpmlog(RPMLOG_DEBUG, "running posttrans scriptlets\n");
+ rpmtsClean(ts);
+ rc = rpmtsRunPostTrans(ts, manifest);
+exit:
+ argvFree(manifest);
+ return rc;
+}
--- lib/rpmtriggers.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/rpmtriggers.c 2023-10-12 11:43:59.662617302 +0000
@@ -1,5 +1,6 @@
#include "system.h"
+#include <rpm/rpmlog.h>
#include <rpm/rpmts.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmds.h>
@@ -34,7 +35,7 @@ rpmtriggers rpmtriggersFree(rpmtriggers
return NULL;
}
-static void rpmtriggersAdd(rpmtriggers trigs, unsigned int hdrNum,
+void rpmtriggersAdd(rpmtriggers trigs, unsigned int hdrNum,
unsigned int tix, unsigned int priority)
{
if (trigs->count == trigs->alloced) {
@@ -178,6 +179,14 @@ int runPostUnTransFileTrigs(rpmts ts)
if (trigH == NULL)
continue;
+ if (ts->dump_posttrans) {
+ char *trigNEVRA = headerGetAsString(trigH, RPMTAG_NEVRA);
+ rpmlog(RPMLOG_NOTICE, "dump_posttrans: transfiletriggerpostun %u %u %s\n", trigs->triggerInfo[i].tix, trigs->triggerInfo[i].hdrNum, trigNEVRA);
+ free(trigNEVRA);
+ headerFree(trigH);
+ continue;
+ }
+
/* Prepare and run script */
script = rpmScriptFromTriggerTag(trigH,
triggertag(RPMSENSE_TRIGGERPOSTUN),
@@ -587,6 +596,16 @@ rpmRC runImmedFileTriggers(rpmts ts, rpm
rpmTagVal priorityTag;
rpmtriggers triggers;
+ if (sense == RPMSENSE_TRIGGERIN && tm == RPMSCRIPT_TRANSFILETRIGGER && ts->dump_posttrans) {
+ unsigned int hdrNum = headerGetInstance(trigH);
+ if (hdrNum) {
+ char *trigNEVRA = headerGetAsString(trigH, RPMTAG_NEVRA);
+ rpmlog(RPMLOG_NOTICE, "dump_posttrans: install %u %s\n", hdrNum, trigNEVRA);
+ free(trigNEVRA);
+ }
+ headerFree(trigH);
+ return RPMRC_OK;
+ }
if (tm == RPMSCRIPT_FILETRIGGER) {
priorityTag = RPMTAG_FILETRIGGERPRIORITIES;
} else {
--- lib/rpmtriggers.h.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/rpmtriggers.h 2023-10-12 11:43:59.662617302 +0000
@@ -27,6 +27,10 @@ rpmtriggers rpmtriggersCreate(unsigned i
RPM_GNUC_INTERNAL
rpmtriggers rpmtriggersFree(rpmtriggers triggers);
+RPM_GNUC_INTERNAL
+void rpmtriggersAdd(rpmtriggers trigs, unsigned int hdrNum,
+ unsigned int tix, unsigned int priority);
+
/*
* Prepare post trans uninstall file triggers. After transcation uninstalled
* files are not saved anywhere. So we need during uninstalation of every
--- lib/rpmts_internal.h.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/rpmts_internal.h 2023-10-12 11:43:59.662617302 +0000
@@ -94,6 +94,8 @@ struct rpmts_s {
int min_writes; /*!< macro minimize_writes used */
time_t overrideTime; /*!< Time value used when overriding system clock. */
+
+ int dump_posttrans; /*!< macro dump_posttrans used */
};
#ifdef __cplusplus
--- lib/transaction.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/transaction.c 2023-10-12 11:44:28.398560689 +0000
@@ -1475,6 +1475,8 @@ static int rpmtsSetup(rpmts ts, rpmprobF
/* Get available space on mounted file systems. */
(void) rpmtsInitDSI(ts);
+ /* Initialize the dump_posttrans flag */
+ ts->dump_posttrans = (rpmExpandNumeric("%{?_dump_posttrans}") > 0);
return 0;
}
@@ -1858,27 +1860,31 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp
/* Actually install and remove packages */
nfailed = rpmtsProcess(ts);
+ if (ts->dump_posttrans) {
+ rpmlog(RPMLOG_NOTICE, "dump_posttrans: enabled\n");
+ }
+
/* Run %posttrans scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) {
+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) {
rpmlog(RPMLOG_DEBUG, "running %%posttrans scripts\n");
runTransScripts(ts, PKG_POSTTRANS);
}
/* Run %postuntrans scripts unless disabled */
- if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOSTUNTRANS)) {
+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOSTUNTRANS)) {
rpmlog(RPMLOG_DEBUG, "running %%postuntrans scripts\n");
runTransScripts(ts, PKG_POSTUNTRANS);
}
/* Run %transfiletriggerpostun scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) {
+ if (!ts->dump_posttrans && !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) {
runFileTriggers(ts, NULL, RPMSENSE_TRIGGERIN, RPMSCRIPT_TRANSFILETRIGGER, 0);
}
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) {
+ if (ts->dump_posttrans || !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERPOSTUN))) {
runPostUnTransFileTrigs(ts);
}
/* Run %transfiletriggerin scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) {
+ if (ts->dump_posttrans || !(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS|RPMTRANS_FLAG_NOTRIGGERIN))) {
runTransScripts(ts, PKG_TRANSFILETRIGGERIN);
}
/* Final exit code */
@@ -1901,3 +1907,117 @@ exit:
sigaction(SIGPIPE, &oact, NULL);
return rc;
}
+
+static unsigned int runPostTransFindPkgNum(const char **lpp)
+{
+ const char *lp = *lpp;
+ unsigned int num = strtoul(lp, 0, 10);
+ while (*lp >= '0' && *lp <= '9')
+ lp++;
+ while (*lp == ' ')
+ lp++;
+ *lpp = lp;
+ return num;
+}
+
+static Header runPostTransFindPkg(rpmts ts, const char *lp)
+{
+ rpmdbMatchIterator mi;
+ Header h = NULL;
+ unsigned int hdrnum = runPostTransFindPkgNum(&lp);
+ if (!*lp)
+ return NULL;
+ if (hdrnum) {
+ mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &hdrnum, sizeof(hdrnum));
+ h = headerLink(rpmdbNextIterator(mi));
+ rpmdbFreeIterator(mi);
+ }
+ if (h) {
+ char *NEVRA = headerGetAsString(h, RPMTAG_NEVRA);
+ if (!NEVRA || strcmp(NEVRA, lp) != 0)
+ h = headerFree(h);
+ _free(NEVRA);
+ }
+ if (!h) {
+ mi = rpmtsInitIterator(ts, RPMDBI_LABEL, lp, strlen(lp));
+ h = headerLink(rpmdbNextIterator(mi));
+ rpmdbFreeIterator(mi);
+ }
+ if (!h)
+ rpmlog(RPMLOG_WARNING, "package %s is not installed\n", lp);
+ return h;
+}
+
+int rpmtsRunPostTrans(rpmts ts, ARGV_const_t manifest)
+{
+ int rc = -1; /* assume failure */
+ /* setup */
+ tsMembers tsmem = rpmtsMembers(ts);
+ rpmtxn txn = NULL;
+ /* Ignore SIGPIPE for the duration of transaction */
+ struct sigaction act, oact;
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = SIG_IGN;
+ sigaction(SIGPIPE, &act, &oact);
+ /* Force default 022 umask during transaction for consistent results */
+ mode_t oldmask = umask(022);
+
+ if (tsmem->orderCount)
+ goto exit;
+ char *line;
+ while ((line = *manifest++) != 0) {
+ if (!strncmp(line, "dump_posttrans: install ", 24)) {
+ const char *lp = line + 24;
+ Header h = runPostTransFindPkg(ts, lp);
+ if (!h)
+ continue;
+ rpmte p = rpmteNew(ts, h, TR_ADDED, line + 45, NULL, RPMTE_INSTALL);
+ if (tsmem->orderCount >= tsmem->orderAlloced) {
+ tsmem->orderAlloced += (tsmem->orderCount - tsmem->orderAlloced) + tsmem->delta;
+ tsmem->order = xrealloc(tsmem->order, tsmem->orderAlloced * sizeof(*tsmem->order));
+ }
+ tsmem->order[tsmem->orderCount++] = p;
+
+ if (tsmem->addedPackages == NULL)
+ tsmem->addedPackages = rpmalCreate(ts, 5);
+ rpmalAdd(tsmem->addedPackages, p);
+ packageHashAddEntry(tsmem->installedPackages, headerGetInstance(h), p);
+ } else if (!strncmp(line, "dump_posttrans: transfiletriggerpostun ", 39)) {
+ const char *lp = line + 39;
+ unsigned int tix = runPostTransFindPkgNum(&lp);
+ Header h = runPostTransFindPkg(ts, lp);
+ struct rpmtd_s priorities;
+ if (!h)
+ continue;
+ headerGet(h, RPMTAG_TRANSFILETRIGGERPRIORITIES, &priorities, HEADERGET_MINMEM);
+ if (rpmtdSetIndex(&priorities, tix) >= 0)
+ rpmtriggersAdd(ts->trigs2run, headerGetInstance(h), tix, *rpmtdGetUint32(&priorities));
+ headerFree(h);
+ }
+ }
+
+ if (!(txn = rpmtxnBegin(ts, RPMTXN_WRITE)))
+ goto exit;
+
+ if (rpmChrootSet(rpmtsRootDir(ts)))
+ goto exit;
+
+ /* run posttrans scripts */
+ rpmlog(RPMLOG_DEBUG, "running post-transaction scripts\n");
+ runTransScripts(ts, PKG_POSTTRANS);
+ runTransScripts(ts, PKG_POSTUNTRANS);
+ /* run %transfiletriggerin scripts */
+ runFileTriggers(ts, NULL, RPMSENSE_TRIGGERIN, RPMSCRIPT_TRANSFILETRIGGER, 0);
+ /* run %transfiletriggerpostun scrips */
+ runPostUnTransFileTrigs(ts);
+ /* Run immed %transfiletriggerin scripts */
+ runTransScripts(ts, PKG_TRANSFILETRIGGERIN);
+ rc = 0;
+
+exit:
+ (void) umask(oldmask);
+ rpmtxnEnd(txn);
+ sigaction(SIGPIPE, &oact, NULL);
+ rpmtsEmpty(ts);
+ return rc;
+}
--- tools/rpm.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ tools/rpm.c 2023-10-12 11:43:59.662617302 +0000
@@ -21,6 +21,7 @@ enum modes {
MODE_ERASE = (1 << 2),
MODE_RESTORE = (1 << 4),
#define MODES_IE (MODE_INSTALL | MODE_ERASE)
+ MODE_RUNPOSTTRANS = (1 << 5),
MODE_UNKNOWN = 0
};
@@ -115,6 +116,11 @@ int main(int argc, char *argv[])
int eflags = (ia->installInterfaceFlags & INSTALL_ERASE);
int rflags = (ia->installInterfaceFlags & INSTALL_RESTORE);
+ if (ia->installInterfaceFlags & INSTALL_RUNPOSTTRANS) {
+ if (iflags || eflags || rflags)
+ argerror(_("only one major mode may be specified"));
+ bigMode = MODE_RUNPOSTTRANS;
+ }
if (iflags & eflags & rflags)
argerror(_("only one major mode may be specified"));
else if (iflags)
@@ -293,6 +299,14 @@ int main(int argc, char *argv[])
ec = rpmcliVerify(ts, qva, (ARGV_const_t) poptGetArgs(optCon));
} break;
+ case MODE_RUNPOSTTRANS:
+ if (!poptPeekArg(optCon)) {
+ argerror(_("need posttrans manifest for --runposttrans"));
+ } else {
+ ec += rpmRunPostTrans(ts, ia, (ARGV_const_t) poptGetArgs(optCon));
+ }
+ break;
+
case MODE_UNKNOWN:
if (poptPeekArg(optCon) != NULL || argc <= 1) {
printUsage(optCon, stderr, 0);

239
python-rpm.changes Normal file
View File

@ -0,0 +1,239 @@
-------------------------------------------------------------------
Fri Feb 9 11:34:31 CET 2024 - mls@suse.de
- update to rpm-4.19.1.1
-------------------------------------------------------------------
Thu Feb 1 15:07:34 CET 2024 - mls@suse.de
- Use cmake for compiling and installing the python modules
* Drop python_setup.diff
* Add cmake_python_version.diff
-------------------------------------------------------------------
Thu Feb 1 11:59:47 UTC 2024 - Dirk Müller <dmueller@suse.com>
- buildrequire setuptools
-------------------------------------------------------------------
Mon Oct 30 14:13:37 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
- Modernize python-rpm.spec to stop using deprecated macros
(%python_build and %python_install).
-------------------------------------------------------------------
Wed Oct 11 17:07:14 CEST 2023 - mls@suse.de
- update to rpm-4.19.1
-------------------------------------------------------------------
Tue May 30 09:07:28 UTC 2023 - Jiri Srain <jsrain@suse.com>
- add _multibuild for multiple .spec-files
-------------------------------------------------------------------
Fri Dec 2 15:09:55 CET 2022 - mls@suse.de
- update to rpm-4.18.0
------------------------------------------------------------------
Thu Jul 21 16:11:22 CEST 2022 - mls@suse.de
- update to rpm-4.17.1
-------------------------------------------------------------------
Thu Sep 23 20:57:45 CEST 2021 - mls@suse.de
- update to rpm-4.17.0
-------------------------------------------------------------------
Tue Mar 30 11:15:44 CEST 2021 - mls@suse.de
- update to rpm-4.16.1.3
-------------------------------------------------------------------
Wed Sep 30 14:17:40 CEST 2020 - mls@suse.de
- update to rpm-4.16.0
-------------------------------------------------------------------
Tue Nov 19 11:09:08 CET 2019 - mls@suse.de
- update to rpm-4.15.1
-------------------------------------------------------------------
Wed Oct 2 14:53:19 CEST 2019 - mls@suse.de
- update to rpm-4.15.0
-------------------------------------------------------------------
Thu Nov 22 09:50:36 UTC 2018 - asmorodskyi@suse.com
- Fix python-module compatibility with older distros
-------------------------------------------------------------------
Fri Apr 6 14:11:01 CEST 2018 - mls@suse.de
- remove rpmlint-Factory buildignore
-------------------------------------------------------------------
Tue Mar 20 13:59:45 UTC 2018 - tchvatal@suse.com
- Switch really to singlespec thus allowing us to build without
python2-devel present in the distribution
-------------------------------------------------------------------
Wed Jan 31 14:45:33 CET 2018 - mls@suse.de
- update to rpm-4.14.1
-------------------------------------------------------------------
Tue Dec 19 09:39:25 UTC 2017 - jengelh@inai.de
- Update RPM groups
-------------------------------------------------------------------
Sat Oct 28 12:19:34 UTC 2017 - ngompa13@gmail.com
- Add a comment to note that prep and build stages come from rpm.spec
-------------------------------------------------------------------
Mon Oct 16 13:49:18 UTC 2017 - ngompa13@gmail.com
- Properly quote the conditional for Obsoletes+Provides
-------------------------------------------------------------------
Sun Oct 15 04:03:00 UTC 2017 - ngompa13@gmail.com
- Unify rpm-python and python3-rpm into singlespec
- Switch the build to use setuptools-based build, so that
the Python module is properly built with all its metadata
-------------------------------------------------------------------
Wed Nov 20 14:41:34 CET 2013 - mls@suse.de
- adapt to python-3.3, which no longer looks at XXXmodule.so
-------------------------------------------------------------------
Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de
- update to rpm-4.11.1
-------------------------------------------------------------------
Wed Jan 2 14:25:20 UTC 2013 - dmueller@suse.com
- Update to 4.10.2
-------------------------------------------------------------------
Mon Apr 23 11:16:26 CEST 2012 - mls@suse.de
- modified capsule api diff to match rpm upstream
-------------------------------------------------------------------
Wed Apr 11 16:54:02 UTC 2012 - klaussfreire@gmail.com
- Fix usage of deprecated AsVoidPtr Python/C API,
replaced by Capsule API
-------------------------------------------------------------------
Tue Jan 17 10:28:42 UTC 2012 - saschpe@suse.de
- Spec file cleanup:
* Don't rm -rf %{buildroot}
* Removed %clean section
* Removed authors from description
-------------------------------------------------------------------
Sun Dec 11 09:28:28 UTC 2011 - coolo@suse.com
- add libtool as explicit buildrequire
-------------------------------------------------------------------
Wed Feb 23 14:01:41 CET 2011 - mls@suse.de
- drop standard python directories from filelist [bnc#229189]
-------------------------------------------------------------------
Fri Oct 22 15:52:32 UTC 2010 - coolo@novell.com
- adapt second spec file to changes done to rpm.spec
-------------------------------------------------------------------
Mon Oct 18 11:03:53 CEST 2010 - dmueller@suse.de
- adapt buildrequires
-------------------------------------------------------------------
Thu Feb 12 16:52:26 CET 2009 - ro@suse.de
- adapt buildrequires
-------------------------------------------------------------------
Wed Oct 8 11:24:22 CEST 2008 - cthiel@suse.de
- added libelf-devel to BuildRequires to fix build
-------------------------------------------------------------------
Thu Sep 11 15:33:52 CEST 2008 - mls@suse.de
- update to 4.4.2.3 to get rid of >50 patches
-------------------------------------------------------------------
Sat Aug 30 21:23:38 CEST 2008 - cthiel@suse.de
- add libselinux-devel to BuildRequires
-------------------------------------------------------------------
Thu Aug 7 16:05:51 CEST 2008 - dmueller@suse.de
- fix build against python 2.6
-------------------------------------------------------------------
Thu Mar 27 14:47:18 CET 2008 - coolo@suse.de
- fix buildrequires
-------------------------------------------------------------------
Fri May 25 16:20:53 CEST 2007 - mls@suse.de
- fix unicode queries
-------------------------------------------------------------------
Fri Mar 30 15:06:28 CEST 2007 - rguenther@suse.de
- add ncurses-devel and zlib-devel BuildRequires.
-------------------------------------------------------------------
Wed Oct 18 22:59:02 CEST 2006 - mls@suse.de
- use rpm.spec for building instead of duplication everything
- delete superfluous .a and .la files [#202604]
- create .pyc and .pyo files [#205711]
-------------------------------------------------------------------
Sun Oct 15 23:41:37 CEST 2006 - schwab@suse.de
- Make sure config.rpath is present.
-------------------------------------------------------------------
Fri Sep 22 08:58:57 CEST 2006 - aj@suse.de
- Fix for python2.5.
-------------------------------------------------------------------
Thu Sep 21 11:41:04 CEST 2006 - lnussel@suse.de
- do not package beecrypt python bindings as libbeecrypt is not
packaged either
- fix literal %{version} in Requires tag
-------------------------------------------------------------------
Thu Sep 21 10:58:42 CEST 2006 - lnussel@suse.de
- fix build with python 2.5 by overriding autodetection
-------------------------------------------------------------------
Tue Sep 19 13:48:27 CEST 2006 - rguenther@suse.de
- split from rpm package

85
python-rpm.spec Normal file
View File

@ -0,0 +1,85 @@
#
# spec file for package python-rpm
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2017 Neal Gompa <ngompa13@gmail.com>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# Enable Python build sourced from rpm spec
%global with_python 1
Name: python-rpm
Version: 4.19.1.1
Release: 0
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0-or-later
Group: Development/Libraries/Python
URL: https://rpm.org/
#Git-Clone: https://github.com/rpm-software-management/rpm
BuildRequires: %{python_module devel}
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: libgcrypt-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python-rpm-macros
BuildRequires: xz-devel
BuildRequires: zlib-devel
BuildRequires: pkgconfig(libzstd)
Requires: rpm = %{version}
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%{_sourcedir}/rpm.spec)}
Source99: rpm.spec
%if "%{python_flavor}" == "python2"
Obsoletes: rpm-python < %{version}-%{release}
Provides: rpm-python = %{version}-%{release}
%endif
%python_subpackages
%description
This package contains a module that permits applications written in
the Python programming language to use the interface supplied by
RPM Package Manager libraries.
This package should be installed if you want to develop Python programs
that will manipulate RPM packages and databases.
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%{_sourcedir}/rpm.spec | sed -e '1d' -e '$d')}
%install
cd _build
%{python_expand #
cmake .. -U\*Python3\* -DWITH_PYTHON_VERSION=%{$python_version}
make DESTDIR=%{buildroot} -C python clean
make DESTDIR=%{buildroot} -C python install
}
%python_compileall
rm -rf %{buildroot}/%{_defaultdocdir}/%{NAME}
%files %{python_files}
%{python_sitearch}/rpm
%{python_sitearch}/rpm-%{version}*-info
%changelog

10
refreshtestarch.diff Normal file
View File

@ -0,0 +1,10 @@
--- lib/psm.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ lib/psm.c 2023-10-09 12:21:38.576812293 +0000
@@ -709,6 +709,7 @@ void rpmpsmNotify(rpmpsm psm, int what,
static void markReplacedInstance(rpmts ts, rpmte te)
{
rpmdbMatchIterator mi = rpmtsTeIterator(ts, te, 1);
+ rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP, rpmteA(te));
while (rpmdbNextIterator(mi) != NULL) {
rpmteSetDBInstance(te, rpmdbGetIteratorOffset(mi));
break;

16
remove-brp-strips.diff Normal file
View File

@ -0,0 +1,16 @@
Subject: remove references to removed brp scripts
Some brp-scripts are not used in openSUSE, remove references
to it
--- platform.in.orig 2021-09-23 19:23:57.822814696 +0000
+++ platform.in 2021-09-23 19:24:31.534745951 +0000
@@ -96,8 +96,6 @@
%{?__brp_compress} \
%{?__brp_elfperms} \
%{?__brp_strip} \
- %{?__brp_strip_static_archive} \
- %{?__brp_strip_comment_note} \
%{?__brp_remove_la_files} \
%{nil}

28
remove-translations.diff Normal file
View File

@ -0,0 +1,28 @@
Index: scripts/find-lang.sh
===================================================================
--- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh
@@ -134,6 +134,23 @@ fi
MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW
+# remove languages we do not yet support - but give out statistics
+test -d "$TOP_DIR/usr/share/locale/" && find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | grep -E -q "/usr/share/locale/$dir"$; then
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
+ echo -n "removing translation $file: "
+ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
+ done
+ rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi
+done
+test -d "$TOP_DIR/usr/share/help/" && find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | grep -E -q "/usr/share/help/$dir"$; then
+ echo "removing help translation /usr/share/help/$dir"
+ rm -rf $TOP_DIR/usr/share/help/$dir
+ fi
+done
+
for NAME in ${NAMES[@]}; do
find "$TOP_DIR" -type f -o -type l|sed '

3
rpm-4.19.1.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:874091b80efe66f9de8e3242ae2337162e2d7131e3aa4ac99ac22155e9c521e5
size 5849649

View File

@ -0,0 +1,55 @@
--- scripts/find-lang.sh.orig 2023-10-09 13:11:05.219604799 +0000
+++ scripts/find-lang.sh 2023-10-09 13:12:38.787433946 +0000
@@ -47,6 +47,7 @@ Additional options:
--with-man find localized man pages
--all-name match all package/domain names
--without-mo do not find locale files
+ --metainfo create a metainfo.xml file for AppStream
--generate-subpackages move language files in one sub package per language
EOF
exit 1
@@ -79,6 +80,7 @@ ALL_NAME=#
NO_ALL_NAME=
ONLY_C=#
NO_C=#
+METAINFO=#
while test $# -gt 0 ; do
case "${1}" in
--with-gnome )
@@ -134,6 +136,11 @@ while test $# -gt 0 ; do
NO_C=
shift
;;
+ --metainfo )
+ METAINFO=
+ METADESKID=${2}
+ shift 2
+ ;;
* )
if [ $MO_NAME != ${NAMES[$#]}.lang ]; then
NAMES[${#NAMES[@]}]=$MO_NAME
@@ -344,6 +351,24 @@ if ! grep -q / $MO_NAME_NEW; then
exit 1
fi
+if [ -z "${METAINFO}" ] ; then
+ # create a metainfo.xml file for METADESKID
+ mkdir -p ${TOP_DIR}/usr/share/appdata
+ cat > ${TOP_DIR}/usr/share/appdata/${METADESKID}-lang.metainfo.xml <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 openSUSE - file is auto-generated -->
+<component type="addon">
+ <id>${METADESKID}-lang</id>
+ <extends>${METADESKID}.desktop</extends>
+ <name>Translations</name>
+ <summary>Translate the user interface</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <updatecontact>https://bugzilla.opensuse.org</updatecontact>
+</component>
+EOF
+ echo /usr/share/appdata/${METADESKID}-lang.metainfo.xml >> $MO_NAME_NEW
+fi
+
sort -u $MO_NAME_NEW >> $MO_NAME
rm -f $MO_NAME_NEW

100
rpm-shorten-changelog.diff Normal file
View File

@ -0,0 +1,100 @@
--- build/pack.c.orig
+++ build/pack.c
@@ -683,6 +683,71 @@
return rc;
}
+static void trimChangelog(Header h)
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
+ rpm_count_t i, keep;
+ struct rpmtd_s timestd, namestd, textstd;
+ rpm_count_t count;
+
+ if (!oneshot) {
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
+ oneshot = 1;
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ maxnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ cuttime = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ minnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ }
+ }
+ if (!cuttime && !minnum && !maxnum) {
+ return;
+ }
+
+ if (!headerGet(h, RPMTAG_CHANGELOGTIME, &timestd, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&timestd);
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ rpmtdFreeData(&timestd);
+ return;
+ }
+ keep = count;
+ if (maxnum && keep > maxnum)
+ keep = maxnum;
+ if (cuttime) {
+ for (i = 0; i < keep; i++) {
+ uint32_t *tp = rpmtdNextUint32(&timestd);
+ if (i >= minnum && tp && *tp < cuttime)
+ break;
+ }
+ keep = i;
+ }
+ if (keep >= count) {
+ rpmtdFreeData(&timestd);
+ return;
+ }
+ headerGet(h, RPMTAG_CHANGELOGNAME, &namestd, HEADERGET_MINMEM);
+ headerGet(h, RPMTAG_CHANGELOGTEXT, &textstd, HEADERGET_MINMEM);
+ timestd.count = namestd.count = textstd.count = keep;
+ headerMod(h, &timestd);
+ headerMod(h, &namestd);
+ headerMod(h, &textstd);
+ rpmtdFreeData(&textstd);
+ rpmtdFreeData(&namestd);
+ rpmtdFreeData(&timestd);
+}
+
static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename)
{
rpmRC rc = RPMRC_OK;
@@ -699,7 +764,10 @@
/* Copy changelog from src rpm */
#pragma omp critical
- headerCopyTags(spec->sourcePackage->header, pkg->header, copyTags);
+ {
+ headerCopyTags(spec->sourcePackage->header, pkg->header, copyTags);
+ trimChangelog(pkg->header);
+ }
headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION);
headerPutString(pkg->header, RPMTAG_BUILDHOST, spec->buildHost);
--- build/parseChangelog.c.orig
+++ build/parseChangelog.c
@@ -267,6 +267,11 @@
goto exit;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;

4821
rpm.changes Normal file

File diff suppressed because it is too large Load Diff

498
rpm.spec Normal file
View File

@ -0,0 +1,498 @@
#
# spec file for package rpm
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%{?!_fillupdir:%define _fillupdir /var/adm/fillup-templates}
%global librpmsover 10
Name: rpm
BuildRequires: binutils
BuildRequires: bzip2
BuildRequires: cmake
BuildRequires: file-devel
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: gettext-devel
BuildRequires: glibc-devel
BuildRequires: gzip
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: libgcrypt-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua-devel
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: patch
BuildRequires: perl-base
BuildRequires: popt-devel
BuildRequires: rpm-build
BuildRequires: xz-devel
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
#!BuildIgnore: rpmlint-Factory
Provides: rpminst
Requires(post): %fillup_prereq
Requires: rpm-config-SUSE
Summary: The RPM Package Manager
License: GPL-2.0-or-later
Group: System/Packages
Version: 4.19.1.1
Release: 0
URL: https://rpm.org/
#Git-Clone: https://github.com/rpm-software-management/rpm
Source: https://ftp.osuosl.org/pub/rpm/releases/rpm-4.19.x/rpm-%{version}.tar.bz2
Source5: rpmsort
Source8: rpmconfigcheck
Source9: sysconfig.services-rpm
Source12: baselibs.conf
Source13: rpmconfigcheck.service
Source14: build-aux.tar.bz2
# quilt patches start here
Patch5: usr-lib-sysimage-rpm.patch
Patch13: ignore-auxv.diff
Patch12: localetag.diff
Patch18: refreshtestarch.diff
Patch24: brp.diff
Patch25: brpcompress.diff
Patch26: checkfilesnoinfodir.diff
Patch29: findlang.diff
Patch30: macrosin.diff
Patch32: platformin.diff
Patch33: rpmpopt.diff
Patch34: rpmrc.diff
Patch36: rpmqpack.diff
Patch38: build.diff
Patch43: rpm-shorten-changelog.diff
Patch46: remove-brp-strips.diff
Patch51: specfilemacro.diff
Patch60: safeugid.diff
Patch61: noprereqdeprec.diff
Patch66: remove-translations.diff
Patch67: headeradddb.diff
Patch69: nobuildcolor.diff
Patch70: fileattrs.diff
Patch71: nomagiccheck.diff
Patch73: assumeexec.diff
Patch77: langnoc.diff
Patch78: headerchk2.diff
Patch85: brp-compress-no-img.patch
Patch93: weakdepscompat.diff
Patch94: checksepwarn.diff
Patch99: enable-postin-scripts-error.diff
Patch100: rpm-findlang-inject-metainfo.patch
Patch102: emptymanifest.diff
Patch103: find-lang-qt-qm.patch
Patch117: findsupplements.diff
Patch122: db_conversion.diff
Patch123: nextiteratorheaderblob.diff
Patch131: posttrans.diff
Patch133: zstdpool.diff
Patch134: zstdthreaded.diff
Patch135: selinux_transactional_update.patch
Patch136: rpmsort_reverse.diff
Patch138: canongnu.diff
Patch139: cmake_python_version.diff
Patch140: 0001-Add-option-to-set-mtime-of-files-in-rpms.patch
Patch141: 0002-log-build-time-if-it-is-set-from-SOURCE_DATE_EPOCH.patch
Patch142: 0003-Error-out-on-a-missing-changelog-date.patch
Patch6464: auto-config-update-aarch64-ppc64le.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
%define _binary_payload w9.bzdio
%description
RPM Package Manager is the main tool for managing the software packages
of the SUSE Linux distribution.
RPM can be used to install and remove software packages. With rpm, it
is easy to update packages. RPM keeps track of all these manipulations
in a central database. This way it is possible to get an overview of
all installed packages. RPM also supports database queries.
%package -n librpmbuild%{librpmsover}
Summary: Library for building RPM packages
# Was part of rpm before
Group: System/Libraries
Conflicts: rpm < %{version}
%description -n librpmbuild%{librpmsover}
Thie package contains a library with functions for building RPM packages.
%package devel
Summary: Development files for librpm
Group: Development/Libraries/C and C++
Requires: rpm = %{version}
# for people confusing the one with the other
Recommends: rpm-build = %{version}
Requires: popt-devel
%description devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs which
manipulate RPM packages and databases and are intended to make it
easier to create graphical package managers or any other tools that
need an intimate knowledge of RPM packages in order to function.
%package build
Summary: Tools and Scripts to create rpm packages
Group: System/Packages
Requires: librpmbuild%{librpmsover} = %{version}
Requires: rpm = %{version}
Provides: rpm:%_bindir/rpmbuild
Provides: rpmbuild
# SUSE's build essentials
Requires: binutils
Requires: bzip2
Requires: coreutils
Requires: diffutils
Requires: dwz
Requires: file
Requires: findutils
Requires: gawk
Requires: gcc
#Requires: gcc-PIE
Requires: /usr/bin/gzip
Requires: gettext-tools
Requires: glibc-devel
Requires: glibc-locale-base
Requires: grep
Requires: make
Requires: patch
Requires: sed
Requires: systemd-rpm-macros
Requires: tar
Requires: util-linux
Requires: which
Requires: xz
# needed for debuginfo generation
Requires: debugedit = 5.1
# drop candidates
Requires: cpio
Requires: file
# Mandatory generators
Requires: (%{name}-build-perl if perl-base)
Requires: (%{name}-build-python if python3-base)
# The point of the split
Conflicts: rpm < 4.15.0
%description build
If you want to build a rpm, you need this package. It provides rpmbuild
and requires some packages that are usually required.
%package build-perl
Summary: RPM dependency generator for Perl
Group: Development/Languages/Perl
Requires: perl-base
%description build-perl
Provides and requires generator for .pl files and modules.
%prep
%setup -q -n rpm-%{version}
%ifarch aarch64 ppc64le riscv64
tar xf %{SOURCE14}
%endif
rm -rf sqlite
%patch -P 5 -P 12 -P 13 -P 18
%patch -P 24 -P 25 -P 26 -P 29
%patch -P 30 -P 32 -P 33 -P 34 -P 36 -P 38
%patch -P 43 -P 46
%patch -P 51
%patch -P 60 -P 61 -P 66 -P 67 -P 69
%patch -P 70 -P 71 -P 73 -P 77 -P 78
%patch -P 85
%patch -P 93 -P 94 -P 99
%patch -P 100 -P 102 -P 103
%patch -P 117
%patch -P 122 -P 123
%patch -P 131 -P 133 -P 134 -P 135 -P 136 -P 138
%patch -P 139
%patch -P 140 -P 141 -P 142 -p1
%ifarch aarch64 ppc64le riscv64
%patch -P 6464
%endif
rm -f m4/libtool.m4
rm -f m4/lt*.m4
%build
export CFLAGS="%{optflags} -ffunction-sections"
export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections"
%ifarch alpha
export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
%endif
cpu="%{_target_cpu}"
# convert to gnu style cpu version, see config.sub
%ifarch ppc ppc64 ppc64le
cpu="${cpu/#ppc/powerpc}"
%endif
mkdir _build
cd _build
cmake .. \
-DRPM_HOST_SYSTEM_CPU="$cpu" \
%ifarch %arm
-DRPM_HOST_SYSTEM_ABI=gnueabi \
%endif
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DCMAKE_INSTALL_MANDIR:PATH=share/man \
-DCMAKE_INSTALL_INFODIR:PATH=share/info \
-DCMAKE_INSTALL_DOCDIR:PATH=%{_defaultdocdir}/%{NAME} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
-DCMAKE_INSTALL_FULL_SYSCONFDIR:PATH=/etc \
-DCMAKE_INSTALL_FULL_LOCALSTATEDIR:PATH=/var \
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/var/lib \
-DCMAKE_INSTALL_FULL_SHAREDSTATEDIR:PATH=/var/lib \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DRPM_VENDOR=suse \
-DWITH_ARCHIVE=OFF \
-DWITH_READLINE=OFF \
-DWITH_SELINUX=ON \
-DWITH_INTERNAL_OPENPGP=ON \
-DENABLE_NDB=ON \
-DENABLE_BDB_RO=ON \
-DENABLE_SQLITE=OFF \
-DWITH_AUDIT=OFF \
-DWITH_DBUS=OFF \
-DENABLE_PYTHON=%{?with_python:ON}%{?!with_python:OFF} \
-DENABLE_TESTSUITE=OFF \
-D__FIND_DEBUGINFO=/usr/lib/rpm/find-debuginfo \
-D__AR:FILEPATH=ar -D__AS:FILEPATH=as \
-D__CC:FILEPATH=gcc -D__CPP:FILEPATH="gcc -E" -D__CXX:FILEPATH=g++ \
-D__GPG:FILEPATH=/usr/bin/gpg2 -D__AWK:FILEPATH=/usr/bin/gawk
make %{?_smp_mflags}
%install
mkdir -p %{buildroot}/usr/lib
mkdir -p %{buildroot}/usr/share/locale
ln -s ../share/locale %{buildroot}/usr/lib/locale
pushd _build
%make_install
popd
mkdir -p %{buildroot}/bin
%if 0%{?suse_version} < 1550
ln -s /usr/bin/rpm %{buildroot}/bin/rpm
%endif
mkdir -p %{buildroot}/usr/sbin
install -m 755 %{SOURCE8} %{buildroot}/usr/sbin
mkdir -p %{buildroot}/usr/lib/systemd/system
install -m 644 %{SOURCE13} %{buildroot}/usr/lib/systemd/system/
mkdir -p %{buildroot}/usr/lib/rpm/macros.d
mkdir -p %{buildroot}/usr/lib/rpm/suse
for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
mkdir -p %{buildroot}/usr/src/packages/$d
chmod 755 %{buildroot}/usr/src/packages/$d
done
for d in %{buildroot}/usr/lib/rpm/platform/*-linux/macros ; do
dd=${d%%-linux/macros}
dd=${dd##*/}
mkdir %{buildroot}/usr/src/packages/RPMS/$dd
chmod 755 %{buildroot}/usr/src/packages/RPMS/$dd
done
mkdir -p %{buildroot}/usr/lib/sysimage/rpm
export RPM_BUILD_ROOT
%ifarch s390x
[ -f scripts/brp-%_arch-linux ] && sh scripts/brp-%_arch-linux
%endif
rm -f %{buildroot}/usr/lib/rpmpopt
rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
rm -f %{buildroot}%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo
mkdir -p %{buildroot}%{_fillupdir}
install -c -m0644 %{SOURCE9} %{buildroot}%{_fillupdir}/
rm -f %{buildroot}/usr/lib/rpm/cpanflute %{buildroot}/usr/lib/rpm/cpanflute2
install -m 755 %{SOURCE5} %{buildroot}/usr/lib/rpm
rm -f %{buildroot}/usr/lib/locale %{buildroot}/usr/lib/rpmrc
mkdir -p %{buildroot}/etc/rpm
chmod 755 %{buildroot}/etc/rpm
# remove some nonsense or non-working scripts
pushd %{buildroot}/usr/lib/rpm/
for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
ocaml-find-provides.sh ocaml-find-requires.sh fileattrs/ocaml.attr \
magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
do
rm -f $f
done
for i in /usr/share/automake-*/*; do
if test -f "$i" && test -f "${i##*/}"; then
rm -f "${i##*/}"
fi
done
popd
%ifarch aarch64 ppc64le riscv64
install -m 755 build-aux/config.guess %{buildroot}/usr/lib/rpm
install -m 755 build-aux/config.sub %{buildroot}/usr/lib/rpm
%endif
rm -rf %{buildroot}/%{_libdir}/python%{py_ver}
bash %{buildroot}/usr/lib/rpm/find-lang.sh %{buildroot} rpm
# On arm the kernel architecture is ignored. Not the best idea, but lets stay compatible with other distros
%ifarch armv7hl armv6hl
# rpm is using the host_cpu as default for the platform, but armv6/7hl is not known by the kernel.
# so we need to enforce the platform here.
echo -n "%{_target_cpu}-suse-linux-gnueabi" > %{buildroot}/etc/rpm/platform
%endif
# disable sysuser handling for now
rm %{buildroot}/usr/lib/rpm/sysusers.sh
rm %{buildroot}/usr/lib/rpm/fileattrs/sysusers.attr
sed -e '/^%%__systemd_sysusers/s/^/#/' -i %{buildroot}/usr/lib/rpm/macros
%post
%{fillup_only -an services}
# var/lib/rpm migration: set forwards compatible symlink for /usr/lib/sysimage/rpm so scriptlets in same transaction will still work
if test ! -L var/lib/rpm -a ! -f usr/lib/sysimage/rpm/Packages -a ! -f usr/lib/sysimage/rpm/Packages.db ; then
if test -f var/lib/rpm/Packages -o -f var/lib/rpm/Packages.db ; then
rmdir usr/lib/sysimage/rpm
ln -s ../../../var/lib/rpm usr/lib/sysimage/rpm
fi
fi
test -f usr/lib/sysimage/rpm/Packages -o -f usr/lib/sysimage/rpm/Packages.db || rpmdb --initdb
test -e var/lib/rpm || ln -s ../../usr/lib/sysimage/rpm var/lib/rpm
%posttrans
# var/lib/rpm migration
if test ! -L var/lib/rpm ; then
# delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
if test -f var/lib/rpm/Packages -o -f var/lib/rpm/Packages.db ; then
echo "migrating rpmdb from /var/lib/rpm to /usr/lib/sysimage/rpm..."
# remove forwards compatible symlink
if test -L usr/lib/sysimage/rpm ; then
rm -f usr/lib/sysimage/rpm
mkdir -p usr/lib/sysimage/rpm
fi
mv -f var/lib/rpm/.[!.]* usr/lib/sysimage/rpm/
mv -f var/lib/rpm/* usr/lib/sysimage/rpm/
fi
test -d var/lib/rpm && rmdir var/lib/rpm
test -e var/lib/rpm || ln -s ../../usr/lib/sysimage/rpm var/lib/rpm
fi
%files -f rpm.lang
%defattr(-,root,root)
%license COPYING
%doc %{_datadir}/doc/packages/rpm
%exclude %{_datadir}/doc/packages/rpm/API
/etc/rpm
%if 0%{?suse_version} < 1550
/bin/rpm
%endif
%{_bindir}/gendiff
%{_bindir}/rpm
%{_bindir}/rpm2cpio
%{_bindir}/rpmdb
%{_bindir}/rpmgraph
%{_bindir}/rpmkeys
%{_bindir}/rpmlua
%{_bindir}/rpmqpack
%{_bindir}/rpmquery
%{_bindir}/rpmsign
%{_bindir}/rpmverify
%{_bindir}/rpmsort
/usr/sbin/rpmconfigcheck
/usr/lib/systemd/system/rpmconfigcheck.service
%dir /usr/lib/rpm
/usr/lib/rpm/macros
/usr/lib/rpm/macros.d/
/usr/lib/rpm/platform/
/usr/lib/rpm/rpm.supp
/usr/lib/rpm/rpmdb_*
/usr/lib/rpm/rpmpopt-*
/usr/lib/rpm/rpmrc
/usr/lib/rpm/rpmsort
/usr/lib/rpm/rpmuncompress
/usr/lib/rpm/suse
/usr/lib/rpm/tgpg
%{_libdir}/rpm-plugins
%{_libdir}/librpm.so.*
%{_libdir}/librpmio.so.*
%{_libdir}/librpmsign.so.*
%doc %{_mandir}/man[18]/*.[18]*
%dir /usr/lib/sysimage
%dir /usr/lib/sysimage/rpm
%ghost /var/lib/rpm
%dir %attr(755,root,root) /usr/src/packages/BUILD
%dir %attr(755,root,root) /usr/src/packages/SPECS
%dir %attr(755,root,root) /usr/src/packages/SOURCES
%dir %attr(755,root,root) /usr/src/packages/SRPMS
%dir %attr(755,root,root) /usr/src/packages/RPMS
%dir %attr(755,root,root) /usr/src/packages/BUILDROOT
%dir %attr(755,root,root) /usr/src/packages/RPMS/*
%{_fillupdir}/sysconfig.services-rpm
%files -n librpmbuild%{librpmsover}
%{_libdir}/librpmbuild.so.%{librpmsover}
%{_libdir}/librpmbuild.so.%{librpmsover}.*
%files build
%defattr(-,root,root)
/usr/bin/rpmbuild
/usr/lib/rpm/pkgconfigdeps.sh
/usr/lib/rpm/ocamldeps.sh
/usr/lib/rpm/rpm_macros_provides.sh
/usr/lib/rpm/elfdeps
/usr/lib/rpm/rpmdeps
/usr/bin/rpmspec
/usr/lib/rpm/brp-*
/usr/lib/rpm/check-*
/usr/lib/rpm/*find*
/usr/lib/rpm/fileattrs/
%exclude /usr/lib/rpm/fileattrs/perl*.attr
/usr/lib/rpm/*.prov
%exclude /usr/lib/rpm/perl.prov
/usr/lib/rpm/*.req
%exclude /usr/lib/rpm/perl.req
%ifarch aarch64 ppc64le riscv64
/usr/lib/rpm/config.guess
/usr/lib/rpm/config.sub
%endif
%files build-perl
%defattr(-,root,root)
/usr/lib/rpm/fileattrs/perl*.attr
/usr/lib/rpm/perl.prov
/usr/lib/rpm/perl.req
%files devel
%defattr(644,root,root,755)
/usr/include/rpm
%{_libdir}/librpm.so
%{_libdir}/librpmbuild.so
%{_libdir}/librpmio.so
%{_libdir}/librpmsign.so
%{_libdir}/pkgconfig/rpm.pc
%{_libdir}/cmake/rpm
%doc %{_datadir}/doc/packages/rpm/API
%changelog

49
rpmconfigcheck Normal file
View File

@ -0,0 +1,49 @@
#! /bin/sh
# Copyright (c) 2002 SUSE GmbH Nuernberg, Germany.
#
# Author: Michael Schroeder <feedback@suse.de>
#
# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
#
configcheckfile=/var/adm/rpmconfigcheck
packages=/var/lib/rpm/Packages.db
if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
echo "Searching for unresolved configuration files"
if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
rpm -qalc | sort | while read line; do
for suffix in new orig save; do
[ -e "${line}.rpm${suffix}" ] && echo "${line}.rpm${suffix}"
done
done > $configcheckfile
else
mv -f $configcheckfile $configcheckfile.old
while read l; do
test -e $l && echo $l
done < $configcheckfile.old > $configcheckfile
fi
if test -s $configcheckfile; then
echo "Please check the following files (see /var/adm/rpmconfigcheck):"
sed -e 's/^/ /' < $configcheckfile
touch $configcheckfile.old
cat $configcheckfile $configcheckfile.old | sort | uniq -d > $configcheckfile.dup
cat $configcheckfile $configcheckfile.dup | sort | uniq -u > $configcheckfile.new
if test -s $configcheckfile.new ; then
(
echo "----------------------------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "rpmconfigcheck"
date
echo "----------------------------------------"
echo "This is a warning message."
echo "rpmconfigcheck has found the following new unresolved config files"
echo "(all files are listed in /var/adm/rpmconfigcheck):"
cat $configcheckfile.new
echo "----------------------------------------"
) >> /var/log/update-messages
fi
fi
rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
fi

10
rpmconfigcheck.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/rpmconfigcheck
[Install]
WantedBy=default.target

12
rpmpopt.diff Normal file
View File

@ -0,0 +1,12 @@
--- rpmpopt.in.orig 2017-12-01 14:58:11.404041985 +0000
+++ rpmpopt.in 2017-12-01 14:59:06.275882759 +0000
@@ -101,7 +101,8 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
%|URL?{URL : %{URL}\n}|\
%|BUGURL?{Bug URL : %{BUGURL}\n}|\
Summary : %{SUMMARY}\n\
-Description :\n%{DESCRIPTION}\n' \
+Description :\n%{DESCRIPTION}\n\
+Distribution: %{DISTRIBUTION}\n' \
--POPTdesc=$"list descriptive information from package(s)"
rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \

120
rpmqpack.diff Normal file
View File

@ -0,0 +1,120 @@
--- docs/man/CMakeLists.txt.orig 2024-02-07 13:36:51.000000000 +0000
+++ docs/man/CMakeLists.txt 2024-02-09 10:36:43.300952115 +0000
@@ -2,6 +2,7 @@ set(core
gendiff.1 rpm2cpio.8
rpm.8 rpmbuild.8 rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
rpmdeps.8 rpmgraph.8 rpmlua.8 rpm-misc.8 rpmsort.8
+ rpmqpack.8
)
set(extra
rpm2archive.8 rpm-plugins.8 rpm-plugin-prioreset.8 rpm-plugin-syslog.8
--- docs/man/rpmqpack.8.orig 2024-02-09 10:36:43.300952115 +0000
+++ docs/man/rpmqpack.8 2024-02-09 10:36:43.300952115 +0000
@@ -0,0 +1,25 @@
+.TH RPMQPACK 8 "Mar 2002"
+.SH NAME
+rpmqpack \- check for installed rpm packages
+
+.SH SYNOPSIS
+.B rpmqpack
+.RI [ pack1 "] [" pack2 ]...
+
+.SH DESCRIPTION
+rpmqpack checks if packages given as arguments are installed in
+the system. It prints each installed package to stdout.
+If no arguments are given all installed packages are printed.
+
+.SH EXIT STATUS
+rpmqpack returns 0 if all given packages are installed, otherwise
+1.
+
+.SH SEE ALSO
+.BR rpm (1)
+
+.SH COPYRIGHT
+2002 SUSE Linux AG Nuernberg, Germany.
+
+.SH AUTHOR
+Michael Schroeder <mls@suse.de>
--- tools/CMakeLists.txt.orig 2024-02-07 13:36:51.000000000 +0000
+++ tools/CMakeLists.txt 2024-02-09 10:37:32.932875459 +0000
@@ -7,6 +7,7 @@ add_executable(rpm2cpio rpm2cpio.c cliut
add_executable(rpmsign rpmsign.c cliutils)
add_executable(rpmbuild rpmbuild.c cliutils)
add_executable(rpmspec rpmspec.c cliutils)
+add_executable(rpmqpack rpmqpack.c)
add_executable(rpmdeps rpmdeps.c)
add_executable(rpmgraph rpmgraph.c)
@@ -60,7 +61,7 @@ foreach(cmd rpmverify rpmquery)
endforeach()
install(TARGETS
rpm rpmdb rpmkeys rpm2cpio rpmsign rpmbuild rpmspec
- rpmlua rpmgraph
+ rpmlua rpmgraph rpmqpack
)
install(TARGETS rpmdeps rpmuncompress DESTINATION ${RPM_CONFIGDIR})
--- tools/rpmqpack.c.orig 2024-02-09 10:36:43.300952115 +0000
+++ tools/rpmqpack.c 2024-02-09 10:36:43.300952115 +0000
@@ -0,0 +1,60 @@
+#include <sys/types.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <rpm/rpmts.h>
+#include <rpm/rpmdb.h>
+#include <rpm/rpmmacro.h>
+
+int
+main(int argc, char **argv)
+{
+ int ret = 0;
+ rpmts ts;
+
+ rpmDefineMacro(NULL, "_dbpath /var/lib/rpm", 0);
+ ts = rpmtsCreate();
+ if (!ts)
+ {
+ fprintf(stderr, "rpmtsCreate failed\n");
+ exit(1);
+ }
+ if (rpmtsOpenDB(ts, O_RDONLY))
+ {
+ perror("rpmtsOpenDB");
+ exit(1);
+ }
+ if (argc <= 1)
+ {
+ rpmdbIndexIterator ii;
+ ii = rpmdbIndexIteratorInit(rpmtsGetRdb(ts), RPMDBI_NAME);
+ if (ii)
+ {
+ const void *key = 0;
+ size_t keylen = 0;
+ while ((rpmdbIndexIteratorNext(ii, &key, &keylen)) == 0)
+ printf("%*.*s\n", (int)keylen, (int)keylen, (char *)key);
+ }
+ rpmdbIndexIteratorFree(ii);
+ }
+ else
+ {
+ argc--;
+ while (argc--)
+ {
+ rpmdbMatchIterator mi;
+ argv++;
+ mi = rpmdbInitIterator(rpmtsGetRdb(ts), RPMDBI_NAME, (void *)*argv, strlen(*argv));
+ if (mi && rpmdbGetIteratorCount(mi))
+ printf("%s\n", *argv);
+ else
+ ret = 1;
+ rpmdbFreeIterator(mi);
+ }
+ }
+ rpmtsFree(ts);
+ return ret;
+}

178
rpmrc.diff Normal file
View File

@ -0,0 +1,178 @@
--- rpmrc.in.orig 2023-09-19 10:10:10.000000000 +0000
+++ rpmrc.in 2023-10-09 12:44:42.206519465 +0000
@@ -12,19 +12,19 @@
# "fat" binary with both archs, for Darwin
optflags: fat -O2 -g -arch i386 -arch ppc
-optflags: i386 -O2 -g -march=i386 -mtune=i686
-optflags: i486 -O2 -g -march=i486
-optflags: i586 -O2 -g -march=i586
-optflags: i686 -O2 -g -march=i686
-optflags: pentium3 -O2 -g -march=pentium3
-optflags: pentium4 -O2 -g -march=pentium4
-optflags: athlon -O2 -g -march=athlon
+optflags: i386 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i486 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i686 -O2 -g -m32 -march=i686 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: pentium3 -O2 -g -m32 -march=pentium3
+optflags: pentium4 -O2 -g -m32 -march=pentium4
+optflags: athlon -O2 -g -m32 -march=athlon
optflags: geode -Os -g -m32 -march=geode
-optflags: ia64 -O2 -g
-optflags: x86_64 -O2 -g
-optflags: x86_64_v2 -O2 -g -march=x86-64-v2
-optflags: x86_64_v3 -O2 -g -march=x86-64-v3
-optflags: x86_64_v4 -O2 -g -march=x86-64-v4
+optflags: ia64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64_v2 -O2 -g -march=x86-64-v2 -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64_v3 -O2 -g -march=x86-64-v3 -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64_v4 -O2 -g -march=x86-64-v4 -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: amd64 -O2 -g
optflags: ia32e -O2 -g
@@ -44,17 +44,18 @@ optflags: sparc64v -O2 -g -m64 -mtune=ni
optflags: m68k -O2 -g -fomit-frame-pointer
-optflags: ppc -O2 -g
-optflags: ppc8260 -O2 -g
-optflags: ppc8560 -O2 -g
-optflags: ppc32dy4 -O2 -g
-optflags: ppciseries -O2 -g
-optflags: ppcpseries -O2 -g
-optflags: ppc64 -O2 -g
-optflags: ppc64le -O2 -g
-optflags: ppc64p7 -O3 -mtune=power7 -mcpu=power7 -g
+optflags: ppc -O2 -g -m32 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc8260 -O2 -g -m32
+optflags: ppc8560 -O2 -g -m32
+optflags: ppc32dy4 -O2 -g -m32
+optflags: ppciseries -O2 -g -m32
+optflags: ppcpseries -O2 -g -m32
+optflags: ppc64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc64le -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc64p7 -O3 -mtune=power7 -mcpu=power7 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: parisc -O2 -g -mpa-risc-1-0
+optflags: hppa -O2 -g -mpa-risc-1-0
optflags: hppa1.0 -O2 -g -mpa-risc-1-0
optflags: hppa1.1 -O2 -g -mpa-risc-1-0
optflags: hppa1.2 -O2 -g -mpa-risc-1-0
@@ -78,10 +79,10 @@ optflags: armv5tl -O2 -g -march=armv5t
optflags: armv5tel -O2 -g -march=armv5te
optflags: armv5tejl -O2 -g -march=armv5te
optflags: armv6l -O2 -g -march=armv6
-optflags: armv6hl -O2 -g -march=armv6 -mfloat-abi=hard -mfpu=vfp
+optflags: armv6hl -O2 -g -march=armv6 -mfloat-abi=hard -mabi=aapcs-linux
optflags: armv7l -O2 -g -march=armv7
-optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16
+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux
optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon
optflags: armv8l -O2 -g -march=armv8-a
optflags: armv8hl -O2 -g -march=armv8-a -mfloat-abi=hard -mfpu=vfpv4
@@ -96,8 +97,8 @@ optflags: atariclone -O2 -g -fomit-frame
optflags: milan -O2 -g -fomit-frame-pointer
optflags: hades -O2 -g -fomit-frame-pointer
-optflags: s390 -O2 -g
-optflags: s390x -O2 -g
+optflags: s390 -O2 -g -m31 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: s390x -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: sh3 -O2 -g
optflags: sh4 -O2 -g -mieee
@@ -309,17 +310,17 @@ os_canon: MacOSX: macosx 21
#############################################################
# For a given uname().machine, the default build arch
-buildarchtranslate: osfmach3_i686: i386
-buildarchtranslate: osfmach3_i586: i386
+buildarchtranslate: osfmach3_i686: i586
+buildarchtranslate: osfmach3_i586: i586
buildarchtranslate: osfmach3_i486: i386
buildarchtranslate: osfmach3_i386: i386
-buildarchtranslate: athlon: i386
-buildarchtranslate: geode: i386
-buildarchtranslate: pentium4: i386
-buildarchtranslate: pentium3: i386
-buildarchtranslate: i686: i386
-buildarchtranslate: i586: i386
+buildarchtranslate: athlon: i586
+buildarchtranslate: geode: i586
+buildarchtranslate: pentium4: i586
+buildarchtranslate: pentium3: i586
+buildarchtranslate: i686: i586
+buildarchtranslate: i586: i586
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386
@@ -341,6 +342,7 @@ buildarchtranslate: sparc64v: sparc64
buildarchtranslate: osfmach3_ppc: ppc
buildarchtranslate: powerpc: ppc
buildarchtranslate: powerppc: ppc
+buildarchtranslate: powerpc64: ppc64
buildarchtranslate: ppc8260: ppc
buildarchtranslate: ppc8560: ppc
buildarchtranslate: ppc32dy4: ppc
@@ -409,6 +411,15 @@ buildarchtranslate: riscv64: riscv64
buildarchtranslate: loongarch64: loongarch64
+buildarchtranslate: parisc: hppa
+buildarchtranslate: hppa2.0: hppa
+buildarchtranslate: hppa64: hppa
+
+buildarchtranslate: armv5l: armv4l
+buildarchtranslate: armv5tel: armv4l
+buildarchtranslate: armv5b: armv4b
+buildarchtranslate: armv5teb: armv4b
+
#############################################################
# Architecture compatibility
@@ -473,16 +484,20 @@ arch_compat: mips64r6el: mipsr6el
arch_compat: hppa2.0: hppa1.2
arch_compat: hppa1.2: hppa1.1
arch_compat: hppa1.1: hppa1.0
-arch_compat: hppa1.0: parisc
+arch_compat: hppa1.0: hppa
+arch_compat: hppa: parisc
arch_compat: parisc: noarch
+arch_compat: armv5teb: armv5b
+arch_compat: armv5b: armv4b
arch_compat: armv4b: noarch
arch_compat: armv8l: armv7l
arch_compat: armv7l: armv6l
arch_compat: armv6l: armv5tejl
arch_compat: armv5tejl: armv5tel
arch_compat: armv5tel: armv5tl
-arch_compat: armv5tl: armv4tl
+arch_compat: armv5tl: armv5l
+arch_compat: armv5l: armv4tl
arch_compat: armv4tl: armv4l
arch_compat: armv4l: armv3l
arch_compat: armv3l: noarch
@@ -505,7 +520,7 @@ arch_compat: i370: noarch
arch_compat: s390: noarch
arch_compat: s390x: s390 noarch
-arch_compat: ia64: noarch
+arch_compat: ia64: i686 noarch
arch_compat: x86_64: amd64 em64t athlon noarch
arch_compat: amd64: x86_64 em64t athlon noarch
@@ -634,7 +649,8 @@ buildarch_compat: armv6hl: noarch
buildarch_compat: hppa2.0: hppa1.2
buildarch_compat: hppa1.2: hppa1.1
buildarch_compat: hppa1.1: hppa1.0
-buildarch_compat: hppa1.0: parisc
+buildarch_compat: hppa1.0: hppa
+buildarch_compat: hppa: parisc
buildarch_compat: parisc: noarch
buildarch_compat: atarist: m68kmint noarch

76
rpmsort Normal file
View File

@ -0,0 +1,76 @@
#!/bin/sh
# rpmsort implemented mostly in Lua
# Copyright (c) 2020 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later
# Author: fvogt@suse.de
# Enhanced by: mwilck@suse.com
rpmsort() {
direction=$1
script='
function parse(ver)
local epoch, version, release = 0, ver, 0
_, eend, e = ver:find("^(%d+):")
if eend then
ver = ver:sub(eend + 1)
version = ver
epoch = e
end
_, _, v, r = ver:find("(.+)%-(.+)$")
if v then
version = v
release = r
end
return epoch, version, release
end
function pkgvercmp(a, b)
local ae, av, ar = parse(a)
local be, bv, br = parse(b)
local ecmp = rpm.vercmp(ae, be)
if ecmp ~= 0 then return ecmp end
local vcmp = rpm.vercmp(av, bv)
if vcmp ~= 0 then return vcmp end
return rpm.vercmp(ar, br)
end
vers = {}
for line in io.stdin:lines() do
table.insert(vers, line)
end
table.sort(vers, function(a, b) return pkgvercmp(a, b) == '"$direction"' end)
print(table.concat(vers, "\n"))
'
rpm --eval "%{lua: ${script}}"
}
usage() {
cat >&2 <<EOF
$0 - sort input according to rpm version sorting conventions
Expects rpm package versions separated by newlines as input and outputs
them sorted according to rpm version sorting conventions, with old versions
at the top.
Options:
-r|--reverse sort backwards
-h|--help print this help
EOF
exit 0
}
DIRECTION=-1
while [ $# -gt 0 ]; do
case $1 in
-r|--reverse) DIRECTION=1;;
-h|--help) usage;;
*) echo "$0: invalid parameter $1 ignored" >&2;;
esac
shift
done
rpmsort "$DIRECTION"

48
rpmsort_reverse.diff Normal file
View File

@ -0,0 +1,48 @@
--- tools/rpmsort.c.orig 2023-10-11 11:38:36.639686209 +0000
+++ tools/rpmsort.c 2023-10-11 12:01:36.112837741 +0000
@@ -119,6 +119,11 @@ exit:
return vercmpflag;
}
+static int package_version_compare_reverse(const void *p, const void *q)
+{
+ return -package_version_compare(p, q);
+}
+
static void add_input(const char *filename, char ***package_names,
size_t *n_package_names)
{
@@ -169,7 +174,13 @@ static void add_input(const char *filena
*n_package_names = n_names;
}
-static struct poptOption optionsTable[] = { POPT_AUTOHELP POPT_TABLEEND };
+static int reverse = 0;
+
+static struct poptOption optionsTable[] = {
+ { "reverse", 'r', POPT_ARG_VAL, &reverse, 1,
+ N_("reverse the result of comparisons"), NULL },
+ POPT_AUTOHELP POPT_TABLEEND
+};
int main(int argc, const char *argv[])
{
@@ -181,7 +192,7 @@ int main(int argc, const char *argv[])
optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
poptSetOtherOptionHelp(optCon, "<FILES>");
- if (poptGetNextOpt(optCon) == 0) {
+ if (poptGetNextOpt(optCon) != -1) {
poptPrintUsage(optCon, stderr, 0);
exit(EXIT_FAILURE);
}
@@ -201,7 +212,8 @@ int main(int argc, const char *argv[])
}
qsort(package_names, n_package_names, sizeof(char *),
- package_version_compare);
+ reverse ? package_version_compare_reverse
+ : package_version_compare);
/* Send sorted list to stdout. */
for (int i = 0; i < n_package_names; i++) {

214
safeugid.diff Normal file
View File

@ -0,0 +1,214 @@
--- ../safeugid.diff 2019-10-02 13:37:13.191868203 +0200
+++ P 2019-10-02 13:36:09.036002978 +0200
@@ -0,0 +1,211 @@
+--- lib/rpmchroot.c.orig 2019-06-26 14:17:31.411985696 +0000
++++ lib/rpmchroot.c 2019-10-02 11:35:58.788024507 +0000
+@@ -126,6 +126,7 @@ int rpmChrootIn(void)
+
+ if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
+ rootState.chrootDone = 1;
++ rpmugChroot(1);
+ } else {
+ rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
+ rc = -1;
+@@ -151,6 +152,7 @@ int rpmChrootOut(void)
+ } else if (rootState.chrootDone == 1) {
+ if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
+ rootState.chrootDone = 0;
++ rpmugChroot(0);
+ } else {
+ rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
+ rc = -1;
+--- lib/rpmug.c.orig 2019-06-26 14:17:31.418985685 +0000
++++ lib/rpmug.c 2019-10-02 11:35:58.788024507 +0000
+@@ -11,6 +11,47 @@
+ #include "lib/rpmug.h"
+ #include "debug.h"
+
++#if defined(__GLIBC__)
++
++static int inchroot;
++
++/*
++ * Unfortunatelly glibc caches nss/nscd data and there is no
++ * good way to flush those caches when we did a chroot(). Thus
++ * we need to parse /etc/passwd and /etc/group ourselfs.
++ */
++static int safe_lookup(const char * file, const char * name)
++{
++ FILE *fp;
++ int l;
++ char buf[4096], *p;
++
++ if (!name || !*name)
++ return -1;
++ l = strlen(name);
++ if ((fp = fopen(file, "r")) == 0)
++ return -1;
++ while ((p = fgets(buf, sizeof(buf), fp)) != 0) {
++ if (*p == '#')
++ continue;
++ while (*p && (*p == ' ' || *p == '\t'))
++ p++;
++ if (strncmp(p, name, l) != 0 || p[l] != ':')
++ continue;
++ p = strchr(p + l + 1, ':');
++ if (!p)
++ continue;
++ fclose(fp);
++ p++;
++ while (*p && (*p == ' ' || *p == '\t'))
++ p++;
++ return atoi(p);
++ }
++ fclose(fp);
++ return -1;
++}
++#endif
++
+ /*
+ * These really ought to use hash tables. I just made the
+ * guess that most files would be owned by root or the same person/group
+@@ -44,17 +85,28 @@ int rpmugUid(const char * thisUname, uid
+ lastUnameAlloced = thisUnameLen + 10;
+ lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
+ }
+- strcpy(lastUname, thisUname);
+
+- pwent = getpwnam(thisUname);
+- if (pwent == NULL) {
+- /* FIX: shrug */
+- endpwent();
++#if defined(__GLIBC__)
++ if (inchroot) {
++ int uid = safe_lookup("/etc/passwd", thisUname);
++ if (uid < 0)
++ return -1;
++ lastUid = uid;
++ } else
++#endif
++ {
+ pwent = getpwnam(thisUname);
+- if (pwent == NULL) return -1;
++ if (pwent == NULL) {
++ /* FIX: shrug */
++ endpwent();
++ pwent = getpwnam(thisUname);
++ if (pwent == NULL) return -1;
++ }
++ lastUid = pwent->pw_uid;
+ }
+
+- lastUid = pwent->pw_uid;
++ strcpy(lastUname, thisUname);
++ lastUnameLen = thisUnameLen;
+ }
+
+ *uid = lastUid;
+@@ -87,18 +139,29 @@ int rpmugGid(const char * thisGname, gid
+ lastGnameAlloced = thisGnameLen + 10;
+ lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
+ }
+- strcpy(lastGname, thisGname);
+
+- grent = getgrnam(thisGname);
+- if (grent == NULL) {
+- /* FIX: shrug */
+- endgrent();
++#if defined(__GLIBC__)
++ if (inchroot) {
++ int gid = safe_lookup("/etc/group", thisGname);
++ if (gid < 0)
++ return -1;
++ lastGid = gid;
++ } else
++#endif
++ {
+ grent = getgrnam(thisGname);
+ if (grent == NULL) {
+- return -1;
++ /* FIX: shrug */
++ endgrent();
++ grent = getgrnam(thisGname);
++ if (grent == NULL) {
++ return -1;
++ }
+ }
++ lastGid = grent->gr_gid;
+ }
+- lastGid = grent->gr_gid;
++ strcpy(lastGname, thisGname);
++ lastGnameLen = thisGnameLen;
+ }
+
+ *gid = lastGid;
+@@ -110,7 +173,7 @@ const char * rpmugUname(uid_t uid)
+ {
+ static uid_t lastUid = (uid_t) -1;
+ static char * lastUname = NULL;
+- static size_t lastUnameLen = 0;
++ static size_t lastUnameAlloced = 0;
+
+ if (uid == (uid_t) -1) {
+ lastUid = (uid_t) -1;
+@@ -127,9 +190,9 @@ const char * rpmugUname(uid_t uid)
+
+ lastUid = uid;
+ len = strlen(pwent->pw_name);
+- if (lastUnameLen < len + 1) {
+- lastUnameLen = len + 20;
+- lastUname = xrealloc(lastUname, lastUnameLen);
++ if (lastUnameAlloced < len + 1) {
++ lastUnameAlloced = len + 20;
++ lastUname = xrealloc(lastUname, lastUnameAlloced);
+ }
+ strcpy(lastUname, pwent->pw_name);
+
+@@ -141,7 +204,7 @@ const char * rpmugGname(gid_t gid)
+ {
+ static gid_t lastGid = (gid_t) -1;
+ static char * lastGname = NULL;
+- static size_t lastGnameLen = 0;
++ static size_t lastGnameAlloced = 0;
+
+ if (gid == (gid_t) -1) {
+ lastGid = (gid_t) -1;
+@@ -158,9 +221,9 @@ const char * rpmugGname(gid_t gid)
+
+ lastGid = gid;
+ len = strlen(grent->gr_name);
+- if (lastGnameLen < len + 1) {
+- lastGnameLen = len + 20;
+- lastGname = xrealloc(lastGname, lastGnameLen);
++ if (lastGnameAlloced < len + 1) {
++ lastGnameAlloced = len + 20;
++ lastGname = xrealloc(lastGname, lastGnameAlloced);
+ }
+ strcpy(lastGname, grent->gr_name);
+
+@@ -192,3 +255,16 @@ void rpmugFree(void)
+ rpmugUname(-1);
+ rpmugGname(-1);
+ }
++
++void rpmugChroot(int in)
++{
++ /* tell libc to drop caches / file descriptors */
++ endpwent();
++ endgrent();
++ /* drop our own caches */
++ rpmugUid(NULL, NULL);
++ rpmugGid(NULL, NULL);
++#if defined(__GLIBC__)
++ inchroot = in;
++#endif
++}
+--- lib/rpmug.h.orig 2019-06-26 14:17:31.418985685 +0000
++++ lib/rpmug.h 2019-10-02 11:35:58.788024507 +0000
+@@ -15,4 +15,6 @@ int rpmugInit(void);
+
+ void rpmugFree(void);
+
++void rpmugChroot(int in);
++
+ #endif /* _RPMUG_H */

View File

@ -0,0 +1,22 @@
--- plugins/selinux.c.orig 2023-12-12 10:57:31.000000000 +0000
+++ plugins/selinux.c 2023-12-13 13:28:30.509647090 +0000
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
#include "system.h"
#include <selinux/selinux.h>
@@ -166,6 +168,13 @@ static rpmRC selinux_fsm_file_prepare(rp
if (conrc == 0 || (conrc < 0 && errno == EOPNOTSUPP))
rc = RPMRC_OK;
+ else {
+ char *tup = getenv("TRANSACTIONAL_UPDATE");
+ if (tup != NULL && !strncmp(tup, "true", 4)) {
+ rpmlog(RPMLOG_DEBUG, "lsetfilecon failed, will be healed upon reboot (transactional update): (%s, %s)\n", path, scon);
+ rc = RPMRC_OK;
+ }
+ }
rpmlog(loglvl(rc != RPMRC_OK), "lsetfilecon: (%d %s, %s) %s\n",
fd, path, scon, (conrc < 0 ? strerror(errno) : ""));

10
specfilemacro.diff Normal file
View File

@ -0,0 +1,10 @@
--- build/parseSpec.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ build/parseSpec.c 2013-07-12 12:04:11.000000000 +0000
@@ -561,6 +561,7 @@ static rpmSpec parseSpec(const char *spe
spec = newSpec();
spec->specFile = rpmGetPath(specFile, NULL);
+ addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC);
pushOFI(spec, spec->specFile);
/* If buildRoot not specified, use default %{buildroot} */
if (buildRoot) {

17
sysconfig.services-rpm Normal file
View File

@ -0,0 +1,17 @@
## Path: System/Services
## Type: yesno
## Default: no
#
# Do you want to disable the automatic restart of services when
# a new version gets installed?
#
DISABLE_RESTART_ON_UPDATE="no"
## Type: yesno
## Default: no
#
# Do you want to disable the automatic shutdown of services when
# the corresponding package gets erased?
#
DISABLE_STOP_ON_REMOVAL="no"

View File

@ -0,0 +1,11 @@
--- macros.in.orig 2021-08-20 08:44:56.264259007 +0000
+++ macros.in 2021-09-23 18:57:26.654059458 +0000
@@ -140,7 +140,7 @@
%_buildshell /bin/sh
# The location of the rpm database file(s).
-%_dbpath %{_var}/lib/rpm
+%_dbpath %{_usr}/lib/sysimage/rpm
# The location of the rpm database file(s) after "rpm --rebuilddb".
%_dbpath_rebuild %{_dbpath}

10
weakdepscompat.diff Normal file
View File

@ -0,0 +1,10 @@
--- build/parsePreamble.c.orig 2023-10-09 13:08:54.579843386 +0000
+++ build/parsePreamble.c 2023-10-09 13:09:57.843727870 +0000
@@ -351,6 +351,7 @@ static struct tokenBits_s const installS
{ "posttrans", RPMSENSE_POSTTRANS },
{ "preuntrans", RPMSENSE_PREUNTRANS },
{ "postuntrans", RPMSENSE_POSTUNTRANS },
+ { "hint", RPMSENSE_MISSINGOK },
{ NULL, 0 }
};

68
zstdpool.diff Normal file
View File

@ -0,0 +1,68 @@
--- rpmio/rpmio.c.orig 2023-09-19 10:10:10.000000000 +0000
+++ rpmio/rpmio.c 2023-10-10 12:09:28.171040124 +0000
@@ -8,6 +8,7 @@
#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
+#include <pthread.h>
#include <sys/resource.h>
#include <rpm/rpmlog.h>
@@ -997,6 +998,7 @@ static const FDIO_t lzdio = &lzdio_s;
/* Support for ZSTD library. */
#ifdef HAVE_ZSTD
+#define ZSTD_STATIC_LINKING_ONLY
#include <zstd.h>
typedef struct rpmzstd_s {
@@ -1011,6 +1013,29 @@ typedef struct rpmzstd_s {
ZSTD_outBuffer zob; /*!< ZSTD_outBuffer */
} * rpmzstd;
+#if ZSTD_VERSION_NUMBER >= 10407
+
+static pthread_once_t zstdThreadPoolCreated = PTHREAD_ONCE_INIT;
+static ZSTD_threadPool *zstdThreadPool;
+static int zstdThreadPoolThreads;
+
+static void zstdCreateThreadPool(void)
+{
+ int numthreads = rpmExpandNumeric("%{?_zstd_pool_threads}%{?!_zstd_pool_threads:-1}");
+ if (numthreads == 0)
+ numthreads = rpmExpandNumeric("%{getncpus:thread}");
+ if (numthreads > 0) {
+ zstdThreadPoolThreads = numthreads;
+ zstdThreadPool = ZSTD_createThreadPool(numthreads);
+ if (!zstdThreadPool)
+ rpmlog(RPMLOG_WARNING, "Could not create zstd thread pool for %d threads\n", numthreads);
+ else
+ rpmlog(RPMLOG_DEBUG, "Created zstd thread pool for %d threads\n", numthreads);
+ }
+}
+
+#endif
+
static rpmzstd rpmzstdNew(int fdno, const char *fmode)
{
int flags = 0;
@@ -1116,8 +1141,18 @@ static rpmzstd rpmzstdNew(int fdno, cons
}
if (threads > 0) {
- if (ZSTD_isError (ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, threads)))
+ if (ZSTD_isError (ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, threads))) {
rpmlog(RPMLOG_DEBUG, "zstd library does not support multi-threading\n");
+ } else {
+#if ZSTD_VERSION_NUMBER >= 10407
+ pthread_once(&zstdThreadPoolCreated, zstdCreateThreadPool);
+ if (zstdThreadPool) {
+ if (threads > zstdThreadPoolThreads)
+ ZSTD_CCtx_setParameter(_stream, ZSTD_c_nbWorkers, zstdThreadPoolThreads);
+ ZSTD_CCtx_refThreadPool(_stream, zstdThreadPool);
+ }
+#endif
+ }
}
nb = ZSTD_CStreamOutSize();

14
zstdthreaded.diff Normal file
View File

@ -0,0 +1,14 @@
--- macros.in.orig 2021-10-15 07:40:15.601628187 +0000
+++ macros.in 2021-10-15 07:42:23.557282503 +0000
@@ -374,7 +374,10 @@ package or when debugging this package.\
# "w.ufdio" uncompressed
#
#%_source_payload w9.gzdio
-%_binary_payload w19.zstdio
+%_binary_payload w19T0.zstdio
+
+# use a pool with 8 threads for threaded zstd compression
+%_zstd_pool_threads 8
# Algorithm to use for generating file checksum digests on build.
# If not specified or 0, MD5 is used.