summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch b/meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch
new file mode 100644
index 0000000000..235f878aad
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch
@@ -0,0 +1,55 @@
1When running do_package_write_deb, we have trees of hardlinked files
2such as the dbg source files in ${PN}-dbg. If something makes another
3copy of one of those files (or deletes one), the number of links a file
4has changes and tar can notice this, e.g.:
5
6| DEBUG: Executing python function do_package_deb
7| 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'.
8| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
9| dpkg-deb: error: subprocess tar -cf returned error exit status 1
10
11Tar returns an error of 1 when files 'change' and other errors codes
12in other error cases. We tweak dpkg-deb here so that it ignores an exit
13code of 1 from tar. The files don't really change (and we have locking in
14place to avoid that kind of issue).
15
16Upsteam-Status: Inappropriate
17RP 2015/3/27
18
19Signed-off-by: Saul Wold <sgw@linux.intel.com>
20
21Index: dpkg-1.17.4/dpkg-deb/build.c
22===================================================================
23--- dpkg-1.17.4.orig/dpkg-deb/build.c
24+++ dpkg-1.17.4/dpkg-deb/build.c
25@@ -443,7 +443,7 @@ do_build(const char *const *argv)
26 bool subdir;
27 char *tfbuf;
28 int arfd;
29- int p1[2], p2[2], gzfd;
30+ int p1[2], p2[2], gzfd, rc;
31 pid_t c1, c2;
32
33 /* Decode our arguments. */
34@@ -536,7 +536,9 @@ do_build(const char *const *argv)
35 }
36 close(p1[0]);
37 subproc_wait_check(c2, "gzip -9c", 0);
38- subproc_wait_check(c1, "tar -cf", 0);
39+ rc = subproc_wait_check(c1, "tar -cf", PROCNOERR);
40+ if (rc && rc != 1)
41+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
42
43 if (lseek(gzfd, 0, SEEK_SET))
44 ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
45@@ -619,7 +621,9 @@ do_build(const char *const *argv)
46 /* All done, clean up wait for tar and gzip to finish their job. */
47 close(p1[1]);
48 subproc_wait_check(c2, _("<compress> from tar -cf"), 0);
49- subproc_wait_check(c1, "tar -cf", 0);
50+ rc = subproc_wait_check(c1, "tar -cf", PROCNOERR);
51+ if (rc && rc != 1)
52+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
53 /* Okay, we have data.tar as well now, add it to the ar wrapper. */
54 if (deb_format.major == 2) {
55 char datamember[16 + 1];