Changeset 722 for trunk/technical/common/build
- Timestamp:
- Oct 2, 2008, 5:22:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/technical/common/build/svn_osc_build.sh
r720 r722 23 23 OSC_PACKAGE=`cat OSC_PACKAGE` 24 24 25 svn_build_prepare.sh $* || { 26 echo "failed to prepare sources" 27 exit 1 28 } 25 29 26 30 # TODO: get this info from svn_build_prepare.sh? seperate script? 27 31 if [ -z "$1" ]; then 28 32 # without parameter, we are in source directory 29 33 SPECFILE=$(ls *.spec | awk '{print $1}') 30 34 PACKAGE=$(sed -n -e 's/^Name:\W*//pi' <$SPECFILE) 31 VERSION=$(sed -n -e 's/^Version:\W*//pi' <$SPECFILE)32 elif [ -r "$1" ]; then 33 # parameter is src.rpm file34 PACKAGE=`rpm -qp --qf "%{NAME}" $1`35 VERSION=`rpm -qp --qf "%{VERSION}" $1`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) 36 40 fi 37 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` 38 47 39 48 if [ -z "$PACKAGE" ]; then … … 42 51 fi 43 52 44 BUILDSRC_DIR=${BUILDTEMP}/src/${PACKAGE} 45 46 47 svn_build_prepare.sh $* || { 48 echo "failed to prepare sources" 49 exit 1 50 } 53 echo "Version: $VERSION" 51 54 52 55 osc co $OSC_PACKAGE || { … … 56 59 # rsync is not usable, because ":" is interpretaded as remote host 57 60 #rsync -av "$BUILDSRC_DIR/*" "$OSC_PACKAGE/." 58 cp -av $BUILDSRC_DIR/* $OSC_PACKAGE/. 59 60 if [ "$BUILD_USES_SVN" = "yes" ]; then 61 echo "receiving subversion information ..." 62 # set RELEASE number (last modification in this directory) 63 # requires subversion (but connection to server isn't neccessary) 64 SVN_BUILD_RELEASE=$(unset LANG; svn info . | sed -n 's/^Last Changed Rev: \([0-9]*\)/\1/p') 65 # in case of local modification a "m" is added to the release number 66 SVN_BUILD_MODIFIED=$(svn status -v | grep "^ *M" | wc -l) 67 # checks if a file is commited, 68 # but update on its directory is not performed 69 SVN_LAST_MODIFICATION=$(svn status -v | sed -n 's/^ *[0-9]* *\([0-9]*\) .*/\1/p' | sort -n | tail -1) 70 if [ $SVN_BUILD_MODIFIED -gt 0 ]; then 71 SVN_BUILD_RELEASE=${SVN_BUILD_RELEASE}m 72 elif [ $SVN_LAST_MODIFICATION -ne $SVN_BUILD_RELEASE ]; then 73 SVN_BUILD_RELEASE=${SVN_BUILD_RELEASE}p 74 fi 75 echo "SVN_BUILD_RELEASE: $SVN_BUILD_RELEASE" 76 fi 61 #cp -av $BUILDSRC_DIR/* $OSC_PACKAGE/. 77 62 78 63 cd $OSC_PACKAGE 79 pwd 80 #echo "OSC_PACKAGE" 64 rsync -a --delete $BUILDSRC_DIR/. . --exclude .osc 65 81 66 # osc build DIST ARCH 82 osc add * 83 if [ "$SVN_BUILD_RELEASE" ]; then 84 osc commit -m "release $SVN_BUILD_RELEASE" 85 fi 67 #osc add $FILELIST 68 osc addremove 69 osc commit -m "release $VERSION"
Note:
See TracChangeset
for help on using the changeset viewer.