From 26fa8a760bf725336cd732a6035792ad6078ca09 Mon Sep 17 00:00:00 2001 From: Otto Urpelainen Date: Aug 24 2021 20:22:22 +0000 Subject: [PATCH 1/2] Use rpkg layouts for rpmdefines Earlier, `rpkg`'s layout mechanism was bypassed and rpmdefines were set in a fixed way by `fedpkg`. This breaks the new results dir feature from https://pagure.io/rpkg/pull-request/540 Rpmdefines are changed to be read from selected layout here, including the new `rpmfilename` layout property. Signed-off-by: Otto Urpelainen --- diff --git a/fedpkg/__init__.py b/fedpkg/__init__.py index 0cbaebe..a9e1532 100644 --- a/fedpkg/__init__.py +++ b/fedpkg/__init__.py @@ -188,11 +188,12 @@ class Commands(pyrpkg.Commands): raise pyrpkg.rpkgError('Could not find the release/dist from branch name ' '%s\nPlease specify with --release' % self.branch_merge) - self._rpmdefines = ["--define '_sourcedir %s'" % self.path, - "--define '_specdir %s'" % self.path, - "--define '_builddir %s'" % self.path, - "--define '_srcrpmdir %s'" % self.path, - "--define '_rpmdir %s'" % self.path, + self._rpmdefines = ["--define '_sourcedir %s'" % self.layout.sourcedir, + "--define '_specdir %s'" % self.layout.specdir, + "--define '_builddir %s'" % self.layout.builddir, + "--define '_srcrpmdir %s'" % self.layout.srcrpmdir, + "--define '_rpmdir %s'" % self.layout.rpmdir, + "--define '_rpmfilename %s'" % self.layout.rpmfilename, "--define 'dist %%{?distprefix}.%s'" % self._disttag, "--define '%s %s'" % (self._distvar, self._distval), From 3676d7b0098aeb7ac674326e3231bac851c9225a Mon Sep 17 00:00:00 2001 From: Otto Urpelainen Date: Aug 24 2021 20:22:22 +0000 Subject: [PATCH 2/2] Add default configuration for `resultsdir` Rpkg added support for new configuration option `resultsdir` in [1]. Default configuration is set: `git_exclude` to exclude the new `results` directory, and `resultsdir` option set of `root`, in order to preserve the current behavior by default and make the new `subdir` option opt-in. [1]: https://pagure.io/rpkg/c/89bc57df4f2dcc22004c3e412df3013b62b70ffb?branch=master Signed-off-by: Otto Urpelainen --- diff --git a/conf/etc/rpkg/fedpkg-stage.conf b/conf/etc/rpkg/fedpkg-stage.conf index bb1901c..eeae285 100644 --- a/conf/etc/rpkg/fedpkg-stage.conf +++ b/conf/etc/rpkg/fedpkg-stage.conf @@ -46,8 +46,10 @@ git_excludes = /*.src.rpm /build*.log /.build-*.log + results/ results_*/ clog +results_dir=root [fedpkg-stage.bodhi] # Refer to fedpkg.conf diff --git a/conf/etc/rpkg/fedpkg.conf b/conf/etc/rpkg/fedpkg.conf index aef75f4..f975f71 100644 --- a/conf/etc/rpkg/fedpkg.conf +++ b/conf/etc/rpkg/fedpkg.conf @@ -46,8 +46,10 @@ git_excludes = /*.src.rpm /build*.log /.build-*.log + results/ results_*/ clog +results_dir=root [fedpkg.bodhi] # This is for the bodhi-client 2.x, that do not require an option to switch to