summaryrefslogtreecommitdiff
path: root/src/help.c
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2010-04-12 12:06:01 +0200
committerRaphaël Hertzog <hertzog@debian.org>2010-04-16 16:44:53 +0200
commit246cf59f8cb555bdaddd36e01d4b57a5e5ac3c7f (patch)
tree4b7331917bbf82cef9f8c67e54f36b3481f9c4e8 /src/help.c
parent29fe363219625f2a411c85ce065ad47a67077797 (diff)
downloaddpkg-246cf59f8cb555bdaddd36e01d4b57a5e5ac3c7f.tar.gz
dpkg: export DPKG_MAINTSCRIPT_NAME to tell what kind of script we're running
The idea is that specialized hooks can benefit from this information to do the right thing. The same call would be put in the various maintainer scripts but the actions taken would be different depending on the script nevertheless.
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/help.c b/src/help.c
index 9d35b90af..fb5ec9309 100644
--- a/src/help.c
+++ b/src/help.c
@@ -258,13 +258,13 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
c1 = subproc_fork();
if (!c1) {
- cmd->argv[0] = preexecscript(cmd);
-
if (setenv(MAINTSCRIPTPKGENVVAR, pkg->name, 1) ||
setenv(MAINTSCRIPTARCHENVVAR, pif->architecture, 1) ||
+ setenv(MAINTSCRIPTNAMEENVVAR, cmd->argv[0], 1) ||
setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
ohshite(_("unable to setenv for maintainer script"));
+ cmd->argv[0] = preexecscript(cmd);
command_exec(cmd);
}
subproc_signals_setup(cmd->name); /* This does a push_cleanup() */