2011-12-14 02:35:41 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
#
|
|
|
|
# While updating versions of QEMU to 1.0 I got fed up with the
|
|
|
|
# quilt workflow and just put up a git tree that contains all
|
|
|
|
# the commits on top of a stable tarball.
|
|
|
|
#
|
|
|
|
# When updating this package, just either update the git tree
|
|
|
|
# below (use rebase!) or change the tree path and use your own
|
|
|
|
#
|
|
|
|
# That way we can easily rebase against the next stable release
|
|
|
|
# when it comes.
|
|
|
|
|
|
|
|
GIT_TREE=git://repo.or.cz/qemu/agraf.git
|
|
|
|
GIT_LOCAL_TREE=/suse/agraf/git/qemu
|
2012-05-15 14:58:40 +02:00
|
|
|
GIT_BRANCH=suse-1.1
|
2012-05-23 20:34:03 +02:00
|
|
|
GIT_UPSTREAM_TAG=v1.1.0-rc3
|
2012-05-07 12:08:51 +02:00
|
|
|
QEMU_TMP=/dev/shm/qemu-tmp
|
2011-12-14 02:35:41 +01:00
|
|
|
|
|
|
|
# clean up
|
|
|
|
if [ -e 0001-* ]; then
|
|
|
|
osc rm --force 0*
|
|
|
|
fi
|
|
|
|
rm -f qemu.spec
|
|
|
|
|
|
|
|
# fetch all patches
|
2012-05-07 12:08:51 +02:00
|
|
|
rm -rf $QEMU_TMP
|
|
|
|
OSCDIR="$(pwd)"
|
2011-12-14 02:35:41 +01:00
|
|
|
if [ -d "$GIT_LOCAL_TREE" ]; then
|
2012-05-07 12:08:51 +02:00
|
|
|
git clone -ls $GIT_LOCAL_TREE $QEMU_TMP
|
|
|
|
cd $QEMU_TMP
|
2011-12-14 02:35:41 +01:00
|
|
|
else
|
2012-05-07 12:08:51 +02:00
|
|
|
git clone $GIT_TREE $QEMU_TMP
|
|
|
|
cd $QEMU_TMP
|
2012-03-06 20:33:45 +01:00
|
|
|
git remote add upstream git://git.qemu.org/qemu.git
|
|
|
|
git remote update
|
2011-12-14 02:35:41 +01:00
|
|
|
fi
|
|
|
|
git checkout $GIT_BRANCH
|
2012-05-07 12:08:51 +02:00
|
|
|
git format-patch -N $GIT_UPSTREAM_TAG -o "$OSCDIR"
|
|
|
|
cd "$OSCDIR"
|
|
|
|
rm -rf $QEMU_TMP
|
2011-12-14 02:35:41 +01:00
|
|
|
|
2012-03-07 16:17:02 +01:00
|
|
|
# cut off file name after 40 bytes, so we work around git version differences
|
|
|
|
# while at it, also remove the signature
|
|
|
|
for i in 0*; do
|
|
|
|
PATCHNAME=${i%.patch}
|
|
|
|
PATCHNAME=${i:0:40}.patch
|
2012-05-07 12:08:51 +02:00
|
|
|
head -n $(expr $(wc -l $i | cut -d ' ' -f 1) - 3) $i > "$PATCHNAME.tmp"
|
2012-03-07 16:17:02 +01:00
|
|
|
rm "$i"
|
2012-05-07 12:08:51 +02:00
|
|
|
mv "$PATCHNAME.tmp" "$PATCHNAME"
|
2012-03-07 16:17:02 +01:00
|
|
|
done
|
|
|
|
|
2011-12-14 02:35:41 +01:00
|
|
|
# we have all patches as files now - generate the spec file!
|
2012-03-04 00:28:15 +01:00
|
|
|
while IFS= read -r line; do
|
2011-12-14 02:35:41 +01:00
|
|
|
if [ "$line" = "PATCH_FILES" ]; then
|
|
|
|
for i in 0*; do
|
|
|
|
NUM=${i%%-*}
|
2012-03-04 00:28:15 +01:00
|
|
|
echo -e "Patch$NUM: $i"
|
2011-12-14 02:35:41 +01:00
|
|
|
done
|
|
|
|
elif [ "$line" = "PATCH_EXEC" ]; then
|
|
|
|
for i in 0*; do
|
|
|
|
NUM=${i%%-*}
|
|
|
|
echo "%patch$NUM -p1"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "$line"
|
|
|
|
fi
|
|
|
|
done < qemu.spec.in > qemu.spec
|
|
|
|
osc add 0*
|
|
|
|
|