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

Last change on this file since 732 was 725, checked in by joergs, on Oct 2, 2008 at 6:21:27 PM

data wasn't modified by transfer, but by dynamic Changes file inside the tar-file. svn_build_prepare now handles this. Checking return code of svn_build_prepare for proper exit message

  • 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 $*
26RT=$?
27if [ $RT -eq 1 ]; then
28 echo "nothing more to do"
29 exit 0
30elif [ $RT -gt 1 ]; then
31 echo "error: failed to prepare sources"
32 exit 1
33fi
34
35# TODO: get this info from svn_build_prepare.sh? seperate script?
36if [ -z "$1" ]; then
37 # without parameter, we are in source directory
38 SPECFILE=$(ls *.spec | awk '{print $1}')
39 PACKAGE=$(sed -n -e 's/^Name:\W*//pi' <$SPECFILE)
40 # use Version from BUILDSRC,
41 # because it has been modified by svn_build_prepare
42 #VERSION=$(sed -n -e 's/^Version:\W*//pi' <$SPECFILE)
43 BUILDSRC_DIR=${BUILDTEMP}/src/${PACKAGE}
44 VERSION=$(sed -n -e 's/^Version:\W*//pi' <$BUILDSRC_DIR/$SPECFILE)
45fi
46
47# RPMs can be handeld directly by osc
48# elif [ -r "$1" ]; then
49# # parameter is src.rpm file
50# PACKAGE=`rpm -qp --qf "%{NAME}" $1`
51# VERSION=`rpm -qp --qf "%{VERSION}" $1`
52
53if [ -z "$PACKAGE" ]; then
54 echo "nothing to build found!"
55 exit 1
56fi
57
58echo "Version: $VERSION"
59
60osc co $OSC_PACKAGE || {
61 # error message already from osc
62 exit 1
63}
64# rsync is not usable, because ":" is interpretaded as remote host
65#rsync -av "$BUILDSRC_DIR/*" "$OSC_PACKAGE/."
66#cp -av $BUILDSRC_DIR/* $OSC_PACKAGE/.
67
68cd $OSC_PACKAGE
69# rsync -a: -rlptgoD
70# but we don't want to check for timestamps
71# NOTE: this doesn't help, if the data (tar.bz2)
72# contains dynamic data like the Changes file
73rsync --checksum -r -v --delete $BUILDSRC_DIR/. . --exclude .osc
74
75# osc build DIST ARCH
76#osc add $FILELIST
77osc addremove
78osc commit -m "release $VERSION"
Note: See TracBrowser for help on using the repository browser.