Skip to content

Instantly share code, notes, and snippets.

@boombatower
Last active September 29, 2016 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boombatower/060d80ad1205407baf397e33f19d200a to your computer and use it in GitHub Desktop.
Save boombatower/060d80ad1205407baf397e33f19d200a to your computer and use it in GitHub Desktop.
workaround for pmbs tmpdir issue
#!/bin/bash
# workaround for pmbs tmpdir issue
# usage:
# watch -n 60 -e ./rebuild Multimedia obs-studio
project=$1
package=$2
results=($(osc results $project $package))
complete=true
for ((i = 2; i < ${#results[@]}; i=i+3))
do
status="${results[$i]}"
if [[ "$status" == "failed" ]]; then
echo -n "rebuild ${results[$((i - 2))]} ${results[$((i - 1))]}..."
osc rebuild $project $package ${results[$((i - 2))]} ${results[$((i - 1))]}
fi
if [[ "$status" != "succeeded" && "$status" != "disabled" && "$status" != "unresolvable" ]]; then
complete=false
fi
done
# signal complete with non-zero code for watch style execution
if [[ "$complete" == "true" ]]; then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment