aboutsummaryrefslogtreecommitdiffstats
path: root/time-of-build.sh
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2022-12-15 09:48:27 +0100
committerMatěj Cepl <mcepl@cepl.eu>2022-12-15 09:51:12 +0100
commit32b7186cdc5b2351aae5e621105b9c81bf994b23 (patch)
tree74eef5ded26a1b28ae5177afd1060062b8819c25 /time-of-build.sh
parentec06fe0a59c233b4a82040032bff413b213e89a5 (diff)
downloadtime-of-build-32b7186cdc5b2351aae5e621105b9c81bf994b23.tar.gz
Make the script resilient against packages which have only "multibuild" versions.
Happens with Lua packages.
Diffstat (limited to 'time-of-build.sh')
-rwxr-xr-xtime-of-build.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/time-of-build.sh b/time-of-build.sh
index a2ec4ec..916075c 100755
--- a/time-of-build.sh
+++ b/time-of-build.sh
@@ -1,12 +1,12 @@
#!/bin/sh
-set -eu
+set -u
if [ ! -r .osc/_project ] ; then
echo 'This program must be run from an OBS project directory.'
exit 42
fi
-projname="$(basename $(pwd))"
+projname="$(basename "$(pwd -P)")"
package="$1"
tempfile="$(mktemp -t time-of-build-XXXXXX)"
trap 'rm -rf "$tempfile"' EXIT
@@ -23,7 +23,9 @@ fi
total_time=0
for pkg in $process ; do
- osc rbl $projname $pkg openSUSE_Tumbleweed x86_64 >$tempfile
+ osc rbl $projname $pkg openSUSE_Tumbleweed x86_64 >$tempfile 2>/dev/null \
+ || continue
+
# begtime="Tue Dec 13 23:50:13 UTC 2022"
# \x22 is " character; https://unix.stackexchange.com/a/230354/184648
begstr="$(sed -E -n -e '/started \x22build/s/^.*at (.*)\.$/\1/p' $tempfile)"