diff --git a/doc/makepkg.8.asciidoc b/doc/makepkg.8.asciidoc index 89ac5109..69a5fd64 100644 --- a/doc/makepkg.8.asciidoc +++ b/doc/makepkg.8.asciidoc @@ -247,6 +247,11 @@ Environment Variables Use an alternate config file instead of the +{sysconfdir}/makepkg.conf+ default. +**MAKEPKG_GIT_CONFIG=**"/path/to/file":: + Use an alternate config file for Git instead of the + +{sysconfdir}/makepkg.d/gitconfig+ default. makepkg always prevents Git + from loading any other config files. + **PKGDEST=**"/path/to/directory":: Directory where the resulting packages will be stored. Overrides the corresponding value defined in linkman:makepkg.conf[5]. diff --git a/meson.build b/meson.build index e8f502b7..c045b3bf 100644 --- a/meson.build +++ b/meson.build @@ -433,6 +433,8 @@ configure_file( configuration : substs, install_dir : join_paths(SYSCONFDIR, 'makepkg.conf.d/')) +install_emptydir(join_paths(SYSCONFDIR, 'makepkg.d/')) + configure_file( input : 'etc/pacman.conf.in', output : 'pacman.conf', diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index d9c2416e..c3cc1655 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -28,6 +28,8 @@ source "$MAKEPKG_LIBRARY/util/error.sh" source "$MAKEPKG_LIBRARY/util/message.sh" source "$MAKEPKG_LIBRARY/util/pkgbuild.sh" +export GIT_CONFIG_GLOBAL=/dev/null +export GIT_CONFIG_SYSTEM=${MAKEPKG_GIT_CONFIG:-'@sysconfdir@/makepkg.d/gitconfig'} download_git() { # abort early if parent says not to fetch @@ -161,7 +163,7 @@ calc_checksum_git() { case ${fragment%%=*} in tag|commit) fragval=${fragment##*=} - sum=$(GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null git -c core.abbrev=no -C "$dir" archive --format tar "$fragval" | "${integ}sum" 2>&1) || ret=1 + sum=$(git -c core.abbrev=no -C "$dir" archive --format tar "$fragval" | "${integ}sum" 2>&1) || ret=1 sum="${sum%% *}" ;; *)