summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2010-04-16 11:56:17 +0200
committerRaphaël Hertzog <hertzog@debian.org>2010-04-16 16:49:42 +0200
commitd5b15f56fbc93983005cf2f9cc1117a3bbb3670c (patch)
tree4204da1f8a94ef29b524add42589e39bf89f7ce6 /src
parent246cf59f8cb555bdaddd36e01d4b57a5e5ac3c7f (diff)
downloaddpkg-d5b15f56fbc93983005cf2f9cc1117a3bbb3670c.tar.gz
dpkg: export DPKG_LIBDIR to maintainer scripts
It can be used to find out the location of some internal dpkg programs that might be called from maintainer scripts. That way we can avoid hardcoding /usr/lib/dpkg and maintainer scripts will still work when called from a dpkg manually installed in /usr/local for example.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/help.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b3f2fe582..ddde846bb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ pkgconfdir = $(sysconfdir)/@PACKAGE@
AM_CPPFLAGS = \
-DLOCALEDIR=\"$(localedir)\" \
-DADMINDIR=\"$(admindir)\" \
+ -DPKGLIBDIR=\"$(pkglibdir)\" \
-idirafter $(top_srcdir)/lib/compat \
-I$(top_builddir) \
-I$(top_srcdir)/lib
diff --git a/src/help.c b/src/help.c
index fb5ec9309..59bed9a8a 100644
--- a/src/help.c
+++ b/src/help.c
@@ -261,6 +261,7 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
if (setenv(MAINTSCRIPTPKGENVVAR, pkg->name, 1) ||
setenv(MAINTSCRIPTARCHENVVAR, pif->architecture, 1) ||
setenv(MAINTSCRIPTNAMEENVVAR, cmd->argv[0], 1) ||
+ setenv(MAINTSCRIPTLIBDIRENVVAR, PKGLIBDIR, 1) ||
setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
ohshite(_("unable to setenv for maintainer script"));