Handle --nobuild as another buildAmount flag
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 2 Sep 2010 07:23:57 +0000 (10:23 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 2 Sep 2010 07:23:57 +0000 (10:23 +0300)
build/build.c
build/poptBT.c
build/rpmbuild.h

index b1424cd..0584dcf 100644 (file)
@@ -216,7 +216,7 @@ exit:
 static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
 {
     rpmRC rc = RPMRC_OK;
-    int test = buildArgs->noBuild;
+    int test = (what & RPMBUILD_NOBUILD);
     char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
 
     /* XXX TODO: rootDir is only relevant during build, eliminate from spec */
index 67b7bd5..f7e12b6 100644 (file)
@@ -41,8 +41,6 @@ struct rpmBuildArguments_s         rpmBTArgs;
 
 extern int _fsm_debug;
 
-static int noBuild = 0;
-
 int _noDirTokens = 0;
 
 /**
@@ -79,7 +77,7 @@ static void buildArgCallback( poptContext con,
        }
        break;
 
-    case POPT_NOBUILD: rba->noBuild = 1; break;
+    case POPT_NOBUILD: rba->buildAmount |= RPMBUILD_NOBUILD; break;
     case POPT_NOLANG: rba->specFlags |= RPMSPEC_NOLANG; break;
     case POPT_SHORTCIRCUIT: rba->shortCircuit = 1; break;
     case POPT_RMSOURCE: rba->buildAmount |= RPMBUILD_RMSOURCE; break;
@@ -187,7 +185,7 @@ struct poptOption rpmBuildPoptTable[] = {
         N_("ignore ExcludeArch: directives from spec file"), NULL},
  { "fsmdebug", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN), &_fsm_debug, -1,
        N_("debug file state machine"), NULL},
- { "nobuild", '\0', 0, &noBuild,  POPT_NOBUILD,
+ { "nobuild", '\0', 0, 0,  POPT_NOBUILD,
        N_("do not execute any stages of the build"), NULL },
  { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS,
        N_("do not verify build dependencies"), NULL },
index f03f875..b34e7a7 100644 (file)
@@ -30,7 +30,9 @@ typedef enum rpmBuildFlags_e {
     RPMBUILD_RMSOURCE  = (1 <<  8),    /*!< Remove source(s) and patch(s). */
     RPMBUILD_RMBUILD   = (1 <<  9),    /*!< Remove build sub-tree. */
     RPMBUILD_STRINGBUF = (1 << 10),    /*!< only for doScript() */
-    RPMBUILD_RMSPEC    = (1 << 11)     /*!< Remove spec file. */
+    RPMBUILD_RMSPEC    = (1 << 11),    /*!< Remove spec file. */
+
+    RPMBUILD_NOBUILD   = (1 << 31)     /*!< Don't execute or package. */
 } rpmBuildFlags;
 
 /** \ingroup rpmbuild
@@ -43,7 +45,6 @@ struct rpmBuildArguments_s {
     char * buildRootOverride;  /*!< from --buildroot */
     char * targets;            /*!< Target platform(s), comma separated. */
     char * cookie;             /*!< NULL for binary, ??? for source, rpm's */
-    int noBuild;               /*!< from --nobuild */
     int noDeps;                        /*!< from --nodeps */
     int shortCircuit;          /*!< from --short-circuit */
     char buildMode;            /*!< Build mode (one of "btBC") */