From 1a3322fa4a97f47aa8ec6c86082785c1c8e8bcd3 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Fri, 17 May 2019 02:21:24 -0400 Subject: [PATCH] rebuild: add --resume-from --- rebuild.sh | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/rebuild.sh b/rebuild.sh index 841d3f2..e175e6b 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -1,3 +1,4 @@ +m64pncp=mupen64plus-noncore-plugins-git all_pkgs=( # deps cef-standard @@ -27,7 +28,7 @@ all_pkgs=( motsognir mupen64plus-git mupen64plus-gui-git - mupen64plus-noncore-plugins-git + $m64pncp nicotine-plus-git obs-linuxbrowser-bin obs-studio-git @@ -47,15 +48,15 @@ all_pkgs=( zdoom ) declare -A options=( - ["cef-standard"]="--asdeps" - ["cereal"]="--asdeps" - ["libsodium-git"]="--asdeps" - ["mozc"]="--asdeps" - ["vim-runtime-git"]="--asdeps" + [cef-standard]="--asdeps" + [cereal]="--asdeps" + [libsodium-git]="--asdeps" + [mozc]="--asdeps" + [vim-runtime-git]="--asdeps" - ["higan"]="--handle Higan --url https://gitlab.com/higan/higan.git/" - ["mupen64plus-noncore-plugins-git"]="-f --url https://git.greyserv.net/marrub/mupen64plus-noncore-plugins-git.git" - ["ppsspp-git"]="--install-as ppsspp-git" + [higan]="--handle Higan --url https://gitlab.com/higan/higan.git/" + [$m64pncp]="-f --url https://git.greyserv.net/marrub/$m64pncp.git" + [ppsspp-git]="--install-as ppsspp-git" ) pkg_ver() { sed '/^pkgver\=/!d;s/pkgver\=\(.*\)/\1/' PKGBUILD @@ -102,7 +103,7 @@ build_package() { shift 2 ;; --asdeps|--skipinteg|-f) - makepkg_args="$makepkg_args $1" + makepkg_args+=" $1" shift ;; *) @@ -140,7 +141,7 @@ build_package() { if [[ ! $install_as ]] then - makepkg_args="$makepkg_args -i" + makepkg_args+=" -i" fi makepkg $makepkg_args @@ -155,14 +156,35 @@ build_package() { exit_on_err $? fi } +resume_from() { + local resume + + for pkg in ${all_pkgs[*]} + do + [[ $pkg = $1 ]] && resume=1 + [[ $resume ]] && echo $pkg + done +} main() { local pkg local pkgs - if (( $# )) + while (( $# )) + do + case $1 in + --resume-from) + pkgs+=" $(resume_from $2)" + shift 2 + ;; + *) + pkgs+=" $1" + shift + ;; + esac + done + + if [[ ! $pkgs ]] then - pkgs=$@ - else pkgs=${all_pkgs[*]} fi