From 552f87d4c283c6ee20a9ec2df8c00ca7ca075a3e Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 3 Jul 2026 00:51:37 +0000 Subject: [PATCH] fix(buildrpms): create the rpmbuild tree so a build never silently no-ops buildrpms.pl stages source tarballs into $HOME/rpmbuild/SOURCES but only runs rpmdev-setuptree in its one-time env-setup path. On a host where that never ran (or $HOME/rpmbuild was cleaned) source staging fails with "SOURCES/...: No such file or directory", no srpms/rpms are produced, and the run still exits 0 -- so the deployable repo silently ends up empty. Create the rpmbuild tree up front so a build no longer depends on prior manual setup. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildrpms.pl b/buildrpms.pl index caacd0ec5..e358ed918 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -50,6 +50,12 @@ use autodie; use autodie qw(cp); my $SOURCES = "$ENV{HOME}/rpmbuild/SOURCES"; +# Ensure the rpmbuild tree exists. buildrpms stages source tarballs into $SOURCES, but it only +# runs rpmdev-setuptree in the one-time env-setup path -- so on a host where that never ran (or +# $HOME/rpmbuild was cleaned) source staging fails with "SOURCES/...: No such file or directory", +# no srpms/rpms are produced, and the run still exits 0. Create the tree up front so a build never +# depends on prior manual setup. +system('mkdir', '-p', map { "$ENV{HOME}/rpmbuild/$_" } qw(SOURCES SPECS BUILD BUILDROOT RPMS SRPMS)); my $VERSION = read_text("Version"); my $PWD = Cwd::cwd();