qemu/checkbundle.sh
Bruce Rogers 0f796dd004 Accepting request 730437 from Virtualization:Staging
Update to v4.1.0. Also includes other major packaging changes as follows:
There is a new package maintenance workflow - see README.PACKAGING for details.
The sibling packages qemu-linux-user and qemu-testsuite are now created with the Build Service's MultiBuild feature. This also necessitates combining the qemu-linux-user changelog content back into qemu's. Luckily the delta there is quite small. Note that the qemu spec file is now that much busier, but added section markers should help reduce the confusion. Also qemu is being enabled for RISCV host compatibility, so some changes are related to that as well.

OBS-URL: https://build.opensuse.org/request/show/730437
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=487
2019-09-12 15:54:03 +00:00

51 lines
1.6 KiB
Bash

#!/bin/bash
#
# This script simply does some basic checks on the bundle tarball
# NYI: report if the required base commit isn't there - they may need to fetch the latest from upstream
set -e
source ./config.sh
rm -rf $GIT_DIR
rm -rf $BUNDLE_DIR
mkdir -p $GIT_DIR
mkdir -p $BUNDLE_DIR
tar xJf bundles.tar.xz -C $BUNDLE_DIR
BUNDLE_FILES=$(find $BUNDLE_DIR -printf "%P\n"|grep "bundle$")
git -C $GIT_DIR init
# !!!! I suspect that given the current format of the bundles dir struct, the 1st isn't used
# I suspect also that we are getting a redundant ./ in the path which isn't helpful
for entry in ${BUNDLE_FILES[@]}; do
if [[ $entry =~ ^(.*)[/]*([a-f0-9]{40})[.]bundle$ ]]; then
SUBDIR=${BASH_REMATCH[1]}
GITREPO_COMMIT_ISH=${BASH_REMATCH[2]}
else
echo "ERROR! BAD BUNDLE CONTENT!"
exit
fi
for (( i=0; i <$REPO_COUNT; i++ )); do
if [[ "$SUBDIR" = "${PATCH_PATH_MAP[$i]}" ]]; then
PATCH_RANGE_INDEX=$i
break
fi
done
if [ "$(git -C $GIT_DIR bundle verify $BUNDLE_DIR/$entry 2>&1>/dev/null|tail --lines=1)" == "error: $GITREPO_COMMIT_ISH" ]; then
echo "Verified bundle name matches bundle's base commit as expected"
fi
git bundle list-heads $BUNDLE_DIR/$entry
LOCAL_REPO=$(readlink -f ${LOCAL_REPO_MAP[$PATCH_RANGE_INDEX]})
if [ -e $LOCAL_REPO ]; then
echo "Found local repo $LOCAL_REPO corresponding to archived git bundle, verifying base commit is present (ok if no error)..."
git -C $LOCAL_REPO verify-commit $GITREPO_COMMIT_ISH || true
else
echo "No local repo $LOCAL_REPO corresponding to archived git bundle"
fi
done
rm -rf $GIT_DIR
rm -rf $BUNDLE_DIR