Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Commit

Permalink
look for makepkg.conf in correct locations
Browse files Browse the repository at this point in the history
  • Loading branch information
grawity authored and rmarquis committed Apr 21, 2015
1 parent 1a37850 commit bc125c2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions pacaur
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,27 @@ LC_COLLATE=C # getopts sorting
TEXTDOMAIN='pacaur'
TEXTDOMAINDIR='/usr/share/locale'

# determine config location
if [[ -n "${XDG_CONFIG_DIRS}" ]]; then
for i in ${XDG_CONFIG_DIRS//:/ }; do
[[ -d "$i" ]] && export XDG_CONFIG_DIRS="$i" && break
done
fi
configdir="${XDG_CONFIG_DIRS:-/etc/xdg}/pacaur"
userconfigdir="${XDG_CONFIG_HOME:-${HOME}/.config}/pacaur"
userpacmandir="${XDG_CONFIG_HOME:-${HOME}/.config}/pacman"

# source makepkg variables
source /etc/makepkg.conf
[[ -r "$HOME/.makepkg.conf" ]] && source "$HOME/.makepkg.conf"
if [[ -r "$MAKEPKG_CONF" ]]; then
source "$MAKEPKG_CONF"
else
source /etc/makepkg.conf
if [[ -r "$userpacmandir/makepkg.conf" ]]; then
source "$userpacmandir/makepkg.conf"
elif [[ -r "$HOME/.makepkg.conf" ]]; then
source "$HOME/.makepkg.conf"
fi
fi

# set variables
tmpdir="${TMPDIR:-/tmp}/pacaurtmp-$USER" # temp directory
Expand All @@ -35,13 +53,6 @@ sudoloop=false # prevent sudo timeout
pacmanbin="${PACMAN:-pacman}"

# source xdg config
if [[ -n "${XDG_CONFIG_DIRS}" ]]; then
for i in ${XDG_CONFIG_DIRS//:/ }; do
[[ -d "$i" ]] && export XDG_CONFIG_DIRS="$i" && break
done
fi
configdir="${XDG_CONFIG_DIRS:-/etc/xdg}/pacaur"
userconfigdir="${XDG_CONFIG_HOME:-${HOME}/.config}/pacaur"
source "$configdir/config"
[[ -r "$userconfigdir/config" ]] && source "$userconfigdir/config"

Expand Down

0 comments on commit bc125c2

Please sign in to comment.