Ignore:
Timestamp:
Oct 2, 2008, 5:22:18 PM (16 years ago)
Author:
joergs
Message:

optimized, using modified Version instead of Release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/technical/common/build/svn_osc_build.sh

    r720 r722  
    2323OSC_PACKAGE=`cat OSC_PACKAGE`
    2424
     25svn_build_prepare.sh $* || {
     26    echo "failed to prepare sources"
     27    exit 1
     28}
    2529
    26 
     30# TODO: get this info from svn_build_prepare.sh? seperate script?
    2731if [ -z "$1" ]; then
    2832    # without parameter, we are in source directory
    2933    SPECFILE=$(ls *.spec | awk '{print $1}')
    3034    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 file
    34         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)
    3640fi
    3741
     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`
    3847
    3948if [ -z "$PACKAGE" ]; then
     
    4251fi
    4352
    44 BUILDSRC_DIR=${BUILDTEMP}/src/${PACKAGE}
    45 
    46 
    47 svn_build_prepare.sh $* || {
    48     echo "failed to prepare sources"
    49     exit 1
    50 }
     53echo "Version: $VERSION"
    5154
    5255osc co $OSC_PACKAGE || {
     
    5659# rsync is not usable, because ":" is interpretaded as remote host
    5760#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/.
    7762
    7863cd $OSC_PACKAGE
    79 pwd
    80 #echo "OSC_PACKAGE"
     64rsync -a --delete $BUILDSRC_DIR/. . --exclude .osc
     65
    8166# 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
     68osc addremove
     69osc commit -m "release $VERSION"
Note: See TracChangeset for help on using the changeset viewer.