summaryrefslogtreecommitdiff
path: root/lib/rpmrc.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-22 17:12:54 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-22 18:09:30 +0200
commit59d5892627638ed9f04fab74cb13592cd4b34e1c (patch)
tree04d88cf51e9d12dd54c95744704d78a34eabfcee /lib/rpmrc.c
parenta8abeef91f0669e726e0b9ab398d56cc38efa3c6 (diff)
downloadlibrpm-tizen-59d5892627638ed9f04fab74cb13592cd4b34e1c.tar.gz
librpm-tizen-59d5892627638ed9f04fab74cb13592cd4b34e1c.tar.bz2
librpm-tizen-59d5892627638ed9f04fab74cb13592cd4b34e1c.zip
Use rpmConfigDir() instead of hardwired path for rpmrc + macro locations
Diffstat (limited to 'lib/rpmrc.c')
-rw-r--r--lib/rpmrc.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index 69d55d635..5b2f0934a 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -25,24 +25,8 @@
#include "debug.h"
-static const char * const defrcfiles =
- RPMCONFIGDIR "/rpmrc"
- ":" RPMCONFIGDIR "/" RPMCANONVENDOR "/rpmrc"
- ":" SYSCONFDIR "/rpmrc"
- ":~/.rpmrc";
-
-const char * macrofiles =
-#ifndef MACROFILES
- RPMCONFIGDIR "/macros"
- ":" RPMCONFIGDIR "/platform/%{_target}/macros"
- ":" RPMCONFIGDIR "/" RPMCANONVENDOR "/macros"
- ":" SYSCONFDIR "/rpm/macros.*"
- ":" SYSCONFDIR "/rpm/macros"
- ":" SYSCONFDIR "/rpm/%{_target}/macros"
- ":~/.rpmmacros";
-#else
- MACROFILES;
-#endif
+static const char * defrcfiles = NULL;
+const char * macrofiles = NULL;
static const char * const platform = SYSCONFDIR "/rpm/platform";
static char ** platpat = NULL;
@@ -465,6 +449,23 @@ export RPM_BUILD_ROOT\n}\
static void setDefaults(void)
{
+ const char *confdir = rpmConfigDir();
+ defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
+ confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
+ SYSCONFDIR "/rpmrc", ":",
+ "~/.rpmrc", NULL);
+
+#ifndef MACROFILES
+ macrofiles = rstrscat(NULL, confdir, "/macros", ":",
+ confdir, "/platform/%{_target}/macros", ":",
+ confdir, "/" RPMCANONVENDOR "/macros", ":",
+ SYSCONFDIR "/rpm/macros.*", ":",
+ SYSCONFDIR "/rpm/macros", ":",
+ SYSCONFDIR "/rpm/%{_target}/macros", ":",
+ "~/.rpmmacros", NULL);
+#else
+ macrofiles = MACROFILES;
+#endif
addMacro(NULL, "_usr", NULL, "/usr", RMIL_DEFAULT);
addMacro(NULL, "_var", NULL, LOCALSTATEDIR, RMIL_DEFAULT);