Accepting request 842515 from Base:System

- Backport FA_TOUCH fixes from upsteam [bnc#1175025] [bnc#1177428]

OBS-URL: https://build.opensuse.org/request/show/842515
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=283
This commit is contained in:
Dominique Leuenberger 2020-10-22 12:19:52 +00:00 committed by Git OBS Bridge
commit 7a0da25abb
4 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From a20edbb561f74ba608c0aa36be637e7245e596b5 Mon Sep 17 00:00:00 2001
From: ggardet <guillaume.gardet@opensuse.org>
Date: Fri, 9 Oct 2020 13:10:09 +0200
Subject: [PATCH] Do not fail if there is no "$temp"/res.* file
find-debuginfo is multi-threaded and rpm runs
scripts usually with "-e" to abort on error.
If the debug-splitting tool fails, that job will abort.
But if you have X files that are problematic in the tree,
and you have X or less jobs, find-debuginfo will abort
as no single res.$number has been written.
But if you have more than X jobs, the build will succeed,
which makes the whole process random.
This commit remove this randomness.
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -498,6 +498,7 @@ else
wait
)
for f in "$temp"/res.*; do
+ test -f "$f" || continue
res=$(< "$f")
if [ "$res" != "0" ]; then
exit 1

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Oct 19 11:53:00 CEST 2020 - mls@suse.de
- Backport FA_TOUCH fixes from upsteam [bnc#1175025] [bnc#1177428]
* new patch: touch_backport.diff
-------------------------------------------------------------------
Fri Oct 9 13:28:33 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add patch to fix finddebuginfo when no res.* file are found:
* finddebuginfo-check-res-file.patch
-------------------------------------------------------------------
Mon Jul 6 16:35:40 CEST 2020 - Martin Liška <mliska@suse.cz>

View File

@ -134,6 +134,8 @@ Patch122: db_conversion.diff
Patch123: initgcrypt.diff
Patch124: gcryptdsa2.diff
Patch125: ndb_backport2.diff
Patch126: touch_backport.diff
Patch127: finddebuginfo-check-res-file.patch
Patch6464: auto-config-update-aarch64-ppc64le.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
@ -259,6 +261,7 @@ cp config.guess config.sub db/dist/
%patch -P 100 -P 102 -P 103
%patch -P 109 -P 117
%patch -P 118 -P 119 -P 120 -P 121 -P 122 -P 123 -P 124 -P 125
%patch -P 126 -P 127
%ifarch aarch64 ppc64le riscv64
%patch6464

64
touch_backport.diff Normal file
View File

@ -0,0 +1,64 @@
--- ./lib/fsm.c.orig 2019-06-26 14:17:31.407985702 +0000
+++ ./lib/fsm.c 2020-10-19 09:49:02.709129763 +0000
@@ -926,10 +926,6 @@ int rpmPackageFilesInstall(rpmts ts, rpm
if (!skip) {
int setmeta = 1;
- /* When touching we don't need any of this... */
- if (action == FA_TOUCH)
- goto touch;
-
/* Directories replacing something need early backup */
if (!suffix) {
rc = fsmBackup(fi, action);
@@ -941,6 +937,17 @@ int rpmPackageFilesInstall(rpmts ts, rpm
rc = RPMERR_ENOENT;
}
+ /* See if the file was removed while our attention was elsewhere */
+ if (rc == RPMERR_ENOENT && action == FA_TOUCH) {
+ rpmlog(RPMLOG_DEBUG, "file %s vanished unexpectedly\n", fpath);
+ action = FA_CREATE;
+ fsmDebug(fpath, action, &sb);
+ }
+
+ /* When touching we don't need any of this... */
+ if (action == FA_TOUCH)
+ goto touch;
+
if (S_ISREG(sb.st_mode)) {
if (rc == RPMERR_ENOENT) {
rc = fsmMkfile(fi, fpath, files, psm, nodigest,
--- ./lib/transaction.c.orig 2020-10-19 09:47:25.761418056 +0000
+++ ./lib/transaction.c 2020-10-19 09:48:20.837254277 +0000
@@ -483,13 +483,6 @@ static void handleInstInstalledFile(cons
rpmfsSetAction(fs, fx, action);
}
- /* Skip already existing files - if 'minimize_writes' is set. */
- if ((!isCfgFile) && (rpmfsGetAction(fs, fx) == FA_UNKNOWN) && ts->min_writes) {
- if (rpmfileContentsEqual(otherFi, ofx, fi, fx)) {
- rpmfsSetAction(fs, fx, FA_TOUCH);
- }
- }
-
otherFileSize = rpmfilesFSize(otherFi, ofx);
/* Only account for the last file of a hardlink set */
@@ -499,6 +492,16 @@ static void handleInstInstalledFile(cons
/* Add one to make sure the size is not zero */
rpmfilesSetFReplacedSize(fi, fx, otherFileSize + 1);
+
+ /* Just touch already existing files if minimize_writes is enabled */
+ if (ts->min_writes) {
+ if ((!isCfgFile) && (rpmfsGetAction(fs, fx) == FA_UNKNOWN)) {
+ /* XXX fsm can't handle FA_TOUCH of hardlinked files */
+ int nolinks = (nlink == 1 && rpmfilesFNlink(fi, fx) == 1);
+ if (nolinks && rpmfileContentsEqual(otherFi, ofx, fi, fx))
+ rpmfsSetAction(fs, fx, FA_TOUCH);
+ }
+ }
}
/**