From 246cf59f8cb555bdaddd36e01d4b57a5e5ac3c7f Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Mon, 12 Apr 2010 12:06:01 +0200 Subject: 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. --- src/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/help.c') 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() */ -- cgit v1.2.3