From 32b7186cdc5b2351aae5e621105b9c81bf994b23 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 15 Dec 2022 09:48:27 +0100 Subject: Make the script resilient against packages which have only "multibuild" versions. Happens with Lua packages. --- time-of-build.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'time-of-build.sh') 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)" -- cgit