laodvars default makepkg.conf loading

This commit is contained in:
artoo 2014-11-13 13:33:38 +01:00
parent 956f3c32bc
commit a4a397d9be
6 changed files with 35 additions and 51 deletions

View file

@ -17,14 +17,14 @@ if [[ -r @libdir@/messages.sh ]];then
source @libdir@/messages.sh
fi
if [[ -r @libdir@/util-build.sh ]];then
source @libdir@/util-build.sh
fi
if [[ -r @libdir@/util.sh ]];then
source @libdir@/util.sh
fi
if [[ -r @libdir@/util-build.sh ]];then
source @libdir@/util-build.sh
fi
pkg_owner=${SUDO_USER:-$USER}
if [[ -n $SUDO_USER ]]; then
@ -139,10 +139,10 @@ run(){
chroot_init
prepare_dir "${pkgdir}"
chroot_build
ch_owner "$(dirname ${pkgdir})"
ch_owner "${pkg_owner}" "$(dirname ${pkgdir})"
if ${sign}; then
sign_pkgs
sign_pkgs "${pkg_owner}"
fi
fi
}

View file

@ -20,17 +20,8 @@ fi
shopt -s extglob
# Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then
source '/etc/makepkg.conf'
else
die '/etc/makepkg.conf not found!'
fi
# Source user-specific makepkg.conf overrides
if [[ -r ~/.makepkg.conf ]]; then
source ~/.makepkg.conf
fi
load_vars "$HOME/.makepkg.conf"
load_vars /etc/makepkg.conf
if [[ ! -f PKGBUILD ]]; then
die 'This must be run in the directory of a built package.'

View file

@ -14,14 +14,14 @@ if [[ -r @libdir@/messages.sh ]];then
source @libdir@/messages.sh
fi
if [[ -r @libdir@/util-mount.sh ]];then
source @libdir@/util-mount.sh
fi
if [[ -r @libdir@/util.sh ]];then
source @libdir@/util.sh
fi
if [[ -r @libdir@/util-mount.sh ]];then
source @libdir@/util-mount.sh
fi
working_dir=''
usage() {

View file

@ -14,7 +14,8 @@ if [[ -r @libdir@/messages.sh ]];then
source @libdir@/messages.sh
fi
. /etc/makepkg.conf
load_vars "$HOME/.makepkg.conf"
load_vars /etc/makepkg.conf
if [ ! -e "$1" ]; then
error "Package '$1' does not exists!"

View file

@ -9,23 +9,21 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
ext='pkg.tar.xz'
ch_owner(){
msg "chown -R [$pkg_owner:users] [$1]"
chown -R "$pkg_owner:users" "$1"
#msg "Changing owner [$1:users] [$2]"
chown -R "$1:users" "$2"
}
sign_pkgs(){
cd $pkgdir
su $pkg_owner <<'EOF'
su $1 <<'EOF'
signpkgs
EOF
}
move_pkg(){
msg2 "Moving [$1] to [${pkgdir}]"
local
#msg2 "Moving [$1] to [${pkgdir}]"
local ext='pkg.tar.xz'
if [[ -n $PKGDEST ]];then
mv $PKGDEST/*{any,$arch}.${ext} ${pkgdir}/
else
@ -50,27 +48,21 @@ prepare_dir(){
clean_up(){
msg "Cleaning up ..."
if [[ -n $LOGDEST ]];then
msg2 "Cleaning logs $LOGDEST ..."
rm -r $LOGDEST/*.log
else
msg2 "Cleaning logs $(pwd) ..."
rm -r $(pwd)/*.log
local query=$(find ${pkgdir} -maxdepth 1 -name "*.*")
if [[ -n $query ]];then
rm -v $query
fi
msg2 "Cleaning ${pkgdir} ..."
rm -r ${pkgdir}/*.pkg.tar.xz{,.sig}
if [[ -n $SRCDEST ]];then
msg2 "Cleaning src files $SRCDEST ..."
rm -r $SRCDEST/*.?z
else
msg2 "Cleaning src files $(pwd) ..."
rm -r $(pwd)/*.?z
if [[ -z $LOGDEST ]];then
query=$(find $(pwd) -maxdepth 2 -name '*.log')
if [[ -n $query ]];then
rm -v $query
fi
fi
if [[ -z $BUILDDIR ]];then
msg2 "Cleaning src $(pwd) ..."
rm -r $(pwd)/src
msg2 "Cleaning pkg $(pwd) ..."
rm -r $(pwd)/pkg
if [[ -z $SRCDEST ]];then
query=$(find $(pwd) -maxdepth 2 -name '*.?z?')
if [[ -n $query ]];then
rm -v $query
fi
fi
}
@ -94,10 +86,10 @@ blacklist_pkg(){
chroot_clean(){
for copy in "$1"/*; do
[[ -d $copy ]] || continue
[[ -d ${copy} ]] || continue
msg2 "Deleting chroot copy '$(basename "${copy}")'..."
lock 9 "$copy.lock" "Locking chroot copy '$copy'"
lock 9 "${copy}.lock" "Locking chroot copy '${copy}'"
if [[ "$(stat -f -c %T "${copy}")" == btrfs ]]; then
{ type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null

View file

@ -154,7 +154,7 @@ load_vars() {
[[ -f $mpkg_conf ]] || return 1
for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER BUILDDIR; do
for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER CARCH GPGKEY; do
[[ -z ${!var} ]] && eval $(grep "^${var}=" "$mpkg_conf")
done