Changeset 724


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

in case of SOURCES, checks if tar.bz2 really has to be recreated. If not, exit 1. Removed legacy TAR creating method by Makefile, because this isn't used for quite a while

File:
1 edited

Legend:

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

    r723 r724  
    44
    55# $Id$
     6
     7# Exitcodes:
     8#   0   normal end. Has created build directory
     9#   1   build directory already up-to-date. Nothing to do.
     10# 255   error
    611
    712BUILDUSER=$USER
     
    2530if [ -z "$PACKAGE" ]; then
    2631    echo "nothing to build found!"
    27     exit 1
     32    exit 255
    2833fi
    2934
    30 rm -rf ${BUILDTEMP}/src/${PACKAGE}
    31 mkdir -p ${BUILDTEMP}/src/${PACKAGE}
    3235
    3336
     
    4043        exit 1
    4144    else
     45        rm -rf ${BUILDTEMP}/src/${PACKAGE}
     46        mkdir -p ${BUILDTEMP}/src/${PACKAGE}
    4247        cp -a "$1" ${BUILDTEMP}/src/${PACKAGE}
    4348        cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i
     
    6469            REBUILD="yes"
    6570        else # check if RPM has been build already
    66             # TODO: this chekc is broken for OpenSUSE build service,
     71            # TODO: this check is broken for OpenSUSE build service,
    6772            #       because version is changed later on
    6873            EXPECTED_DEST_RPM_FILENAME=${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-${VERSION}-${SVN_BUILD_RELEASE}.*.rpm
     
    115120    if [ -r "SOURCES" ]; then
    116121        # create a tar file from the sources
    117         printf "creating $PACKAGE-$VERSION.tar.bz2:\n"
    118         tar cvjf ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 --files-from SOURCES --exclude .svn --exclude "*~"
    119    
     122        printf "creating $PACKAGE-$VERSION.tar.bz2: "
     123
     124        if [ "$REBUILD" -o ! -r ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 ]; then
     125            rm -rf ${BUILDTEMP}/src/${PACKAGE}
     126            mkdir -p ${BUILDTEMP}/src/${PACKAGE}
     127            tar cvjf ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 --files-from SOURCES --exclude .svn --exclude "*~"
     128        else
     129            printf "already exists. Skipped\n"
     130            exit 1
     131        fi
    120132    elif [ -r "SPECSOURCES" ]; then
    121133        # SPECSOURCES has to list the files
    122134        # that are referenced in the .spec file
    123135        # these files are copied to the build environment
     136        rm -rf ${BUILDTEMP}/src/${PACKAGE}
     137        mkdir -p ${BUILDTEMP}/src/${PACKAGE}
    124138        cp -av `cat SPECSOURCES` ${BUILDTEMP}/src/${PACKAGE}
    125139   
    126140    else
    127         # legacy method:
    128         # call the existing Makefile
    129         # to generate a tar file   
    130         test -e Makefile && make
    131         TARFILE=$(ls  *.tar.[gb]z*| awk '{print $1}')
    132         cp -av $TARFILE ${BUILDTEMP}/src/${PACKAGE}
     141        printf "error: neither SOURCES nor SPECSOURCES file found. One of these is required. Exiting\n"
     142        exit 255
    133143    fi
    134144fi
Note: See TracChangeset for help on using the changeset viewer.