From 3e409fbb314467423dec2f0cf7e40d43263d7b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20de=20Hesselle?= Date: Fri, 2 Aug 2019 23:07:03 +0200 Subject: Restart gtk-mac-bundler up to 5 times This is an attempt to work around the current issue with gtk-mac-bundler failing. The issue itself hasn't been found and hasn't occured on my testing setup or on a second runner that is equal to the production runner. --- packaging/macos/220-inkscape-package.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh index 83a01d9af..1f60e7352 100755 --- a/packaging/macos/220-inkscape-package.sh +++ b/packaging/macos/220-inkscape-package.sh @@ -28,9 +28,31 @@ mkdir -p $ARTIFACT_DIR cp $SRC_DIR/gtk-mac-bundler*/examples/gtk3-launcher.sh $BUILD_DIR cp $SELF_DIR/inkscape.bundle $BUILD_DIR cp $SELF_DIR/inkscape.plist $BUILD_DIR - cd $BUILD_DIR - jhbuild run gtk-mac-bundler inkscape.bundle + + # FIXME: I don't like this at all! This is a temporary workaround, retrying + # the bundling if it fails up to 5 times. + + set +e + RESTART=0 + while [ $RESTART -lt 6 ]; do + jhbuild run gtk-mac-bundler inkscape.bundle + RC=$? + if [ $RC -eq 0 ]; then + break + else + ((RESTART++)) + SECONDS=$((RESTART*10)) + echo "Bundling failed. Restarting in $SECONDS seconds." + sleep $SECONDS + fi + done + set -e + + if [ $RC -ne 0 ]; then + echo "--- FATAL --- Bundling failed." + exit $RC + fi ) # patch library locations -- cgit v1.2.3