blob: ffe520c5130a7448708774ccfd103fcd61ebb938 [file] [log] [blame]
Andrew Geisslerb7d28612020-07-24 16:15:54 -05001From 15b081cc8bead80c493ab83369ecb3345a24a3dc Mon Sep 17 00:00:00 2001
Andrew Geisslerd25ed322020-06-27 00:28:28 -05002From: Paul Eggleton <paul.eggleton@linux.microsoft.com>
3Date: Tue, 16 Jun 2020 03:57:25 +0000
4Subject: [PATCH] build.c: ignore return of 1 from tar -cf
5
6When running do_package_write_deb, we have trees of hardlinked files
7such as the dbg source files in ${PN}-dbg. If something makes another
8copy of one of those files (or deletes one), the number of links a file
9has changes and tar can notice this, e.g.:
10
11| DEBUG: Executing python function do_package_deb
12| 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'.
13| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
14| dpkg-deb: error: subprocess tar -cf returned error exit status 1
15
16Tar returns an error of 1 when files 'change' and other errors codes
17in other error cases. We tweak dpkg-deb here so that it ignores an exit
18code of 1 from tar. The files don't really change (and we have locking in
19place to avoid that kind of issue).
20
21Upstream-Status: Inappropriate [OE specific]
22
23Original patch by RP 2015/3/27, rebased by Paul Eggleton
24
25Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
Andrew Geisslerb7d28612020-07-24 16:15:54 -050026
Andrew Geisslerd25ed322020-06-27 00:28:28 -050027---
28 dpkg-deb/build.c | 5 ++++-
29 1 file changed, 4 insertions(+), 1 deletion(-)
30
31diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
Andrew Geisslerb7d28612020-07-24 16:15:54 -050032index 8436839cd..6b44a36f7 100644
Andrew Geisslerd25ed322020-06-27 00:28:28 -050033--- a/dpkg-deb/build.c
34+++ b/dpkg-deb/build.c
Andrew Geisslerb7d28612020-07-24 16:15:54 -050035@@ -434,6 +434,7 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
Andrew Geisslerd25ed322020-06-27 00:28:28 -050036 {
37 int pipe_filenames[2], pipe_tarball[2];
38 pid_t pid_tar, pid_comp;
39+ int rc;
40
41 /* Fork off a tar. We will feed it a list of filenames on stdin later. */
42 m_pipe(pipe_filenames);
Andrew Geisslerb7d28612020-07-24 16:15:54 -050043@@ -486,7 +487,9 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
Andrew Geisslerd25ed322020-06-27 00:28:28 -050044 /* All done, clean up wait for tar and <compress> to finish their job. */
45 close(pipe_filenames[1]);
46 subproc_reap(pid_comp, _("<compress> from tar -cf"), 0);
47- subproc_reap(pid_tar, "tar -cf", 0);
48+ rc = subproc_reap(pid_tar, "tar -cf", SUBPROC_RETERROR);
49+ if (rc && rc != 1)
50+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
51 }
52
53 static time_t