summaryrefslogtreecommitdiff
path: root/rpmio/macro.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-03-27 14:01:47 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-03-27 14:01:47 +0200
commit2d2bda29c159f16689c05fd4dda20a3f70597e1d (patch)
treea0c09d8ec217e4c646ade85d2fad11704774bb3b /rpmio/macro.c
parenta5eeff6d42d6452a85942f89a6b3a1196ccc47bc (diff)
downloadrpm-2d2bda29c159f16689c05fd4dda20a3f70597e1d.tar.gz
rpm-2d2bda29c159f16689c05fd4dda20a3f70597e1d.tar.bz2
rpm-2d2bda29c159f16689c05fd4dda20a3f70597e1d.zip
Add built-in %getconfdir macro for getting rpmConfigDir() value
- define %_rpmconfigdir via %getconfdir in the main macro config, this avoids it getting lost on macro reloads as happens when building several packages at once
Diffstat (limited to 'rpmio/macro.c')
-rw-r--r--rpmio/macro.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index c9b6259ae..c55b9e2b2 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -985,6 +985,9 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
b = be;
} else if (STREQ("getenv", f, fn)) {
b = getenv(buf);
+ } else if (STREQ("getconfdir", f, fn)) {
+ sprintf(buf, "%s", rpmConfigDir());
+ b = buf;
} else if (STREQ("S", f, fn)) {
for (b = buf; (c = *b) && risdigit(c);)
b++;
@@ -1256,6 +1259,7 @@ expandMacro(MacroBuf mb)
STREQ("url2path", f, fn) ||
STREQ("u2p", f, fn) ||
STREQ("getenv", f, fn) ||
+ STREQ("getconfdir", f, fn) ||
STREQ("S", f, fn) ||
STREQ("P", f, fn) ||
STREQ("F", f, fn)) {