From bbb67d5fdf97635d4504d5646da9ceaf501b9892 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sat, 27 Jul 2024 19:17:59 +0200 Subject: Eval %mkrel in release field for naming log file --- BuildManager/package.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BuildManager/package.py b/BuildManager/package.py index d324453..c3c3efb 100644 --- a/BuildManager/package.py +++ b/BuildManager/package.py @@ -111,7 +111,12 @@ class _package_spec(_package): elif not self.version and lowerline[:8] == "version:": self.version = self._rpm_vars((line[8:]).strip(), defines) elif not self.release and lowerline[:8] == "release:": - self.release = self._rpm_vars((line[8:]).strip(), defines) + rel = self._rpm_vars((line[8:]).strip(), defines) + if rel.startswith("%mkrel"): + p = subprocess.run(["rpm", "--eval", rel], text=True, capture_output=True) + self.release = p.stdout + else: + self.release = rel elif lowerline[:7] == "%define": token = (line[7:]).split() if len(token) == 2: -- cgit v1.2.1