dpkg: update to 1.18.2

check_snprintf.patch has been dropped, because it seems to fix a problem
that doesn't anymore exist, and doesn't have any description of what the
problem was and how was it fixed.

tarfix.patch has been merged upstream.

The rest of the patches have been rebased to the new upstream release

(From OE-Core rev: c11b2be13a6d5e34f2baed4b8ee8ccd66438c1de)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2015-08-28 15:18:51 +03:00
committed by Richard Purdie
parent eb45cd659b
commit e444e84935
12 changed files with 146 additions and 185 deletions

View File

@@ -4,7 +4,7 @@ SECTION = "base"
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz" SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
SRC_URI_append_class-native = " file://tar-error-code.patch" SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
DEPENDS = "zlib bzip2 perl ncurses" DEPENDS = "zlib bzip2 perl ncurses"
DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native" DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"

View File

@@ -1,7 +1,10 @@
When running do_package_write_deb, we have trees of hardlinked files From d14ffd786993da60ca84c4812da8a6594a8c764e Mon Sep 17 00:00:00 2001
such as the dbg source files in ${PN}-dbg. If something makes another From: Alexander Kanavin <alex.kanavin@gmail.com>
copy of one of those files (or deletes one), the number of links a file Date: Wed, 26 Aug 2015 15:48:13 +0300
has changes and tar can notice this, e.g.: Subject: [PATCH 1/5] 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 | 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'. | 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'.
@@ -15,13 +18,16 @@ place to avoid that kind of issue).
Upstream-Status: Inappropriate Upstream-Status: Inappropriate
RP 2015/3/27 RP 2015/3/27
---
dpkg-deb/build.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Index: dpkg-1.17.21/dpkg-deb/build.c diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
=================================================================== index ea3d861..1589927 100644
--- dpkg-1.17.21.orig/dpkg-deb/build.c --- a/dpkg-deb/build.c
+++ dpkg-1.17.21/dpkg-deb/build.c +++ b/dpkg-deb/build.c
@@ -398,7 +398,7 @@ do_build(const char *const *argv) @@ -458,7 +458,7 @@ do_build(const char *const *argv)
bool subdir; char *debar;
char *tfbuf; char *tfbuf;
int arfd; int arfd;
- int p1[2], p2[2], gzfd; - int p1[2], p2[2], gzfd;
@@ -29,10 +35,10 @@ Index: dpkg-1.17.21/dpkg-deb/build.c
pid_t c1, c2; pid_t c1, c2;
/* Decode our arguments. */ /* Decode our arguments. */
@@ -493,7 +493,9 @@ do_build(const char *const *argv) @@ -538,7 +538,9 @@ do_build(const char *const *argv)
} }
close(p1[0]); close(p1[0]);
subproc_reap(c2, "gzip -9c", 0); subproc_reap(c2, _("<compress> from tar -cf"), 0);
- subproc_reap(c1, "tar -cf", 0); - subproc_reap(c1, "tar -cf", 0);
+ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR); + rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
+ if (rc && rc != 1) + if (rc && rc != 1)
@@ -40,8 +46,8 @@ Index: dpkg-1.17.21/dpkg-deb/build.c
if (lseek(gzfd, 0, SEEK_SET)) if (lseek(gzfd, 0, SEEK_SET))
ohshite(_("failed to rewind temporary file (%s)"), _("control member")); ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
@@ -581,7 +583,10 @@ do_build(const char *const *argv) @@ -626,7 +628,10 @@ do_build(const char *const *argv)
/* All done, clean up wait for tar and gzip to finish their job. */ /* All done, clean up wait for tar and <compress> to finish their job. */
close(p1[1]); close(p1[1]);
subproc_reap(c2, _("<compress> from tar -cf"), 0); subproc_reap(c2, _("<compress> from tar -cf"), 0);
- subproc_reap(c1, "tar -cf", 0); - subproc_reap(c1, "tar -cf", 0);
@@ -52,3 +58,6 @@ Index: dpkg-1.17.21/dpkg-deb/build.c
/* Okay, we have data.tar as well now, add it to the ar wrapper. */ /* Okay, we have data.tar as well now, add it to the ar wrapper. */
if (deb_format.major == 2) { if (deb_format.major == 2) {
char datamember[16 + 1]; char datamember[16 + 1];
--
2.1.4

View File

@@ -0,0 +1,38 @@
From b4ea54158c399874e12394ebc91afe98954695e2 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Wed, 26 Aug 2015 16:16:16 +0300
Subject: [PATCH 2/5] Adapt to linux-wrs kernel version, which has character
'_' inside. Remove the first-char-digit-check (as the 1.15.8.5 version does).
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Upstream-Status: Inappropriate [embedded specific]
---
lib/dpkg/parsehelp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
index 79b2908..7758aa5 100644
--- a/lib/dpkg/parsehelp.c
+++ b/lib/dpkg/parsehelp.c
@@ -235,14 +235,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
/* XXX: Would be faster to use something like cisversion and cisrevision. */
ptr = rversion->version;
- if (*ptr && !c_isdigit(*ptr++))
- return dpkg_put_warn(err, _("version number does not start with digit"));
for (; *ptr; ptr++) {
- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
+ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
return dpkg_put_warn(err, _("invalid character in version number"));
}
for (ptr = rversion->revision; *ptr; ptr++) {
- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".+~", *ptr) == NULL)
+ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
return dpkg_put_warn(err, _("invalid character in revision number"));
}
--
2.1.4

