Merge branch 'master' into stable-0.12.x

This commit is contained in:
Philip 2016-06-17 20:18:41 +02:00
commit 1a488fc9f0
9 changed files with 33 additions and 28 deletions

View file

@ -1,4 +1,4 @@
Version=0.12.0 Version=0.12.1
PREFIX = /usr/local PREFIX = /usr/local
SYSCONFDIR = /etc SYSCONFDIR = /etc

View file

@ -102,8 +102,7 @@ display_settings(){
load_user_info load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf"
# to force old way to have buildiso run in iso-profiles dir # to force old way to have buildiso run in iso-profiles dir
# run_dir=$(pwd) # run_dir=$(pwd)
@ -169,6 +168,12 @@ done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
for sig in TERM HUP QUIT; do
trap "trap_exit $sig \"$(gettext "%s signal caught. Exiting...")\" \"$sig\"" "$sig"
done
trap 'trap_exit INT "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR
timer_start=$(get_timer) timer_start=$(get_timer)
check_root "$0" "${orig_argv[@]}" check_root "$0" "${orig_argv[@]}"

View file

@ -73,11 +73,8 @@ display_settings(){
load_user_info load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf" load_vars "$USER_HOME/.makepkg.conf" || load_vars /etc/makepkg.conf
load_vars "$USER_HOME/.makepkg.conf"
load_vars /etc/makepkg.conf
install_pkgs=() install_pkgs=()

View file

@ -36,8 +36,7 @@ display_settings(){
load_user_info load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf"
sync=false sync=false
pretend=false pretend=false

View file

@ -67,8 +67,7 @@ display_settings(){
load_user_info load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf"
run_dir=${cache_dir_iso} run_dir=${cache_dir_iso}

View file

@ -35,8 +35,7 @@ display_settings(){
load_user_info load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf"
automount=false automount=false
pretend=false pretend=false

View file

@ -292,8 +292,7 @@ move_products() {
umask 0022 umask 0022
load_vars "$USER_HOME/.makepkg.conf" load_vars "$USER_HOME/.makepkg.conf" || load_vars /etc/makepkg.conf
load_vars /etc/makepkg.conf
# Use PKGBUILD directory if these don't exist # Use PKGBUILD directory if these don't exist
[[ -d $PKGDEST ]] || PKGDEST=$PWD [[ -d $PKGDEST ]] || PKGDEST=$PWD

View file

@ -46,7 +46,7 @@ run_safe() {
set -e set -e
set -E set -E
restoretrap=$(trap -p ERR) restoretrap=$(trap -p ERR)
trap 'error_function $func' ERR SIGINT SIGTERM trap 'error_function $func' ERR
if ${verbose};then if ${verbose};then
run_log "$func" run_log "$func"
@ -59,6 +59,14 @@ run_safe() {
set +e set +e
} }
trap_exit() {
local sig=$1; shift
error "$@"
umount_image
trap -- "$sig"
kill "-$sig" "$$"
}
# $1: image path # $1: image path
make_sqfs() { make_sqfs() {
if [[ ! -d "$1" ]]; then if [[ ! -d "$1" ]]; then

View file

@ -250,23 +250,23 @@ move_to_cache(){
mv $src ${pkg_dir}/ mv $src ${pkg_dir}/
${sign} && sign_pkg "${src##*/}" ${sign} && sign_pkg "${src##*/}"
chown -R "${OWNER}:users" "${pkg_dir}" chown -R "${OWNER}:users" "${pkg_dir}"
} }
archive_logs(){ archive_logs(){
local archive name="$1" ext=log.tar.xz ver src=${tmp_dir}/archives.list local archive name="$1" ext=log.tar.xz ver src=${tmp_dir}/archives.list target='.'
ver=$(get_full_version "$name") ver=$(get_full_version "$name")
archive="${name}-${ver}-${target_arch}" archive="${name}-${ver}-${target_arch}"
find . -maxdepth 1 -name "$archive*.log" > $src if [[ -n $LOGDEST ]];then
msg2 "Archiving log files [%s] ..." "$archive.$ext" target=$LOGDEST
tar -cJf ${log_dir}/$archive.$ext -T $src find $target -maxdepth 1 -name "$archive*.log" -printf "%f\n" > $src
msg2 "Cleaning log files ..."
if [[ -z $LOGDEST ]];then
find . -maxdepth 1 -name "$archive*.log" -delete
chown "${OWNER}:users" "$archive.$ext"
else else
find $LOGDEST -maxdepth 1 -name "$archive*.log" -delete find $target -maxdepth 1 -name "$archive*.log" > $src
fi fi
msg2 "Archiving log files [%s] ..." "$archive.$ext"
tar -cJf ${log_dir}/$archive.$ext -C "$target" -T $src
msg2 "Cleaning log files ..."
find $target -maxdepth 1 -name "$archive*.log" -delete
} }
post_build(){ post_build(){
@ -281,7 +281,6 @@ post_build(){
src=$pkg-$ver-$tarch.$ext src=$pkg-$ver-$tarch.$ext
move_to_cache "$src" move_to_cache "$src"
done done
local name=${pkgbase:-$pkgname} local name=${pkgbase:-$pkgname}
archive_logs "$name" archive_logs "$name"
} }