mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Use relative paths to make installation relocatable
mingw uses relative paths for template_dir and ETC_GITCONFIG to make an installation relocatable. Relative paths will be expanded relative to git_exec_dir(). This mechanism is now included in official git.git. We used a different mechanism to create a relocatable installation. We used to prefix absolute Unix paths with the installation prefix, derived from the path of git.exe. This commit reverts our implementation to match mingw. Part of the change are reverts of the following commits, which are no longer needed:4e8904080d0fbe22da39.636116b8a7. Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
7
Makefile
7
Makefile
@@ -523,7 +523,8 @@ ifneq (,$(findstring MINGW,$(uname_S)))
|
||||
EXTLIBS += -lws2_32
|
||||
X = .exe
|
||||
NOEXECTEMPL = .noexec
|
||||
prefix =
|
||||
template_dir = ../share/git-core/templates/
|
||||
ETC_GITCONFIG = ../etc/gitconfig
|
||||
endif
|
||||
ifneq (,$(findstring arm,$(uname_M)))
|
||||
ARM_SHA1 = YesPlease
|
||||
@@ -774,12 +775,12 @@ endif
|
||||
# Shell quote (do not use $(call) to accommodate ancient setups);
|
||||
|
||||
SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
|
||||
ETC_GITCONFIG_SQ = \057etc/gitconfig
|
||||
ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
|
||||
|
||||
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
||||
bindir_SQ = $(subst ','\'',$(bindir))
|
||||
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
||||
template_dir_SQ = \057share/git-core/templates
|
||||
template_dir_SQ = $(subst ','\'',$(template_dir))
|
||||
prefix_SQ = $(subst ','\'',$(prefix))
|
||||
sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
|
||||
|
||||
|
||||
@@ -145,17 +145,6 @@ static void copy_templates(const char *git_dir, int len, const char *template_di
|
||||
template_dir = prefix_path(exec_path, strlen(exec_path),
|
||||
template_dir);
|
||||
}
|
||||
#if __MINGW32__
|
||||
/*
|
||||
* If it is an absolute Unix path it is prefixed with
|
||||
* the git_install_prefix().
|
||||
*/
|
||||
else if (template_dir[0] == '/') {
|
||||
const char* prefix = git_install_prefix();
|
||||
template_dir = prefix_path(prefix, strlen(prefix),
|
||||
template_dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
strcpy(template_path, template_dir);
|
||||
template_len = strlen(template_path);
|
||||
|
||||
11
config.c
11
config.c
@@ -473,17 +473,6 @@ const char *git_etc_gitconfig(void)
|
||||
system_wide = prefix_path(exec_path, strlen(exec_path),
|
||||
system_wide);
|
||||
}
|
||||
#if __MINGW32__
|
||||
/*
|
||||
* If it is an absolute Unix path it is prefixed with
|
||||
* the git_install_prefix().
|
||||
*/
|
||||
else if (system_wide[0] == '/') {
|
||||
const char* prefix = git_install_prefix();
|
||||
system_wide = prefix_path(prefix, strlen(prefix),
|
||||
system_wide);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return system_wide;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user