Skip to content

Commit

Permalink
Add default %clean section unless overridden in spec (ticket #81)
Browse files Browse the repository at this point in the history
- avoids silly clutter in every specfile in the regular case but permits
  overriding if needed for whatever reason
- it's a spec behavior change but mostly backwards compatible:
  existing specs will do whatever the %clean does, and if you need to avoid
  calling %clean for whatever reason just keep an empty %clean in the spec
  • Loading branch information
pmatilai committed Aug 17, 2009
1 parent 859dd6d commit 3fc5824
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/parseSpec.c
Expand Up @@ -555,6 +555,13 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootDir,
}
}

if (spec->clean == NULL) {
char *body = rpmExpand("%{?buildroot: %{__rm} -rf %{buildroot}}", NULL);
spec->clean = newStringBuf();
appendLineStringBuf(spec->clean, body);
free(body);
}

/* Check for description in each package and add arch and os */
{
char *platform = rpmExpand("%{_target_platform}", NULL);
Expand Down

0 comments on commit 3fc5824

Please sign in to comment.