blob: 6967ef498026799dfe407e440e5f44fe3356e99e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From d14ffd786993da60ca84c4812da8a6594a8c764e Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 26 Aug 2015 15:48:13 +0300
4Subject: [PATCH 1/5] When running do_package_write_deb, we have trees of
5 hardlinked files such as the dbg source files in ${PN}-dbg. If something
6 makes another copy of one of those files (or deletes one), the number of
7 links a file has changes and tar can notice this, e.g.:
8
9| DEBUG: Executing python function do_package_deb
10| 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'.
11| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
12| dpkg-deb: error: subprocess tar -cf returned error exit status 1
13
14Tar returns an error of 1 when files 'change' and other errors codes
15in other error cases. We tweak dpkg-deb here so that it ignores an exit
16code of 1 from tar. The files don't really change (and we have locking in
17place to avoid that kind of issue).
18
19Upstream-Status: Inappropriate
20RP 2015/3/27
21---
22 dpkg-deb/build.c | 11 ++++++++---
23 1 file changed, 8 insertions(+), 3 deletions(-)
24
25diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
26index ea3d861..1589927 100644
27--- a/dpkg-deb/build.c
28+++ b/dpkg-deb/build.c
29@@ -458,7 +458,7 @@ do_build(const char *const *argv)
30 char *debar;
31 char *tfbuf;
32 int arfd;
33- int p1[2], p2[2], gzfd;
34+ int p1[2], p2[2], gzfd, rc;
35 pid_t c1, c2;
36
37 /* Decode our arguments. */
38@@ -538,7 +538,9 @@ do_build(const char *const *argv)
39 }
40 close(p1[0]);
41 subproc_reap(c2, _("<compress> from tar -cf"), 0);
42- subproc_reap(c1, "tar -cf", 0);
43+ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
44+ if (rc && rc != 1)
45+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
46
47 if (lseek(gzfd, 0, SEEK_SET))
48 ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
49@@ -626,7 +628,10 @@ do_build(const char *const *argv)
50 /* All done, clean up wait for tar and <compress> to finish their job. */
51 close(p1[1]);
52 subproc_reap(c2, _("<compress> from tar -cf"), 0);
53- subproc_reap(c1, "tar -cf", 0);
54+ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
55+ if (rc && rc != 1)
56+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
57+
58 /* Okay, we have data.tar as well now, add it to the ar wrapper. */
59 if (deb_format.major == 2) {
60 char datamember[16 + 1];
61--
622.1.4
63