1 From bc532427d6848210ab4e2bf81a6ab43a74f13338 Mon Sep 17 00:00:00 2001
2 From: Jaska Uimonen <jaska.uimonen@helsinki.fi>
3 Date: Wed, 6 Jun 2012 17:59:11 +0300
4 Subject: [PATCH 7/8] scripts: added obs-export.sh.
7 obs-export.sh | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 1 files changed, 92 insertions(+), 0 deletions(-)
9 create mode 100755 obs-export.sh
11 diff --git a/obs-export.sh b/obs-export.sh
13 index 0000000..c13853a
19 +# This needs a bit more work, mostly on the "discplined engineering" front.
20 +# IOW, instead of this UPSTREAM_BASE hack it would be better to have 3
22 +# 1) pristine upstream: for tracking upstream progress/retrogression
23 +# 2) patched upstream: pristine upstream with outr patches applied
24 +# 3) working local: patches upstream + a set of scripts (like this) to
25 +# do everyday stuff like making new releases, exporting stuff to
29 +PKG="$(basename `pwd` | tr [:upper:] [:lower:])"
30 +UPSTREAM_BASE="06476e68a42077a0597628dca1c4a53cd20f5236"
31 +VERSION="`date +'%Y%m%d'`"
34 +while [ "${1#-}" != "$1" -a -n "$1" ]; do
49 + echo "usage: $0 [-n <name>][-v <version>][-b <upstream-base>]"
51 + echo "<name> is the name of the package, <version> is the version"
52 + echo "you want to export to OBS, and <upstream-base> is the name of"
53 + echo "the upstream git branch or the SHA1 you want to generate your"
54 + echo "OBS tarball from and base your patches on top of. The output"
55 + echo "will be generated in a directory called obs-$VERSION."
58 + echo " $0 -n pulseaudio -v 2.0 -b pulseaudio-2.0"
60 + echo "This will produce an OBS export with version 2.0 against the"
61 + echo "SHA1 pulseaudio-2.0 and place the result in obs-2.0."
64 + *) echo "usage: $0 [-n <name>][-v <version>][-b <upstream-base>]"
71 +echo "VERSION=$VERSION"
72 +echo "UPSTREAM_BASE=$UPSTREAM_BASE"
75 +mkdir obs-$VERSION && \
76 + git archive --format=tar --prefix=$PKG-$VERSION/ $UPSTREAM_BASE \
77 + > obs-$VERSION/$PKG-$VERSION.tar && \
78 + gzip obs-$VERSION/$PKG-$VERSION.tar && \
80 + git format-patch -n $UPSTREAM_BASE && \
81 + cat ../$PKG.spec.in | sed "s/@VERSION@/$VERSION/g" > $PKG.spec.in && \
85 +patchlist="`ls *.patch`"
86 +cat $PKG.spec.in | while read line; do
90 + for patch in $patchlist; do
91 + echo "Patch$i: $patch"
97 + for patch in $patchlist; do
108 +rm -f obs-$VERSION/$PKG.spec.in