View File

@@ -1,16 +1,22 @@
Our pre/postinsts expect $D to be set when running in a sysroot and From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
don't expect a chroot. This matches up our system expectations with From: Alexander Kanavin <alex.kanavin@gmail.com>
what dpkg does. Date: Wed, 26 Aug 2015 16:25:45 +0300
Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
sysroot and don't expect a chroot. This matches up our system expectations
with what dpkg does.
Upstream-Status: Inappropriate [OE Specific] Upstream-Status: Inappropriate [OE Specific]
RP 2011/12/07 RP 2011/12/07
---
src/script.c | 31 ++-----------------------------
1 file changed, 2 insertions(+), 29 deletions(-)
Index: dpkg-1.17.1/src/script.c diff --git a/src/script.c b/src/script.c
=================================================================== index a958145..24c49f9 100644
--- dpkg-1.17.1.orig/src/script.c --- a/src/script.c
+++ dpkg-1.17.1/src/script.c +++ b/src/script.c
@@ -111,36 +111,9 @@ preexecscript(struct command *cmd) @@ -100,36 +100,9 @@ maintscript_pre_exec(struct command *cmd)
size_t instdirl = strlen(instdir); size_t instdirl = strlen(instdir);
if (*instdir) { if (*instdir) {
@@ -20,12 +26,12 @@ Index: dpkg-1.17.1/src/script.c
- ohshite(_("unable to setenv for subprocesses")); - ohshite(_("unable to setenv for subprocesses"));
- -
- if (chroot(instdir)) - if (chroot(instdir))
- ohshite(_("failed to chroot to `%.250s'"), instdir); - ohshite(_("failed to chroot to '%.250s'"), instdir);
- } - }
- /* Switch to a known good directory to give the maintainer script - /* Switch to a known good directory to give the maintainer script
- * a saner environment, also needed after the chroot(). */ - * a saner environment, also needed after the chroot(). */
- if (chdir("/")) - if (chdir("/"))
- ohshite(_("failed to chdir to `%.255s'"), "/"); - ohshite(_("failed to chdir to '%.255s'"), "/");
- if (debug_has_flag(dbg_scripts)) { - if (debug_has_flag(dbg_scripts)) {
- struct varbuf args = VARBUF_INIT; - struct varbuf args = VARBUF_INIT;
- const char **argv = cmd->argv; - const char **argv = cmd->argv;
@@ -49,3 +55,6 @@ Index: dpkg-1.17.1/src/script.c
} }
/** /**
--
2.1.4

View File

@@ -0,0 +1,31 @@
From adb6bfd0feeceaf030df0debe3343d7f73e708a0 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Wed, 26 Aug 2015 16:27:45 +0300
Subject: [PATCH 4/5] The lutimes function doesn't work properly for all
systems.
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Upstream-Status: Inappropriate [embedded specific]
---
src/archives.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/archives.c b/src/archives.c
index bff5f14..b711013 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -449,8 +449,9 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
if (te->type == TAR_FILETYPE_SYMLINK) {
#ifdef HAVE_LUTIMES
- if (lutimes(path, tv) && errno != ENOSYS)
+/* if (lutimes(path, tv) && errno != ENOSYS)
ohshite(_("error setting timestamps of '%.255s'"), path);
+*/
#endif
} else {
if (utimes(path, tv))
--
2.1.4

View File

@@ -1,7 +1,10 @@
From e94474d805377d67c8b09664a602f20969e12b8a Mon Sep 17 00:00:00 2001 From 0ad7bba80d5b9035089ff2b2f77a774b5b201915 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com> From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Thu, 23 Jan 2014 04:17:23 -0500 Date: Wed, 26 Aug 2015 16:28:59 +0300
Subject: [PATCH] dpkg-compiler.m4: remove -Wvla Subject: [PATCH 5/5] dpkg-compiler.m4: remove -Wvla
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Remove the -Wvla flag from the set of compiler warning flags, since gcc Remove the -Wvla flag from the set of compiler warning flags, since gcc
on old host systems such as CentOS 5.8 doesn't support it, and it on old host systems such as CentOS 5.8 doesn't support it, and it
@@ -13,20 +16,21 @@ Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
--- ---
m4/dpkg-compiler.m4 | 1 - m4/dpkg-compiler.m4 | 1 -
1 file changed, 1 deletion(-) 1 file changed, 1 deletion(-)
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
index 53f67c6..6e66a43 100644 index 682857c..23ed7d0 100644
--- a/m4/dpkg-compiler.m4 --- a/m4/dpkg-compiler.m4
+++ b/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4
@@ -49,7 +49,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [ @@ -52,7 +52,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [
DPKG_CHECK_COMPILER_FLAG([-Wformat-security])
DPKG_CHECK_COMPILER_FLAG([-Wpointer-arith])
DPKG_CHECK_COMPILER_FLAG([-Wlogical-op]) DPKG_CHECK_COMPILER_FLAG([-Wlogical-op])
DPKG_CHECK_COMPILER_FLAG([-Wlogical-not-parentheses])
DPKG_CHECK_COMPILER_FLAG([-Wswitch-bool])
- DPKG_CHECK_COMPILER_FLAG([-Wvla]) - DPKG_CHECK_COMPILER_FLAG([-Wvla])
DPKG_CHECK_COMPILER_FLAG([-Winit-self]) DPKG_CHECK_COMPILER_FLAG([-Winit-self])
DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings]) DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings])
DPKG_CHECK_COMPILER_FLAG([-Wcast-align]) DPKG_CHECK_COMPILER_FLAG([-Wcast-align])
--- --
1.17.21 2.1.4

