From 2054d6ef48ba524ae92b99acd11ebc6bc78474f6 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 4 Aug 2026 19:49:38 +0200 Subject: [PATCH 1/2] cleanup top level builddir before build --- cmsBuild | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmsBuild b/cmsBuild index 4d5ee9a..cf125dd 100755 --- a/cmsBuild +++ b/cmsBuild @@ -3903,8 +3903,6 @@ def buildPackage(pkg, scheduler, index, actions): missingDirs = [d for d in [rpmsCacheDir, finalRpmCacheDir, srpmsCacheDir] if not exists(d)] scheduler.log("Creating directory %s if not existing." % pkg.builddir) - if not exists(pkg.builddir): - makedirs(pkg.builddir) for directory in missingDirs: makedirs(directory) @@ -3979,8 +3977,7 @@ def buildPackage(pkg, scheduler, index, actions): " %(pkg_macros)s" \ " %(spec)s >>%(logfile)s 2>&1" % optionsDict if index == 0: - pre_cmd = "rm -rf %(builddir)s/pkgtools-pkg-src-move2git %(xtmpdir)s; " \ - "mkdir -p %(xtmpdir)s; " % optionsDict + pre_cmd = "rm -rf %(builddir)s; mkdir -p %(builddir)s %(xtmpdir)s; " % optionsDict rpmbuildCommand = pre_cmd + rpmbuildCommand if last_action: rpmbuildCommand += " && rm -rf %(buildRoot)s" % optionsDict From 499e1da2c262420ae61f90be9eae64a945083523 Mon Sep 17 00:00:00 2001 From: Malik Shahzad Muzaffar Date: Wed, 5 Aug 2026 13:24:42 +0200 Subject: [PATCH 2/2] Update cmsBuild --- cmsBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmsBuild b/cmsBuild index cf125dd..081fab9 100755 --- a/cmsBuild +++ b/cmsBuild @@ -3977,7 +3977,7 @@ def buildPackage(pkg, scheduler, index, actions): " %(pkg_macros)s" \ " %(spec)s >>%(logfile)s 2>&1" % optionsDict if index == 0: - pre_cmd = "rm -rf %(builddir)s; mkdir -p %(builddir)s %(xtmpdir)s; " % optionsDict + pre_cmd = "[ -d %(builddir)s ] && chmod -R u+w %(builddir)s ; rm -rf %(builddir)s; mkdir -p %(builddir)s %(xtmpdir)s; " % optionsDict rpmbuildCommand = pre_cmd + rpmbuildCommand if last_action: rpmbuildCommand += " && rm -rf %(buildRoot)s" % optionsDict