Mailinglist Archive: opensuse-buildservice (258 mails)

< Previous Next >
Re: [opensuse-buildservice] Integrating SCM with OBS
  • From: "Hans-Peter Jansen" <hpj@xxxxxxxxx>
  • Date: Fri, 13 Aug 2010 16:10:38 +0200
  • Message-id: <201008131610.38476.hpj@xxxxxxxxx>
On Friday 13 August 2010, 11:31:05 Marcus Meissner wrote:

e.g. for wine in OBS I have this simple script which pulls daily git
snapshots, including detecting unchanged state and seperating local
patches:

#!/bin/bash -x
bsdir="/suse/meissner/projects/Emulators:Wine/wine-snapshot"
snapdir=/suse/meissner/projects/snapshot-wine/
xdate=`date +%Y%m%d`

cd $bsdir
cd $snapdir/wine
git pull
chars=`git diff '@{1 day ago}' | wc -c`
if [ "$chars" == "0" ]; then
echo "*** No git change found from yesterday, not rebuilding
package."
exit 0
fi
rm $bsdir/wine-*.tar.bz2
winever=`cat VERSION|sed -e 's/Wine version //;s/1.2-/1.2./;'`
git archive origin --prefix=wine-$winever.$xdate/ | bzip2
$bsdir/wine-$winever.$xdate.tar.bz2 # perhaps split into seperate
patches
git diff origin..master > $bsdir/susepatches.patch
cd $bsdir
perl -pi -e "s/Version:.*/Version:$winever.$xdate/;" wine-snapshot.spec
osc addremove
osc ci -m "$xdate git checkout"

Cool script, Marcus.

You might want to replace the perl -pi -e expression with sed -i, which has
the same effect and should spare you a few milliseconds ;-).

Cheers,
Pete
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >