From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] dpkg: Fix preinst execution
Date: Wed, 07 Dec 2011 15:48:14 +0000 [thread overview]
Message-ID: <1323272894.30601.31.camel@ted> (raw)
Add a patch to fix exeuction of pre/post install scripts. See the patch
header for more details.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/recipes-devtools/dpkg/dpkg/preinst.patch
b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
new file mode 100644
index 0000000..06d2aac
--- a/dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
@@ -0,0 +1,46 @@
+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]
+
+RP 2011/12/07
+
+Index: dpkg-1.15.8.7/src/help.c
+===================================================================
+--- dpkg-1.15.8.7.orig/src/help.c 2010-12-20 01:25:36.000000000 +0000
++++ dpkg-1.15.8.7/src/help.c 2011-12-07 14:51:02.783461487 +0000
+@@ -181,30 +181,9 @@
+ * FIXME: none of the stuff here will work if admindir isn't inside
+ * instdir as expected.
+ */
+- size_t instdirl;
+-
+- if (*instdir) {
+- if (chroot(instdir)) ohshite(_("failed to chroot to `
%.250s'"),instdir);
+- if (chdir("/"))
+- ohshite(_("failed to chdir to `%.255s'"), "/");
+- }
+- if (f_debug & dbg_scripts) {
+- struct varbuf args = VARBUF_INIT;
+- const char **argv = cmd->argv;
+-
+- while (*++argv) {
+- varbufaddc(&args, ' ');
+- varbufaddstr(&args, *argv);
+- }
+- varbufaddc(&args, '\0');
+- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename, args.buf);
+- varbuf_destroy(&args);
+- }
+- instdirl= strlen(instdir);
+- if (!instdirl)
+- return cmd->filename;
+- assert(strlen(cmd->filename) >= instdirl);
+- return cmd->filename + instdirl;
++ if (*instdir)
++ setenv("D", instdir, 1);
++ return cmd->filename;
+ }
+
+ void
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
b/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
index f1a0eeb..f1030fa 100644
--- a/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
+++ b/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
@@ -4,10 +4,11 @@ LIC_FILES_CHKSUM =
"file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRC_URI += "file://noman.patch \
file://check_snprintf.patch \
file://check_version.patch \
- file://perllibdir.patch"
+ file://perllibdir.patch \
+ file://preinst.patch"
SRC_URI[md5sum] = "d1731d4147c1ea3b537a4d094519a6dc"
SRC_URI[sha256sum] =
"1ec1376471b04717a4497e5d7a27cd545248c92116898ce0c53ced8ea94267b5"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.3"
reply other threads:[~2011-12-07 15:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323272894.30601.31.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox