From d6f5fed6bc56e1f3b885a796a43aa2868ace57bc Mon Sep 17 00:00:00 2001
|
From: Paul Eggleton <paul.eggleton@linux.microsoft.com>
|
Date: Tue, 16 Jun 2020 03:57:25 +0000
|
Subject: [PATCH] build.c: ignore return of 1 from tar -cf
|
|
When running do_package_write_deb, we have trees of hardlinked files
|
such as the dbg source files in ${PN}-dbg. If something makes another
|
copy of one of those files (or deletes one), the number of links a file
|
has changes and tar can notice this, e.g.:
|
|
| DEBUG: Executing python function do_package_deb
|
| dpkg-deb: building package `sed-ptest' in `/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'.
|
| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
|
| dpkg-deb: error: subprocess tar -cf returned error exit status 1
|
|
Tar returns an error of 1 when files 'change' and other errors codes
|
in other error cases. We tweak dpkg-deb here so that it ignores an exit
|
code of 1 from tar. The files don't really change (and we have locking in
|
place to avoid that kind of issue).
|
|
Upstream-Status: Inappropriate [OE specific]
|
|
Original patch by RP 2015/3/27, rebased by Paul Eggleton
|
|
Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
|
|
---
|
dpkg-deb/build.c | 5 ++++-
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
|
index d13a21c1e..059f2be6d 100644
|
--- a/dpkg-deb/build.c
|
+++ b/dpkg-deb/build.c
|
@@ -480,6 +480,7 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
|
{
|
int pipe_filenames[2], pipe_tarball[2];
|
pid_t pid_tar, pid_comp;
|
+ int rc;
|
|
/* Fork off a tar. We will feed it a list of filenames on stdin later. */
|
m_pipe(pipe_filenames);
|
@@ -532,7 +533,9 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
|
/* All done, clean up wait for tar and <compress> to finish their job. */
|
close(pipe_filenames[1]);
|
subproc_reap(pid_comp, _("<compress> from tar -cf"), 0);
|
- subproc_reap(pid_tar, "tar -cf", 0);
|
+ rc = subproc_reap(pid_tar, "tar -cf", SUBPROC_RETERROR);
|
+ if (rc && rc != 1)
|
+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
|
}
|
|
static intmax_t
|