Skip to content

Commit

Permalink
Move SPECPARTS to per-pkg builddir, no longer needing name-version
Browse files Browse the repository at this point in the history
This also simplifies cleanup as we only need to clean the per-build
directory now.
  • Loading branch information
pmatilai committed Feb 5, 2024
1 parent 10120f6 commit ba11134
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 1 addition & 8 deletions build/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,7 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name,
fprintf(fp, "cd '%s'\n", buildSubdir);

if (what == RPMBUILD_RMBUILD) {
if (rpmMacroIsDefined(spec->macros, "specpartsdir")) {
char * buf = rpmExpand("%{specpartsdir}", NULL);
fprintf(fp, "rm -rf '%s'\n", buf);
free(buf);
}
if (buildSubdir[0] != '\0')
fprintf(fp, "rm -rf '%s' '%s.gemspec'\n",
buildSubdir, buildSubdir);
fprintf(fp, "rm -rf '%s'\n", spec->buildDir);
} else if (sb != NULL)
fprintf(fp, "%s", sb);

Expand Down
2 changes: 1 addition & 1 deletion macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
%_srcrpmdir %{_topdir}/SRPMS

# Path for spec file snippets generated during build
%specpartsdir %{_builddir}/%{buildsubdir}-SPECPARTS
%specpartsdir %{_builddir}/SPECPARTS

# Directory where temporaray files can be created.
%_tmppath %{_var}/tmp
Expand Down
4 changes: 2 additions & 2 deletions tests/rpmspec.at
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'hello-1.0'
rm -rf '/build/BUILD/hello-1.0-PKG/hello-1.0-SPECPARTS'
/usr/bin/mkdir -p '/build/BUILD/hello-1.0-PKG/hello-1.0-SPECPARTS'
rm -rf '/build/BUILD/hello-1.0-PKG/SPECPARTS'
/usr/bin/mkdir -p '/build/BUILD/hello-1.0-PKG/SPECPARTS'
/usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .

echo "Patch #0 (hello-1.0-modernize.patch):"
Expand Down

0 comments on commit ba11134

Please sign in to comment.