diff options
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/preinst.patch')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg/preinst.patch | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/preinst.patch b/meta/recipes-devtools/dpkg/dpkg/preinst.patch index 06d2aacf3f..f9cb4089fb 100644 --- a/meta/recipes-devtools/dpkg/dpkg/preinst.patch +++ b/meta/recipes-devtools/dpkg/dpkg/preinst.patch | |||
@@ -6,41 +6,48 @@ Upstream-Status: Inappropriate [OE Specific] | |||
6 | 6 | ||
7 | RP 2011/12/07 | 7 | RP 2011/12/07 |
8 | 8 | ||
9 | Index: dpkg-1.15.8.7/src/help.c | 9 | Index: dpkg-1.16.8/src/script.c |
10 | =================================================================== | 10 | =================================================================== |
11 | --- dpkg-1.15.8.7.orig/src/help.c 2010-12-20 01:25:36.000000000 +0000 | 11 | --- dpkg-1.16.8.orig/src/script.c |
12 | +++ dpkg-1.15.8.7/src/help.c 2011-12-07 14:51:02.783461487 +0000 | 12 | +++ dpkg-1.16.8/src/script.c |
13 | @@ -181,30 +181,9 @@ | 13 | @@ -102,38 +102,10 @@ setexecute(const char *path, struct stat |
14 | * FIXME: none of the stuff here will work if admindir isn't inside | 14 | static const char * |
15 | * instdir as expected. | 15 | preexecscript(struct command *cmd) |
16 | */ | 16 | { |
17 | - size_t instdirl; | 17 | - const char *admindir = dpkg_db_get_dir(); |
18 | - size_t instdirl = strlen(instdir); | ||
18 | - | 19 | - |
19 | - if (*instdir) { | 20 | if (*instdir) { |
20 | - if (chroot(instdir)) ohshite(_("failed to chroot to `%.250s'"),instdir); | 21 | - if (strncmp(admindir, instdir, instdirl) != 0) |
21 | - if (chdir("/")) | 22 | - ohshit(_("admindir must be inside instdir for dpkg to work properly")); |
22 | - ohshite(_("failed to chdir to `%.255s'"), "/"); | 23 | - if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0) |
23 | - } | 24 | - ohshite(_("unable to setenv for subprocesses")); |
24 | - if (f_debug & dbg_scripts) { | ||
25 | - struct varbuf args = VARBUF_INIT; | ||
26 | - const char **argv = cmd->argv; | ||
27 | - | 25 | - |
28 | - while (*++argv) { | 26 | - if (chroot(instdir)) |
29 | - varbufaddc(&args, ' '); | 27 | - ohshite(_("failed to chroot to `%.250s'"), instdir); |
30 | - varbufaddstr(&args, *argv); | 28 | - if (chdir("/")) |
31 | - } | 29 | - ohshite(_("failed to chdir to `%.255s'"), "/"); |
32 | - varbufaddc(&args, '\0'); | 30 | + setenv("D", instdir, 1); |
33 | - debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename, args.buf); | 31 | } |
34 | - varbuf_destroy(&args); | 32 | - if (debug_has_flag(dbg_scripts)) { |
35 | - } | 33 | - struct varbuf args = VARBUF_INIT; |
36 | - instdirl= strlen(instdir); | 34 | - const char **argv = cmd->argv; |
37 | - if (!instdirl) | 35 | - |
38 | - return cmd->filename; | 36 | - while (*++argv) { |
39 | - assert(strlen(cmd->filename) >= instdirl); | 37 | - varbuf_add_char(&args, ' '); |
40 | - return cmd->filename + instdirl; | 38 | - varbuf_add_str(&args, *argv); |
41 | + if (*instdir) | 39 | - } |
42 | + setenv("D", instdir, 1); | 40 | - varbuf_end_str(&args); |
43 | + return cmd->filename; | 41 | - debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename, |
44 | } | 42 | - args.buf); |
43 | - varbuf_destroy(&args); | ||
44 | - } | ||
45 | - if (!instdirl) | ||
46 | - return cmd->filename; | ||
47 | - | ||
48 | - assert(strlen(cmd->filename) >= instdirl); | ||
49 | - return cmd->filename + instdirl; | ||
50 | + return cmd->filename; | ||
51 | } | ||
45 | 52 | ||
46 | void | 53 | static int |