From: marc Date: Mon, 29 Jan 1996 19:14:54 +0000 (+0000) Subject: add RPMBUILD_CLEAN support X-Git-Tag: tznext/4.11.0.1.tizen20130304~11729 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cd793c2c23990712dd9373d04fda869aa773d34;p=tools%2Flibrpm-tizen.git add RPMBUILD_CLEAN support CVS patchset: 231 CVS date: 1996/01/29 19:14:54 --- diff --git a/build/build.c b/build/build.c index f959d68..c545641 100644 --- a/build/build.c +++ b/build/build.c @@ -39,6 +39,7 @@ static int doPatchMacro(Spec spec, StringBuf sb, char *line); static char *do_untar(Spec spec, int c); static char *do_patch(Spec spec, int c, int strip, char *dashb); int isCompressed(char *file); +void doSweep(Spec s); static char build_subdir[1024]; @@ -139,6 +140,18 @@ int execPart(Spec s, char *sb, char *name, int builddir) return 0; } +static void doSweep(Spec s) +{ + char buf[1024]; + + struct Script *script; + script = openScript(s, 0); + sprintf(buf, "rm -rf %s\n", build_subdir); + writeScript(script, buf); + execScript(script); + freeScript(script); +} + static int doSetupMacro(Spec spec, StringBuf sb, char *line) { char *s, *s1, *version; @@ -607,6 +620,9 @@ int doBuild(Spec s, int flags) if (packageBinaries(s)) { return 1; } + if (execClean(s)) { + return 1; + } } if (flags & RPMBUILD_SOURCE) { @@ -615,10 +631,8 @@ int doBuild(Spec s, int flags) } } - if (flags & RPMBUILD_CLEAN) { - if (execClean(s)) { - return 1; - } + if (flags & RPMBUILD_SWEEP) { + doSweep(s); } return 0;