Don't fail because of missing sources when only spec

removal is requested (rhbz #472427)
This commit is contained in:
Jindrich Novy 2009-01-11 15:23:59 +01:00
parent 83e5726aad
commit 1909784075
2 changed files with 6 additions and 4 deletions

View File

@ -240,6 +240,12 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
goto exit;
}
/* Don't parse spec if only its removal is requested */
if (ba->buildAmount == RPMBUILD_RMSPEC) {
rc = unlink(specFile);
goto exit;
}
/* Parse the spec file */
#define _anyarch(_f) \
(((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)

View File

@ -21,10 +21,6 @@ static void doRmSource(rpmSpec spec)
Package pkg;
int rc;
#if 0
rc = unlink(spec->specFile);
#endif
for (p = spec->sources; p != NULL; p = p->next) {
if (! (p->flags & RPMBUILD_ISNO)) {
char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);