SHA256
1
0
forked from pool/qemu

Accepting request 829841 from home:bfrogers:branches:Virtualization

- Fix some shell syntax in update_git.sh, esp. an issue exposed by
  the most recent patch added

OBS-URL: https://build.opensuse.org/request/show/829841
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=567
This commit is contained in:
Bruce Rogers 2020-08-26 21:49:10 +00:00 committed by Git OBS Bridge
parent d7b5d85f67
commit f769244da1
2 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 26 21:46:05 UTC 2020 - Bruce Rogers <brogers@suse.com>
- Fix some shell syntax in update_git.sh, esp. an issue exposed by
the most recent patch added
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Aug 25 22:42:27 UTC 2020 - Bruce Rogers <brogers@suse.com> Tue Aug 25 22:42:27 UTC 2020 - Bruce Rogers <brogers@suse.com>

View File

@ -363,10 +363,10 @@ rm -rf $BUNDLE_DIR
sed -E -i 's/(^index [a-f0-9]{28})[a-f0-9]{12}([.][.][a-f0-9]{28})[a-f0-9]{12}( [0-9]{6}$)/\1\2\3/' $i sed -E -i 's/(^index [a-f0-9]{28})[a-f0-9]{12}([.][.][a-f0-9]{28})[a-f0-9]{12}( [0-9]{6}$)/\1\2\3/' $i
BASENAME=$(basename $i) BASENAME=$(basename $i)
if [ "$FIVE_DIGIT_POTENTIAL" = "1" ]; then if [ "$FIVE_DIGIT_POTENTIAL" = "1" ]; then
if [[ $BASENAME =~ [[:digit:]]{5}.* ]]; then if [[ "$BASENAME" =~ ^[[:digit:]]{5}.* ]]; then
: :
else else
BASENAME=0$BASENAME BASENAME=0"$BASENAME"
fi fi
fi fi
if [[ "$NUMBERED_PATCHES" = "0" ]]; then if [[ "$NUMBERED_PATCHES" = "0" ]]; then
@ -374,23 +374,23 @@ rm -rf $BUNDLE_DIR
else else
KEEP_COUNT=40 KEEP_COUNT=40
fi fi
tail -n +2 $i > $CMP_DIR/${BASENAME:0:$KEEP_COUNT}.patch tail -n +2 $i > $CMP_DIR/"${BASENAME:0:$KEEP_COUNT}".patch
rm $i rm $i
done done
if [[ "$NUMBERED_PATCHES" = "0" ]]; then if [[ "$NUMBERED_PATCHES" = "0" ]]; then
for i in [0-9]*.patch; do for i in [0-9]*.patch; do
osc rm --force $i osc rm --force "$i"
done done
# make sure that w/out the numbered prefixes, the patchnames are all unique # make sure that w/out the numbered prefixes, the patchnames are all unique
mkdir checkdir mkdir checkdir
for i in $CMP_DIR/*; do for i in $CMP_DIR/*; do
BASENAME=$(basename $i) BASENAME=$(basename $i)
FINALNAME=${BASENAME:4+$FIVE_DIGIT_POTENTIAL+1:40+1+5} FINALNAME="${BASENAME:4+$FIVE_DIGIT_POTENTIAL+1:40+1+5}"
if [[ -e checkdir/$FINALNAME ]]; then if [[ -e checkdir/"$FINALNAME" ]]; then
echo "ERROR! Patch name $FINALNAME is not unique! Please modify patch subject to achieve uniqueness" echo "ERROR! Patch name $FINALNAME is not unique! Please modify patch subject to achieve uniqueness"
exit 1 exit 1
fi fi
cp $i checkdir/$FINALNAME cp $i checkdir/"$FINALNAME"
done done
CHECK_DIR=checkdir CHECK_DIR=checkdir
cp $CMP_DIR/*.patch . cp $CMP_DIR/*.patch .
@ -404,10 +404,10 @@ rm -rf $BUNDLE_DIR
fi fi
for i in $CHECK_DIR/*; do for i in $CHECK_DIR/*; do
BASENAME=$(basename $i) BASENAME=$(basename $i)
if [ -e $BASENAME ]; then if [ -e "$BASENAME" ]; then
if cmp -s $i $BASENAME; then if cmp -s "$i" "$BASENAME"; then
touch --reference=$BASENAME $i touch --reference="$BASENAME" "$i"
rm $BASENAME rm "$BASENAME"
let UNCHANGED_COUNT+=1 let UNCHANGED_COUNT+=1
else else
if [ "${BASENAME:0:1+$FIVE_DIGIT_POTENTIAL}" = "$CHECK_PREFIX" ]; then if [ "${BASENAME:0:1+$FIVE_DIGIT_POTENTIAL}" = "$CHECK_PREFIX" ]; then
@ -432,7 +432,7 @@ rm -rf $BUNDLE_DIR
NUMBERED_PATCH_RE="^[[:digit:]]{5}-.*[.]patch$" NUMBERED_PATCH_RE="^[[:digit:]]{5}-.*[.]patch$"
fi fi
for i in *.patch; do for i in *.patch; do
if [[ $i =~ $NUMBERED_PATCH_RE ]]; then if [[ "$i" =~ $NUMBERED_PATCH_RE ]]; then
if [[ "$NUMBERED_PATCHES" = "1" ]]; then if [[ "$NUMBERED_PATCHES" = "1" ]]; then
osc rm --force $i osc rm --force $i
echo " $i" >> qemu.changes.deleted echo " $i" >> qemu.changes.deleted