summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-28 08:50:27 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-17 22:39:32 +0100
commitf77133783e5145858ac94b9bae1576852a7e838d (patch)
tree4a659ecfae95139e5d7305f2b9a9ef04970ef629 /meta/recipes-devtools
parent29855df01e6480ac09c7bd088e79ae64fe45886e (diff)
downloadpoky-f77133783e5145858ac94b9bae1576852a7e838d.tar.gz
dpkg-native: Avoid 'file changed' errors from tar
Hardlink count duing do_package_write_deb can change causing dpkg-deb failures. We don't care about this error case so avoid it by checking the tar exit code. [YOCTO #7529] (From OE-Core rev: 8ee36a5f2f9367550d28bf271afc53bca6ff3d5f) (From OE-Core rev: bcb124931af57dc2f9d8fe9cbbabd5f8ee58e414) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg.inc2
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch54
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index f6add4b89e..0f73ddd6fe 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -5,6 +5,8 @@ SECTION = "base"
5SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \ 5SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \
6 file://ignore_extra_fields.patch" 6 file://ignore_extra_fields.patch"
7 7
8SRC_URI_append_class-native = " file://tar-error-code.patch"
9
8DEPENDS = "zlib bzip2 perl ncurses" 10DEPENDS = "zlib bzip2 perl ncurses"
9DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native" 11DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
10RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl" 12RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
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..7be2090206
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch
@@ -0,0 +1,54 @@
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
19Index: dpkg-1.17.21/dpkg-deb/build.c
20===================================================================
21--- dpkg-1.17.21.orig/dpkg-deb/build.c
22+++ dpkg-1.17.21/dpkg-deb/build.c
23@@ -398,7 +398,7 @@ do_build(const char *const *argv)
24 bool subdir;
25 char *tfbuf;
26 int arfd;
27- int p1[2], p2[2], gzfd;
28+ int p1[2], p2[2], gzfd, rc;
29 pid_t c1, c2;
30
31 /* Decode our arguments. */
32@@ -493,7 +493,9 @@ do_build(const char *const *argv)
33 }
34 close(p1[0]);
35 subproc_reap(c2, "gzip -9c", 0);
36- subproc_reap(c1, "tar -cf", 0);
37+ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
38+ if (rc && rc != 1)
39+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
40
41 if (lseek(gzfd, 0, SEEK_SET))
42 ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
43@@ -581,7 +583,10 @@ do_build(const char *const *argv)
44 /* All done, clean up wait for tar and gzip to finish their job. */
45 close(p1[1]);
46 subproc_reap(c2, _("<compress> from tar -cf"), 0);
47- subproc_reap(c1, "tar -cf", 0);
48+ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
49+ if (rc && rc != 1)
50+ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
51+
52 /* Okay, we have data.tar as well now, add it to the ar wrapper. */
53 if (deb_format.major == 2) {
54 char datamember[16 + 1];