diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-devtools/dpkg/dpkg/preinst.patch | |
download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/preinst.patch')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg/preinst.patch | 51 |
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 @@ | |||
1 | Our pre/postinsts expect $D to be set when running in a sysroot and | ||
2 | don't expect a chroot. This matches up our system expectations with | ||
3 | what dpkg does. | ||
4 | |||
5 | Upstream-Status: Inappropriate [OE Specific] | ||
6 | |||
7 | RP 2011/12/07 | ||
8 | |||
9 | Index: 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 | /** | ||