From 3fe90cc439e5fdccaf1354c41f532de5eec25116 Mon Sep 17 00:00:00 2001 From: Marco Vedovati Date: Mon, 19 Nov 2018 19:35:27 +0100 Subject: [PATCH] build_all.sh: specify a list of projects as extra args Add the ability to specify a list of projects to process, instead of processing all projects (default behaviour). Fixes: #244 Signed-off-by: Marco Vedovati --- obs-packaging/build_all.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/obs-packaging/build_all.sh b/obs-packaging/build_all.sh index bb10a3c167..887b8fd15c 100755 --- a/obs-packaging/build_all.sh +++ b/obs-packaging/build_all.sh @@ -41,9 +41,13 @@ main() { local branch="${1:-}" [ -n "${branch}" ] || usage "missing branch" "1" - pushd "${script_dir}" - for p in "${OBS_PKGS_PROJECTS[@]}"; do - pushd "$p" >>/dev/null + shift + local projectsList=("$@") + [ "${#projectsList[@]}" = "0" ] && projectsList=("${OBS_PKGS_PROJECTS[@]}") + + pushd "${script_dir}" >>/dev/null + for p in "${projectsList[@]}"; do + [ -d "$p" ] || usage "$p is not a valid project directory" "1" update_cmd="./update.sh" if [ -n "${PUSH}" ]; then # push to obs @@ -53,11 +57,13 @@ main() { update_cmd+=" -l" fi - echo "update ${p}" + echo "======= Updating ${p} =======" + pushd "$p" >>/dev/null bash -c "${update_cmd} ${branch}" popd >>/dev/null + echo "" done - popd + popd >> /dev/null } main $@