From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Michael Subject: [PATCH] dmd: Find the system dmdconf.scm in the configured sysconfdir Date: Tue, 08 Jul 2014 22:05:29 -0400 Message-ID: <87wqbnthg6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4hET-00079j-8O for guix-devel@gnu.org; Tue, 08 Jul 2014 22:03:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4hEO-0004s3-5T for guix-devel@gnu.org; Tue, 08 Jul 2014 22:03:41 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:65102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4hEO-0004rq-0V for guix-devel@gnu.org; Tue, 08 Jul 2014 22:03:36 -0400 Received: by mail-qg0-f41.google.com with SMTP id i50so5938047qgf.14 for ; Tue, 08 Jul 2014 19:03:34 -0700 (PDT) Received: from callisto (c-68-81-204-146.hsd1.pa.comcast.net. [68.81.204.146]) by mx.google.com with ESMTPSA id o88sm30678953qge.19.2014.07.08.19.03.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jul 2014 19:03:34 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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". --- Hi, As is, using "./configure --prefix=3D/usr --sysconfdir=3D/etc" will try to read /usr/etc/dmdconf.scm by default. Can it be adjusted to read dmdconf.scm from the configured sysconfdir? Thanks. David Makefile.am | 1 + modules/dmd/config.scm.in | 2 ++ modules/dmd/support.scm | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 5e6ff05..3329382 100644 --- a/Makefile.am +++ b/Makefile.am @@ -86,6 +86,7 @@ instantiate =3D \ -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%") =20 (define copyright "Copyright (C) 2002, 2003 Wolfgang J=C3=A4hrling") (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 + nam= e." 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)) --=20 1.9.3