Skip to content
This repository has been archived by the owner on Aug 9, 2019. It is now read-only.

Commit

Permalink
Possibility to use MAKEPKG as an environment variable or in yaourtrc …
Browse files Browse the repository at this point in the history
…to set another 'makepkg' executable
  • Loading branch information
tuxce committed Jan 4, 2015
1 parent 30e46d7 commit 1997977
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/lib/pkgbuild.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ read_pkgbuild() {
echo "}" >> $pkgbuild_tmp
echo "( yaourt_$$ ) || exit 1" >> $pkgbuild_tmp
echo "exit 0" >> $pkgbuild_tmp
PKGBUILD_VARS="$(makepkg "${MAKEPKG_ARG[@]}" -p "$pkgbuild_tmp" 3>&1 1>/dev/null | tr '\n' ';')"
PKGBUILD_VARS="$(y_makepkg -p "$pkgbuild_tmp" 3>&1 1>/dev/null | tr '\n' ';')"
rm "$pkgbuild_tmp"
eval $PKGBUILD_VARS
pkgbase=${pkgbase:-${pkgname[0]}}
Expand Down Expand Up @@ -207,7 +207,7 @@ build_package() {
fi
if (( SYSUPGRADE )) && (( DEVEL )) && (( ! FORCE )); then
if ((YPKGVER_FUNC)); then
SRCDEST="$YSRCDEST" makepkg "${MAKEPKG_ARG[@]}" -o -p ./PKGBUILD
SRCDEST="$YSRCDEST" y_makepkg -o -p ./PKGBUILD
# re-read PKGBUILD to update version
read_pkgbuild || return 1
eval $PKGBUILD_VARS
Expand Down Expand Up @@ -237,13 +237,13 @@ build_package() {
fi

# Build
SRCDEST="$YSRCDEST" PKGDEST="$YPKGDEST" makepkg "${MAKEPKG_ARG[@]}" -s -f -p ./PKGBUILD
SRCDEST="$YSRCDEST" PKGDEST="$YPKGDEST" y_makepkg -s -f -p ./PKGBUILD

if (( $? )); then
error $(_gettext 'Makepkg was unable to build %s.' "$pkgbase")
return 1
fi
(( EXPORT && EXPORTSRC )) && [[ $SRCPKGDEST ]] && SRCDEST="$YSRCDEST" makepkg --allsource -p ./PKGBUILD
(( EXPORT && EXPORTSRC )) && [[ $SRCPKGDEST ]] && SRCDEST="$YSRCDEST" y_makepkg --allsource -p ./PKGBUILD
return 0
}

Expand Down Expand Up @@ -412,12 +412,6 @@ get_pkgbuild() {
cd "$cwd"
}

# makepkg check root
if (( ! UID )); then
warning $(gettext 'makepkg dropped --asroot support, please run yaourt as a non-privileged user.')
exit 1
fi

# If we have to deal with PKGBUILD and makepkg, source makepkg conf(s)
source_makepkg_conf

Expand Down
2 changes: 2 additions & 0 deletions src/lib/util.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ program_arg() {
pacman_parse() { LC_ALL=C pacman --color never "${PACMAN_C_ARG[@]}" "$@"; }
pacman_out() { $PACMAN "${PACMAN_C_ARG[@]}" "${PACMAN_O_ARG[@]}" "$@"; }
pkgquery() { package-query "${PKGQUERY_C_ARG[@]}" "$@"; }
y_makepkg() { $MAKEPKG "${MAKEPKG_ARG[@]}" "$@"; }
curl_fetch() { curl "${CURL_C_ARG[@]}" "$@"; }

# Run editor
Expand Down Expand Up @@ -250,6 +251,7 @@ TMPDIR=${TMPDIR:-/tmp}
check_dir TMPDIR || die 1
YAOURTTMPDIR="$TMPDIR/yaourt-tmp-$(id -un)"
export PACMAN=${PACMAN:-pacman}
export MAKEPKG=${MAKEPKG:-makepkg}
# Add --aur-url option to package-query args
program_arg $A_PKC --aur-url "$AURURL"

Expand Down
1 change: 1 addition & 0 deletions src/yaourtrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

# Command
#PACMAN="pacman"
#MAKEPKG="makepkg"
#DIFFEDITCMD="vimdiff"

# pacdiffviewer
Expand Down

0 comments on commit 1997977

Please # to comment.