aboutsummaryrefslogtreecommitdiffstats
path: root/time-of-build.sh
diff options
context:
space:
mode:
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)"