View File

@@ -1,34 +0,0 @@
Upstream-Status: Inappropriate [configuration]
diff -ruN dpkg-1.15.8.5-orig/m4/dpkg-funcs.m4 dpkg-1.15.8.5/m4/dpkg-funcs.m4
--- dpkg-1.15.8.5-orig/m4/dpkg-funcs.m4 2010-10-08 12:27:15.082131611 +0800
+++ dpkg-1.15.8.5/m4/dpkg-funcs.m4 2010-10-08 13:56:50.074284346 +0800
@@ -27,7 +27,7 @@
# -----------------------
# Define HAVE_C99_SNPRINTF if we have C99 snprintf family semantics
AC_DEFUN([DPKG_FUNC_C99_SNPRINTF],
-[AC_CACHE_CHECK([for C99 snprintf functions], [dpkg_cv_c99_snprintf],
+[AC_CACHE_CHECK([for C99 snprintf functions], [ac_cv_func_snprintf_c99],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
#include <stdio.h>
@@ -58,14 +58,14 @@
return 0;
}
]])],
- [dpkg_cv_c99_snprintf=yes],
- [dpkg_cv_c99_snprintf=no],
- [dpkg_cv_c99_snprintf=no])])
-AS_IF([test "x$dpkg_cv_c99_snprintf" = "xyes"],
+ [ac_cv_func_snprintf_c99=yes],
+ [ac_cv_func_snprintf_c99=no],
+ [ac_cv_func_snprintf_c99=no])])
+AS_IF([test "x$ac_cv_func_snprintf_c99" = "xyes"],
[AC_DEFINE([HAVE_C99_SNPRINTF], 1,
[Define to 1 if the 'snprintf' family is C99 conformant])],
)
-AM_CONDITIONAL(HAVE_C99_SNPRINTF, [test "x$dpkg_cv_c99_snprintf" = "xyes"])
+AM_CONDITIONAL(HAVE_C99_SNPRINTF, [test "x$ac_cv_func_snprintf_c99" = "xyes"])
])# DPKG_FUNC_C99_SNPRINTF
# DPKG_MMAP

View File

