Changeset 715 for trunk


Ignore:
Timestamp:
Apr 3, 2006, 3:12:31 PM (19 years ago)
Author:
joergs
Message:

better determination of RPM PACKAGE Name and Version

File:
1 edited

Legend:

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

    r714 r715  
    105105        PACKAGE=$(awk '/^Name:/ {print $2}' <$SPECFILE)
    106106        VERSION=$(awk '/^Version:/ {print $2}' <$SPECFILE)
    107 else
     107elif [ -r "$1" ]; then
    108108        # parameter is src.rpm file
    109         PACKAGE=`echo $1 | sed 's/-[0-9]*\..*.src.rpm//'`
    110         VERSION=`echo $1 | sed 's/.*-\([0-9]*\..*\)-.*.src.rpm/\1/'`
     109        PACKAGE=`rpm -qp --qf "%{NAME}" $1`
     110        VERSION=`rpm -qp --qf "%{VERSION}" $1`
    111111fi
    112112
    113113echo $PACKAGE $VERSION $BUILD_DIST $BUILD_MODE
     114
     115if [ -z "$PACKAGE" ]; then
     116    echo "nothing to build found!"
     117    exit 1
     118fi
     119
     120
    114121
    115122rm -rf ${BUILDTEMP}/src/${PACKAGE};
Note: See TracChangeset for help on using the changeset viewer.