From fd893bf69e67719f36195e0b96a8128ed83d3d2c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 25 Aug 2010 11:03:26 +0300 Subject: Fix RhBug:452477 differently to avoid doRmSource() --- rpmbuild.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'rpmbuild.c') diff --git a/rpmbuild.c b/rpmbuild.c index c9eec89df..3afdd30d5 100644 --- a/rpmbuild.c +++ b/rpmbuild.c @@ -201,6 +201,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) char * specFile = NULL; rpmSpec spec = NULL; int rc = 1; /* assume failure */ + int justRm = ((buildAmount & ~(RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)) == 0); #ifndef DYING rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); @@ -283,18 +284,11 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) goto exit; } - if ( ba->buildAmount&RPMBUILD_RMSOURCE && !(ba->buildAmount&~(RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)) ) { - rc = doRmSource(spec); - if ( rc == RPMRC_OK && ba->buildAmount&RPMBUILD_RMSPEC ) - rc = unlink(specFile); - goto exit; - } - /* Assemble source header from parsed components */ initSourceHeader(spec); - /* Check build prerequisites */ - if (!ba->noDeps && checkSpec(ts, spec->sourceHeader)) { + /* Check build prerequisites if necessary, unless disabled */ + if (!justRm && !ba->noDeps && checkSpec(ts, spec->sourceHeader)) { goto exit; } -- cgit v1.2.3