summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2024-07-27 19:17:59 +0200
committerPapoteur <papoteur@mageia.org>2024-07-27 19:18:12 +0200
commitbbb67d5fdf97635d4504d5646da9ceaf501b9892 (patch)
tree7f1289c33457db5f9c8e0296aa3d8f26fe643859
parent7f3bd1fe36b814d215c2f0b071b77d5d81b143c8 (diff)
downloadbm-bbb67d5fdf97635d4504d5646da9ceaf501b9892.tar
bm-bbb67d5fdf97635d4504d5646da9ceaf501b9892.tar.gz
bm-bbb67d5fdf97635d4504d5646da9ceaf501b9892.tar.bz2
bm-bbb67d5fdf97635d4504d5646da9ceaf501b9892.tar.xz
bm-bbb67d5fdf97635d4504d5646da9ceaf501b9892.zip
Eval %mkrel in release field for naming log file
-rw-r--r--BuildManager/package.py7
1 files changed, 6 insertions, 1 deletions
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: