summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch31
1 files changed, 18 insertions, 13 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
index 80504ce8b9..93d870443c 100644
--- a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -9,27 +9,32 @@ Upstream-Status: Inappropriate [OE Specific]
9 9
10RP 2011/12/07 10RP 2011/12/07
11ALIMON 2016/05/26 11ALIMON 2016/05/26
12 12ALIMON 2017/02/21
13--- 13---
14 src/script.c | 39 +++------------------------------------ 14 src/script.c | 44 +++-----------------------------------------
15 1 file changed, 3 insertions(+), 36 deletions(-) 15 1 file changed, 3 insertions(+), 41 deletions(-)
16 16
17diff --git a/src/script.c b/src/script.c 17diff --git a/src/script.c b/src/script.c
18index 3c88be8..ce66a86 100644 18index 2f252ae..768a9d1 100644
19--- a/src/script.c 19--- a/src/script.c
20+++ b/src/script.c 20+++ b/src/script.c
21@@ -97,43 +97,10 @@ setexecute(const char *path, struct stat *stab) 21@@ -97,48 +97,10 @@ setexecute(const char *path, struct stat *stab)
22 static const char * 22 static const char *
23 maintscript_pre_exec(struct command *cmd) 23 maintscript_pre_exec(struct command *cmd)
24 { 24 {
25- const char *admindir = dpkg_db_get_dir(); 25- const char *admindir = dpkg_db_get_dir();
26- const char *changedir = fc_script_chrootless ? instdir : "/"; 26- const char *changedir;
27- size_t instdirl = strlen(instdir); 27- size_t instdirlen = strlen(instdir);
28-
29- if (instdirlen > 0 && fc_script_chrootless)
30- changedir = instdir;
31- else
32- changedir = "/";
28- 33-
29- if (*instdir && !fc_script_chrootless) { 34- if (instdirlen > 0 && !fc_script_chrootless) {
30- if (strncmp(admindir, instdir, instdirl) != 0) 35- if (strncmp(admindir, instdir, instdirlen) != 0)
31- ohshit(_("admindir must be inside instdir for dpkg to work properly")); 36- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
32- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0) 37- if (setenv("DPKG_ADMINDIR", admindir + instdirlen, 1) < 0)
33- ohshite(_("unable to setenv for subprocesses")); 38- ohshite(_("unable to setenv for subprocesses"));
34- if (setenv("DPKG_ROOT", "", 1) < 0) 39- if (setenv("DPKG_ROOT", "", 1) < 0)
35- ohshite(_("unable to setenv for subprocesses")); 40- ohshite(_("unable to setenv for subprocesses"));
@@ -56,11 +61,11 @@ index 3c88be8..ce66a86 100644
56- args.buf); 61- args.buf);
57- varbuf_destroy(&args); 62- varbuf_destroy(&args);
58- } 63- }
59- if (!instdirl || fc_script_chrootless) 64- if (instdirlen == 0 || fc_script_chrootless)
60- return cmd->filename; 65- return cmd->filename;
61- 66-
62- assert(strlen(cmd->filename) >= instdirl); 67- assert(strlen(cmd->filename) >= instdirlen);
63- return cmd->filename + instdirl; 68- return cmd->filename + instdirlen;
64+ return cmd->filename; 69+ return cmd->filename;
65 } 70 }
66 71