summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg/preinst.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/preinst.patch')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/preinst.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/preinst.patch b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
new file mode 100644
index 0000000000..0549121ef1
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
@@ -0,0 +1,51 @@
1Our pre/postinsts expect $D to be set when running in a sysroot and
2don't expect a chroot. This matches up our system expectations with
3what dpkg does.
4
5Upstream-Status: Inappropriate [OE Specific]
6
7RP 2011/12/07
8
9Index: dpkg-1.17.1/src/script.c
10===================================================================
11--- dpkg-1.17.1.orig/src/script.c
12+++ dpkg-1.17.1/src/script.c
13@@ -111,36 +111,9 @@ preexecscript(struct command *cmd)
14 size_t instdirl = strlen(instdir);
15
16 if (*instdir) {
17- if (strncmp(admindir, instdir, instdirl) != 0)
18- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
19- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
20- ohshite(_("unable to setenv for subprocesses"));
21-
22- if (chroot(instdir))
23- ohshite(_("failed to chroot to `%.250s'"), instdir);
24- }
25- /* Switch to a known good directory to give the maintainer script
26- * a saner environment, also needed after the chroot(). */
27- if (chdir("/"))
28- ohshite(_("failed to chdir to `%.255s'"), "/");
29- if (debug_has_flag(dbg_scripts)) {
30- struct varbuf args = VARBUF_INIT;
31- const char **argv = cmd->argv;
32-
33- while (*++argv) {
34- varbuf_add_char(&args, ' ');
35- varbuf_add_str(&args, *argv);
36- }
37- varbuf_end_str(&args);
38- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
39- args.buf);
40- varbuf_destroy(&args);
41+ setenv("D", instdir, 1);
42 }
43- if (!instdirl)
44- return cmd->filename;
45-
46- assert(strlen(cmd->filename) >= instdirl);
47- return cmd->filename + instdirl;
48+ return cmd->filename;
49 }
50
51 /**