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
|
|
|
|
GIT_BRANCH=suse-1.0
|
|
|
|
GIT_UPSTREAM_TAG=v1.0
|
|
|
|
|
|
|
|
# clean up
|
|
|
|
if [ -e 0001-* ]; then
|
|
|
|
osc rm --force 0*
|
|
|
|
fi
|
|
|
|
rm -f qemu.spec
|
|
|
|
|
|
|
|
# fetch all patches
|
|
|
|
if [ -d "$GIT_LOCAL_TREE" ]; then
|
|
|
|
git clone -ls $GIT_LOCAL_TREE qemu-tmp
|
|
|
|
else
|
|
|
|
git clone $GIT_TREE qemu-tmp
|
|
|
|
fi
|
|
|
|
cd qemu-tmp
|
|
|
|
git checkout $GIT_BRANCH
|
2012-02-01 00:10:40 +01:00
|
|
|
git format-patch $GIT_UPSTREAM_TAG -o ..
|
2011-12-14 02:35:41 +01:00
|
|
|
cd ..
|
|
|
|
rm -rf qemu-tmp
|
|
|
|
|
|
|
|
# we have all patches as files now - generate the spec file!
|
|
|
|
while read line; do
|
|
|
|
if [ "$line" = "PATCH_FILES" ]; then
|
|
|
|
for i in 0*; do
|
|
|
|
NUM=${i%%-*}
|
2012-02-28 05:13:32 +01:00
|
|
|
echo -e "Patch$NUM:\t$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*
|
|
|
|
|