source: trunk/technical/common/build/svn_osc_build.sh@ 723

Last change on this file since 723 was 723, checked in by joergs, on Oct 2, 2008 at 5:51:33 PM

trying to avoid new version for the build server, when nothing has changed. Unfortunally, transfering data to the build server (tar.bz2) changes the file, resulting in a new commit every time the script is called.

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3#
4# svn_build_prepare.sh:
5# erzeugen des SPEC und der tar.gz. Ablegen in $DEST/buildsrc/src/PACKETNAME
6# überprüfen ob projekt exisitert
7# osc commit
8# osc build
9#
10#
11
12[ -z "$BUILD_USES_SVN" ] && BUILD_USES_SVN="yes"
13
14BUILDUSER=$USER
15[ -z $DEST_DIR ] && DEST_DIR="/tmp/build.$BUILDUSER"
16BUILDTEMP=$DEST_DIR/buildsrc/
17
18if [ ! -r OSC_PACKAGE ]; then
19 echo "failed to read config file OSC_PACKAGE"
20 exit 1
21fi
22
23OSC_PACKAGE=`cat OSC_PACKAGE`
24
25svn_build_prepare.sh $* || {
26 echo "failed to prepare sources"
27 exit 1
28}
29
30# TODO: get this info from svn_build_prepare.sh? seperate script?
31if [ -z "$1" ]; then
32 # without parameter, we are in source directory
33 SPECFILE=$(ls *.spec | awk '{print $1}')
34 PACKAGE=$(sed -n -e 's/^Name:\W*//pi' <$SPECFILE)
35 # use Version from BUILDSRC,
36 # because it has been modified by svn_build_prepare
37 #VERSION=$(sed -n -e 's/^Version:\W*//pi' <$SPECFILE)
38 BUILDSRC_DIR=${BUILDTEMP}/src/${PACKAGE}
39 VERSION=$(sed -n -e 's/^Version:\W*//pi' <$BUILDSRC_DIR/$SPECFILE)
40fi
41
42# RPMs can be handeld directly by osc
43# elif [ -r "$1" ]; then
44# # parameter is src.rpm file
45# PACKAGE=`rpm -qp --qf "%{NAME}" $1`
46# VERSION=`rpm -qp --qf "%{VERSION}" $1`
47
48if [ -z "$PACKAGE" ]; then
49 echo "nothing to build found!"
50 exit 1
51fi
52
53echo "Version: $VERSION"
54
55osc co $OSC_PACKAGE || {
56 # error message already from osc
57 exit 1
58}
59# rsync is not usable, because ":" is interpretaded as remote host
60#rsync -av "$BUILDSRC_DIR/*" "$OSC_PACKAGE/."
61#cp -av $BUILDSRC_DIR/* $OSC_PACKAGE/.
62
63cd $OSC_PACKAGE
64# rsync -a: -rlptgoD
65# but we don't want to check for timestamps
66# TODO: if our data (tar.bz2) is transfered to the
67# openSUSE server, the size changed!!! Why?
68# Therefore every new build run
69# results in a new commit for the build server
70rsync --checksum -r -v --delete $BUILDSRC_DIR/. . --exclude .osc
71
72# osc build DIST ARCH
73#osc add $FILELIST
74osc addremove
75osc commit -m "release $VERSION"
Note: See TracBrowser for help on using the repository browser.