@@ -1,28 +0,0 @@
Adapt to linux-wrs kernel version, which has character '_' inside.
Remove the first-char-digit-check (as the 1.15.8.5 version does).
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Upstream-Status: Inappropriate [embedded specific]
Index: dpkg-1.16.8/lib/dpkg/parsehelp.c
===================================================================
--- dpkg-1.16.8.orig/lib/dpkg/parsehelp.c
+++ dpkg-1.16.8/lib/dpkg/parsehelp.c
@@ -258,14 +258,12 @@ parseversion(struct dpkg_version *rversi
/* XXX: Would be faster to use something like cisversion and cisrevision. */
ptr = rversion->version;
- if (*ptr && !cisdigit(*ptr++))
- return dpkg_put_warn(err, _("version number does not start with digit"));
for (; *ptr; ptr++) {
- if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
+ if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
return dpkg_put_warn(err, _("invalid character in version number"));
}
for (ptr = rversion->revision; *ptr; ptr++) {
- if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".+~", *ptr) == NULL)
+ if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
return dpkg_put_warn(err, _("invalid character in revision number"));
}

View File

@@ -1,21 +0,0 @@
The lutimes function doesn't work properly for all systems.
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Upstream-Status: Inappropriate [embedded specific]
Index: dpkg-1.16.8/src/archives.c
===================================================================
--- dpkg-1.16.8.orig/src/archives.c
+++ dpkg-1.16.8/src/archives.c
@@ -440,8 +440,10 @@ tarobject_set_mtime(struct tar_entry *te
if (te->type == tar_filetype_symlink) {
#ifdef HAVE_LUTIMES
+/*
if (lutimes(path, tv) && errno != ENOSYS)
ohshite(_("error setting timestamps of `%.255s'"), path);
+*/
#endif
} else {
if (utimes(path, tv))

View File

@@ -1,45 +0,0 @@
They managed to 'break' tar. Again. Sorry, they fixed a regression
which broke dpkg-deb.
The addition of:
http://git.savannah.gnu.org/cgit/tar.git/commit/?id=163e96a0e619a900eab6de827c7c5749ecc9d3f2
("Bugfix: entries read from the -T file did not get proper matching_flag.")
means that the no-recursion option gets lost. This leads to many files getting included
multiple times, along with files which shouldn't be there.
The commit message is horrendous. The patch actually makes the option positional
(as documnted since 2003) and therefore doesn't affect the input from the -T option.
Moving the --no-reursion option to earlier in the command avoids the bug.
The bug was not present in tar 1.28 however it has been backported in at least
Fedora 22 and heading into Fedora 21.
Redhat reports of issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1230762 [tar]
https://bugzilla.redhat.com/show_bug.cgi?id=1241508 [dpkg]
Discussion of bug in upstream tar:
http://www.mail-archive.com/bug-tar@gnu.org/msg04799.html
Yocto bug:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7988
Upstream-Status: Submitted [have mailed dpkg maintainer about this]
RP
2015/7/13
Index: dpkg-1.17.25/dpkg-deb/build.c
===================================================================
--- dpkg-1.17.25.orig/dpkg-deb/build.c
+++ dpkg-1.17.25/dpkg-deb/build.c
@@ -560,7 +560,7 @@ do_build(const char *const *argv)
if (chdir(dir))
ohshite(_("failed to chdir to `%.255s'"), dir);
execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "--no-unquote",
- "-T", "-", "--no-recursion", NULL);
+ "--no-recursion", "-T", "-", NULL);
ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
}
close(p1[0]);

View File

@@ -1,21 +0,0 @@
require dpkg.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRC_URI += "file://noman.patch \
file://check_snprintf.patch \
file://check_version.patch \
file://preinst.patch \
file://fix-timestamps.patch \
file://remove-tar-no-timestamp.patch \
file://fix-abs-redefine.patch \
file://arch_pm.patch \
file://dpkg-configure.service \
file://glibc2.5-sync_file_range.patch \
file://no-vla-warning.patch \
file://add_armeb_triplet_entry.patch \
file://tarfix.patch \
"
SRC_URI[md5sum] = "e48fcfdb2162e77d72c2a83432d537ca"
SRC_URI[sha256sum] = "07019d38ae98fb107c79dbb3690cfadff877f153b8c4970e3a30d2e59aa66baa"

View File

@@ -0,0 +1,19 @@
require dpkg.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRC_URI += "file://noman.patch \
file://remove-tar-no-timestamp.patch \
file://fix-abs-redefine.patch \
file://arch_pm.patch \
file://dpkg-configure.service \
file://glibc2.5-sync_file_range.patch \
file://add_armeb_triplet_entry.patch \
file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
file://0005-dpkg-compiler.m4-remove-Wvla.patch \
"
SRC_URI[md5sum] = "63b9d869081ec49adeef6c5ff62d6576"
SRC_URI[sha256sum] = "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"