Bug 133568

Summary: 'build' fails to clear BUILD_IS_RUNNING flag if it can't find an rpm
Product: [openSUSE] SUSE Linux 10.1 Reporter: Greg Edwards <edwardsg>
Component: DevelopmentAssignee: Michael Schröder <mls>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: mls
Version: Alpha 2plus   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Third Party Developer/Partner Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Greg Edwards 2005-11-11 23:18:17 UTC
Using 'build' to build an rpm, if you mis-specify a BuildRequires rpm,
the build obviously fails, but the next time you run it says your build
root is hosed and wants to clobber it.

It looks like the BUILD_IS_RUNNING flag just needs to be cleared instead
before exit.

Example:

logging output to /data/lwork/attica4/edwardsg/pp5/build/.build.log...
started "build " at Fri Nov 11 17:15:38 CST 2005.

Using BUILD_ROOT=/data/lwork/attica4/edwardsg/pp5/build
Using BUILD_RPMS=/data/lwork/attica4/edwardsg/pp5/RPMS:/data/lwork/attica4/edwardsg/pp5/SRPMS:/data/mirror/attica/netinst/suselinux/10.0-ia64:/data/mirror/attica/sgi/dist.engr/test/stout4SP3/latest/:/data/mirror/attica/sgi/dist.engr/chroots/intel-compilers
Using BUILD_ARCH=ia64

processing specfile /data/lwork/attica4/edwardsg/pp5/linux-gfx/sgi-gfxtools/sgi-gfxtools.spec...
init_buildsystem xorg-x11-devel xorg-xll-Mesa-devel ...
initializing /data/lwork/attica4/edwardsg/pp5/build/.srcfiles.cache with find command...
find: /data/mirror/attica/sgi/dist.engr/chroots/intel-compilers: No such file or directory
.........................................................................................can not find xorg-xll-Mesa-devel.rpm... exit.



subsequent run (with bogus reference fixed):

logging output to /data/lwork/attica4/edwardsg/pp5/build/.build.log...
started "build " at Fri Nov 11 17:16:48 CST 2005.

Using BUILD_ROOT=/data/lwork/attica4/edwardsg/pp5/build
Using BUILD_RPMS=/data/lwork/attica4/edwardsg/pp5/RPMS:/data/lwork/attica4/edwardsg/pp5/SRPMS:/data/mirror/attica/netinst/suselinux/10.0-ia64:/data/mirror/attica/sgi/dist.engr/test/stout4SP3/latest/:/data/mirror/attica/sgi/dist.engr/chroots/intel-compilers
Using BUILD_ARCH=ia64

processing specfile /data/lwork/attica4/edwardsg/pp5/linux-gfx/sgi-gfxtools/sgi-gfxtools.spec...
init_buildsystem xorg-x11-devel xorg-x11-Mesa-devel ...
It seems that there was an incomplete setup of /data/lwork/attica4/edwardsg/pp5/build.
To be sure, we will build it again completely...
Your build system is broken!! Shall I execute

    rm -rf /data/lwork/attica4/edwardsg/pp5/build

[y/N]


Instead, it should just clear the BUILD_IS_RUNNING flag before exit, and
the next run will start off fresh again.  This fixes it for me:

Index: build/init_buildsystem
===================================================================
--- build.orig/init_buildsystem 2005-05-12 07:45:18.000000000 -0500
+++ build/init_buildsystem      2005-11-11 17:04:28.188041365 -0600
@@ -143,7 +143,7 @@ function set_src_pkg () {
           SRC=""
         ;;
         *)
-          rm -f $CACHE_FILE
+          rm -f $CACHE_FILE $BUILD_IS_RUNNING
           echo can not find $BASE... exit.
           cleanup_and_exit 1
         ;;
Comment 1 Michael Schröder 2005-11-14 11:06:40 UTC
Yes, will be included in the next build version.
Comment 2 Michael Schröder 2006-07-11 18:59:26 UTC
Fixed.