diff options
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/preinst.patch')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg/preinst.patch | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/preinst.patch b/meta/recipes-devtools/dpkg/dpkg/preinst.patch index f9cb4089fb..0549121ef1 100644 --- a/meta/recipes-devtools/dpkg/dpkg/preinst.patch +++ b/meta/recipes-devtools/dpkg/dpkg/preinst.patch | |||
@@ -6,17 +6,13 @@ Upstream-Status: Inappropriate [OE Specific] | |||
6 | 6 | ||
7 | RP 2011/12/07 | 7 | RP 2011/12/07 |
8 | 8 | ||
9 | Index: dpkg-1.16.8/src/script.c | 9 | Index: dpkg-1.17.1/src/script.c |
10 | =================================================================== | 10 | =================================================================== |
11 | --- dpkg-1.16.8.orig/src/script.c | 11 | --- dpkg-1.17.1.orig/src/script.c |
12 | +++ dpkg-1.16.8/src/script.c | 12 | +++ dpkg-1.17.1/src/script.c |
13 | @@ -102,38 +102,10 @@ setexecute(const char *path, struct stat | 13 | @@ -111,36 +111,9 @@ preexecscript(struct command *cmd) |
14 | static const char * | 14 | size_t instdirl = strlen(instdir); |
15 | preexecscript(struct command *cmd) | 15 | |
16 | { | ||
17 | - const char *admindir = dpkg_db_get_dir(); | ||
18 | - size_t instdirl = strlen(instdir); | ||
19 | - | ||
20 | if (*instdir) { | 16 | if (*instdir) { |
21 | - if (strncmp(admindir, instdir, instdirl) != 0) | 17 | - if (strncmp(admindir, instdir, instdirl) != 0) |
22 | - ohshit(_("admindir must be inside instdir for dpkg to work properly")); | 18 | - ohshit(_("admindir must be inside instdir for dpkg to work properly")); |
@@ -25,10 +21,11 @@ Index: dpkg-1.16.8/src/script.c | |||
25 | - | 21 | - |
26 | - if (chroot(instdir)) | 22 | - if (chroot(instdir)) |
27 | - ohshite(_("failed to chroot to `%.250s'"), instdir); | 23 | - ohshite(_("failed to chroot to `%.250s'"), instdir); |
28 | - if (chdir("/")) | 24 | - } |
29 | - ohshite(_("failed to chdir to `%.255s'"), "/"); | 25 | - /* Switch to a known good directory to give the maintainer script |
30 | + setenv("D", instdir, 1); | 26 | - * a saner environment, also needed after the chroot(). */ |
31 | } | 27 | - if (chdir("/")) |
28 | - ohshite(_("failed to chdir to `%.255s'"), "/"); | ||
32 | - if (debug_has_flag(dbg_scripts)) { | 29 | - if (debug_has_flag(dbg_scripts)) { |
33 | - struct varbuf args = VARBUF_INIT; | 30 | - struct varbuf args = VARBUF_INIT; |
34 | - const char **argv = cmd->argv; | 31 | - const char **argv = cmd->argv; |
@@ -41,7 +38,8 @@ Index: dpkg-1.16.8/src/script.c | |||
41 | - debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename, | 38 | - debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename, |
42 | - args.buf); | 39 | - args.buf); |
43 | - varbuf_destroy(&args); | 40 | - varbuf_destroy(&args); |
44 | - } | 41 | + setenv("D", instdir, 1); |
42 | } | ||
45 | - if (!instdirl) | 43 | - if (!instdirl) |
46 | - return cmd->filename; | 44 | - return cmd->filename; |
47 | - | 45 | - |
@@ -50,4 +48,4 @@ Index: dpkg-1.16.8/src/script.c | |||
50 | + return cmd->filename; | 48 | + return cmd->filename; |
51 | } | 49 | } |
52 | 50 | ||
53 | static int | 51 | /** |