civodul pushed a commit to branch master
in repository dmd.
commit 7d14baf1034597ef5f3be24455e4544680df4b1a
Author: David Michael <[email protected]>
Date: Tue Jul 8 22:05:29 2014 -0400
dmd: Find the system dmdconf.scm in the configured sysconfdir
* Makefile.am (instantiate): Substitute the sysconfdir value.
* modules/dmd/config.scm.in (%sysconfdir): New variable.
* modules/dmd/support.scm (default-config-file): Use %sysconfdir in
place of prefix+"/etc".
Signed-off-by: Ludovic Courtès <[email protected]>
---
Makefile.am | 1 +
modules/dmd/config.scm.in | 2 ++
modules/dmd/support.scm | 2 +-
3 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 5e6ff05..3329382 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -86,6 +86,7 @@ instantiate = \
-e 's,%modsrcdir%,${abs_top_srcdir}/modules,g' \
-e 's,%modbuilddir%,${abs_top_builddir}/modules,g' \
-e 's,%localstatedir%,${localstatedir},g' \
+ -e 's,%sysconfdir%,${sysconfdir},g' \
-e 's,%VERSION%,@VERSION@,g' \
-e 's,%PACKAGE_BUGREPORT%,@PACKAGE_BUGREPORT@,g' \
-e 's,%PACKAGE_NAME%,@PACKAGE_NAME@,g' \
diff --git a/modules/dmd/config.scm.in b/modules/dmd/config.scm.in
index dd2db9b..0ee9340 100644
--- a/modules/dmd/config.scm.in
+++ b/modules/dmd/config.scm.in
@@ -4,6 +4,7 @@
#:export (Version
Prefix-dir
%localstatedir
+ %sysconfdir
copyright
bug-address
package-name
@@ -12,6 +13,7 @@
(define Version "%VERSION%")
(define Prefix-dir "%PREFIX%")
(define %localstatedir "%localstatedir%")
+(define %sysconfdir "%sysconfdir%")
(define copyright "Copyright (C) 2002, 2003 Wolfgang J�hrling")
(define bug-address "%PACKAGE_BUGREPORT%")
diff --git a/modules/dmd/support.scm b/modules/dmd/support.scm
index 8ca1597..7eacc70 100644
--- a/modules/dmd/support.scm
+++ b/modules/dmd/support.scm
@@ -217,7 +217,7 @@ TARGET should be a string representing a filepath + name."
global system configuration file when running as 'root'. As a side effect,
create a template configuration file if non exists."
(if (zero? (getuid))
- (string-append Prefix-dir "/etc/dmdconf.scm")
+ (string-append %sysconfdir "/dmdconf.scm")
(let ((config-file (string-append user-dmddir "/init.scm")))
(catch-system-error (mkdir user-dmddir))
(if (not (file-exists? config-file))