SHA256
1
0
forked from pool/qemu

Accepting request 734440 from home:bfrogers:branches:Virtualization

Add in upstream stable patches. Also a new more minor tweaks.

OBS-URL: https://build.opensuse.org/request/show/734440
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=492
This commit is contained in:
Bruce Rogers
2019-10-02 02:17:15 +00:00
committed by Git OBS Bridge
parent 9616008bca
commit 6f08fa6f4d
28 changed files with 1582 additions and 83 deletions

View File

@@ -50,12 +50,10 @@ initbundle() {
# To alter the content of this tarball, lets use git to track these changes, and produce patches which can be included
# in the package spec file
# The following can get things a bit out of the expected order, but I don't think that is really much of a problem, as long as we're guaranteed to patch the superproject before any of it's submodules
# !!!! actually the simply submodule status --recursive w/out the additional processing we do for the groking of the bundle files
SUBMODULE_COMMIT_IDS=($(git -C ~/git/qemu-opensuse submodule status --recursive|awk '{print $1}'))
SUBMODULE_DIRS=($(git -C ~/git/qemu-opensuse submodule status --recursive|awk '{print $2}'))
SUBMODULE_COMMIT_IDS=($(git -C ${LOCAL_REPO_MAP[0]} submodule status --recursive|awk '{print $1}'))
SUBMODULE_DIRS=($(git -C ${LOCAL_REPO_MAP[0]} submodule status --recursive|awk '{print $2}'))
SUBMODULE_COUNT=${#SUBMODULE_COMMIT_IDS[@]}
# !!! I should be able to do this with simply math - ie: use (( ... ))
# TODO: do this with simply math - ie: use (( ... ))
if [[ "$REPO_COUNT" != "$(expr $SUBMODULE_COUNT + 1)" ]]; then
echo "ERROR: submodule count doesn't match the REPO_COUNT variable in config.sh file!"
exit
@@ -69,7 +67,7 @@ for (( i=0; i <$SUBMODULE_COUNT; i++ )); do
done
# also handle the superproject (I need to make this smarter, or change something - works for tag, but not normal commit:
GIT_UPSTREAM_COMMIT=$(git -C ~/git/qemu-opensuse show-ref -d $GIT_UPSTREAM_COMMIT_ISH|grep -F "^{}"|awk '{print $1}')
GIT_UPSTREAM_COMMIT=$(git -C ${LOCAL_REPO_MAP[0]} show-ref -d $GIT_UPSTREAM_COMMIT_ISH|grep -F "^{}"|awk '{print $1}')
touch $BUNDLE_DIR/$GIT_UPSTREAM_COMMIT.id
# Now go through all the submodule local repos that are present and create a bundle file for the patches found there
@@ -100,11 +98,7 @@ rm -rf $GIT_DIR
#==============================================================================
bundle2local() {
rm -rf $GIT_DIR
rm -rf $CMP_DIR
rm -rf $BUNDLE_DIR
rm -f checkpatch.log
mkdir -p $BUNDLE_DIR
tar xJf bundles.tar.xz -C $BUNDLE_DIR
BUNDLE_FILES=$(find $BUNDLE_DIR -printf "%P\n"|grep "bundle$")
@@ -137,13 +131,12 @@ for entry in ${BUNDLE_FILES[@]}; do
git -C $LOCAL_REPO remote add bundlerepo $BUNDLE_DIR/$entry
# in next, the head may be FETCH_HEAD or HEAD depending on how we created:
git -C $LOCAL_REPO fetch bundlerepo FETCH_HEAD
#git -C $LOCAL_REPO fetch bundlerepo HEAD
git -C $LOCAL_REPO branch frombundle FETCH_HEAD
git -C $LOCAL_REPO remote remove bundlerepo
done
echo "For each local repo found a branch named frombundle contains the patches from the bundle."
echo "Use this as the starting point for making changes to the $GIT_BRANCH, which gets used as"
echo "the source when updating the bundle stored with the package."
echo "For each local repo found, a branch named frombundle is created containing the"
echo "patches from the bundle. Use this as the starting point for making changes to"
echo "the $GIT_BRANCH, which is used when updating the bundle stored with the package."
rm -rf $BUNDLE_DIR
}
@@ -154,7 +147,7 @@ rm -rf $GIT_DIR
rm -rf $CMP_DIR
rm -rf $BUNDLE_DIR
rm -f checkpatch.log
rm -rf checkthese
rm -f checkthese
if [ "$GIT_UPSTREAM_COMMIT_ISH" = "LATEST" ]; then
# This is just a safety valve in case the above gets edited wrong:
@@ -192,15 +185,15 @@ if [ "$OLD_SOURCE_VERSION_AND_EXTRA" = "" ]; then
fi
mkdir -p $BUNDLE_DIR
# TODO: (repo file not yet done)
# This tarball has git bundles stored in a directory structure which mimics the
# submodule locations in the containing git repo. Also at that same dir level
# is a file named repo which contains the one line git repo url (with git:// or
# http(s) prefix). The bundles are named as follows:
# "{path/}{git_sha}.{patch_prefix}.{bundle}", where {path/} isn't present for
# "{path/}{git_sha}.{bundle}", where {path/} isn't present for
# the top (qemu) bundle (ie it's for submodules).
tar xJf bundles.tar.xz -C $BUNDLE_DIR
# !!! The following may be overkill, since it seems that find does do a depth first, which is all we need
BUNDLE_FILES=$(find $BUNDLE_DIR -printf "%P\n"|grep "bundle$")
if [ "$GIT_UPSTREAM_COMMIT_ISH" = "LATEST" ]; then
@@ -383,7 +376,6 @@ rm -rf $BUNDLE_DIR
if [[ "$NUMBERED_PATCHES" = "0" ]]; then
for i in [0-9]*.patch; do
osc rm --force $i
echo "calling osc rm on $i"
done
# we need to make sure that w/out the numbered prefixes, the patchnames are all unique
mkdir checkdir
@@ -401,9 +393,6 @@ rm -rf $BUNDLE_DIR
else
CHECK_DIR=$CMP_DIR
fi
#step 0, and 0.1 are done above - question remains if the numbered case should use check dir
rm -f checkthese
if [ "$FIVE_DIGIT_POTENTIAL" = "0" ]; then
CHECK_PREFIX="0"
else
@@ -438,19 +427,16 @@ rm -rf $BUNDLE_DIR
else
NUMBERED_PATCH_RE="^[[:digit:]]{5}-.*[.]patch$"
fi
#NEXT is #2 in lgorithm
for i in *.patch; do
if [[ $i =~ $NUMBERED_PATCH_RE ]]; then
if [[ "$NUMBERED_PATCHES" = "1" ]]; then
osc rm --force $i
echo "calling osc rm on $i"
echo " $i" >> qemu.changes.deleted
let DELETED_COUNT+=1
let TOTAL_COUNT+=1
fi
else
osc rm --force $i
echo "calling osc rm on $i"
echo " $i" >> qemu.changes.deleted
let DELETED_COUNT+=1
let TOTAL_COUNT+=1
@@ -459,15 +445,11 @@ rm -rf $BUNDLE_DIR
mv $CHECK_DIR/* .
if [ -e qemu.changes.added ]; then
xargs osc add < qemu.changes.added
echo "calling osc add on:"; cat qemu.changes.added
fi
# NYI do we need this check?
if [ ! -e checkpatch.pl ]; then
if [[ -e checkthese ]]; then
tar Jxf qemu-$SOURCE_VERSION$VERSION_EXTRA.tar.xz \
qemu-$SOURCE_VERSION/scripts/checkpatch.pl --strip-components=2
fi
if [[ -e checkthese ]]; then
for i in $(cat checkthese); do
./checkpatch.pl --no-tree --terse --no-summary --summary-file \
--patch $i >> checkpatch.log || true
@@ -609,12 +591,11 @@ osc service localrun format_spec_file
usage() {
echo "Usage:"
echo "git_update.sh: script to manage package maintenance using a git-based"
echo "workflow. Commands are as follows:"
echo " git2pkg (update package spec file and patches from git)"
echo "bash ./git_update.sh <command>: script to manage package maintenance"
echo "using a git-based workflow. Commands are as follows:"
echo " git2pkg (update package spec file and patches from git. Is default)"
echo " pkg2git (update git (frombundle branch) from the package "bundleofbundles")"
echo " refresh (refresh spec file from spec file template and "bundlofbundles")"
echo " (default is git2pkg)"
}
#==============================================================================
@@ -643,7 +624,7 @@ case $1 in
echo "SUCCESS"
echo "To modify package patches, use the frombundle branch as the basis for updating"
echo "the $GIT_BRANCH branch with the new patch queue."
echo "Then export the changes back to the package using git2pkg.sh"
echo "Then export the changes back to the package using update_git.sh git2pkg"
;;
refresh )
echo "Updating the spec file and patches from the spec file template and the bundle"