Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 03, 2011 at 10:32:14AM -0700, Junio C Hamano wrote:
> We can get rid of assignments to sysconfdir in that sense. But you spotted
> a regression. If sysconfdir is set to somewhere else, even if you set prefix
> to /usr, we should set ETC_GIT* using the value given to sysconfdir.  The
> original code did so, but the patch lost it.

Actually syconfdir was respected only when prefix was /usr. When it was
not /usr, ETC_GIT* were always set to etc/... The following version of
patch reproduces that behaviour:

>From 1a438bc0ac71a96398260b73b3c24c5e752a02f5 Mon Sep 17 00:00:00 2001
From: Kacper Kornet <draenog@xxxxxxxxxxxxx>
Date: Thu, 28 Apr 2011 02:42:48 +0100
Subject: [PATCH] Honor $(prefix) set in config.mak* when defining ETC_GIT*
 and sysconfdir

Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on
value of prefix. As prefix can be changed in config.mak.autogen, all if
blocks with conditions based on prefix should be placed after the file
is included in Makefile.

Signed-off-by: Kacper Kornet <draenog@xxxxxxxxxxxxx>
---
 Makefile |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index cbc3fce..31b558e 100644
--- a/Makefile
+++ b/Makefile
@@ -291,15 +291,8 @@ sharedir = $(prefix)/share
 gitwebdir = $(sharedir)/gitweb
 template_dir = share/git-core/templates
 htmldir = share/doc/git-doc
-ifeq ($(prefix),/usr)
-sysconfdir = /etc
-ETC_GITCONFIG = $(sysconfdir)/gitconfig
-ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
-else
-sysconfdir = $(prefix)/etc
-ETC_GITCONFIG = etc/gitconfig
-ETC_GITATTRIBUTES = etc/gitattributes
-endif
+ETC_GITCONFIG = $(git_etcdir)/gitconfig
+ETC_GITATTRIBUTES = $(git_etcdir)/gitattributes
 lib = lib
 # DESTDIR=
 pathsep = :
@@ -1192,6 +1185,14 @@ endif
 -include config.mak.autogen
 -include config.mak
 
+ifeq ($(prefix),/usr)
+sysconfdir = /etc
+git_etcdir = $(sysconfdir)
+else
+sysconfdir = $(prefix)/etc
+git_etcdir = etc
+endif
+
 ifdef CHECK_HEADER_DEPENDENCIES
 COMPUTE_HEADER_DEPENDENCIES =
 USE_COMPUTED_HEADER_DEPENDENCIES =
-- 
1.7.5

-- 
  Kacper Kornet
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]