]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
- up
[packages/rpm-build-tools.git] / builder.sh
index 8dcae8f154dd5c24404b586337b5ef2ff4c09d49..c3c6c71b095e4f5b4ef487c8e70d51faaa61d506 100644 (file)
@@ -747,8 +747,8 @@ get_spec() {
                        rm -f "$ASSUMED_NAME/CVS/Entries.Static"
                        cvsignore_df .cvsignore
 
-                       # add default log format to .cvsignore if it is relative
-                       if [ "$LOGFILE" = $(basename "$LOGFILE") ]; then
+                       # add default log format to .cvsignore if it is relative to package dir
+                       if [ -n "$LOGFILE" -a "$LOGFILE" = "${LOGFILE##*/}" ]; then
                                # substitute known "macros" to glob
                                local logfile=$(echo "$LOGFILE" | sed -e 's,\$\(PACKAGE_NAME\|DATE\),*,g')
                                if [ "$logfile" ]; then
@@ -1477,6 +1477,10 @@ try_upgrade() {
                        set_release $SPECFILE $PACKAGE_RELEASE 1
                        set_version $SPECFILE $PACKAGE_VERSION $TNEWVER
                        parse_spec
+                       if [ "$PACKAGE_VERSION" != "$TNEWVER" ]; then
+                               echo >&2 "Upgrading version failed, you need to update spec yourself"
+                               exit 1
+                       fi
                        return 1
                fi
        fi
@@ -1627,7 +1631,7 @@ set_bconds_values() {
        AVAIL_BCONDS_WITHOUT=""
        AVAIL_BCONDS_WITH=""
 
-       if egrep -q '^# *_with' ${SPECFILE}; then
+       if grep -Eq '^# *_with' ${SPECFILE}; then
                echo >&2 "ERROR: This spec has old style bconds."
                exit 1
        fi
@@ -2009,13 +2013,23 @@ fetch_build_requires()
 }
 
 init_rpm_dir() {
-       TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
-       CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
+       local CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
+       local TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
+       local rpmdir=$(eval $RPM $RPMOPTS --eval '%{_rpmdir}')
+       local buildir=$(eval $RPM $RPMOPTS --eval '%{_builddir}')
+       local srpmdir=$(eval $RPM $RPMOPTS --eval '%{_srcrpmdir}')
+       local tmp
 
        echo "Initializing rpm directories to $TOP_DIR from $CVSROOT"
-       mkdir -p $TOP_DIR/{RPMS,BUILD,SRPMS}
-       cd $TOP_DIR
-       $CVS_COMMAND -d $CVSROOT co packages/{.cvsignore,rpm.groups,dropin,mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
+       mkdir -p $TOP_DIR $rpmdir $buildir $srpmdir
+
+       # need to checkout to tmp dir or we can't name our topdir
+       tmp=$(TMPDIR= TEMPDIR= mktemp -p $TOP_DIR -d) || exit 1
+       cd $tmp
+       $CVS_COMMAND -d $CVSROOT co packages/{.cvsignore,rpm.groups,dropin,mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh,ci,civim}
+       cd -
+       mv $tmp/packages/* $TOP_DIR
+       rm -rf $tmp
 
        init_builder
 
@@ -2023,11 +2037,11 @@ init_rpm_dir() {
        echo "- run cvs co SPECS"
 
        echo "To checkout *all* packages:"
-       echo "- run cvs up -dP in $TOP_DIR/packages dir"
+       echo "- run cvs up -dP in $TOP_DIR dir"
 
        echo ""
        echo "To commit with your developer account:"
-       echo "- edit $TOP_DIR/packages/CVS/Root"
+       echo "- edit $TOP_DIR/CVS/Root"
 }
 
 get_greed_sources() {
This page took 0.040075 seconds and 4 git commands to generate.