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 <mvedovati@suse.com>
This commit is contained in:
Marco Vedovati 2018-11-19 19:35:27 +01:00
parent e5a2f4aa45
commit 3fe90cc439

View File

@ -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 $@