added doRmSource()

CVS patchset: 267
CVS date: 1996/02/14 20:07:09
This commit is contained in:
root 1996-02-14 20:07:09 +00:00
parent b9c9a12286
commit 4e85ef055e
3 changed files with 39 additions and 0 deletions

View File

@ -633,5 +633,9 @@ int doBuild(Spec s, int flags)
doSweep(s);
}
if (flags & RPMBUILD_RMSOURCE) {
doRmSource(s);
}
return 0;
}

View File

@ -945,3 +945,37 @@ int packageSource(Spec s)
return 0;
}
/****************** Source Removal ********************/
int doRmSource(Spec s)
{
char filename[1024];
struct sources *source;
struct PackageRec *package;
/* spec file */
sprintf(filename, "%s%s", getVar(RPMVAR_SPECDIR),
strrchr(s->specfile, '/'));
unlink(filename);
/* sources and patches */
source = s->sources;
while (source) {
sprintf(filename, "%s/%s", getVar(RPMVAR_SOURCEDIR), source->source);
unlink(filename);
source = source->next;
}
/* icons */
package = s->packages;
while (package) {
if (package->icon) {
sprintf(filename, "%s/%s", getVar(RPMVAR_SOURCEDIR),
package->icon);
unlink(filename);
}
package = package->next;
}
}

View File

@ -6,5 +6,6 @@
void markBuildTime(void);
int packageBinaries(Spec s);
int packageSource(Spec s);
int doRmSource(Spec s);
#endif _PACK_H_