From 4645e5d3242b39f5e84349379b8aa0679c25b99e Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Tue, 13 Jun 2023 21:35:22 +0200 Subject: [PATCH] rpmbuild: extract spec into resultdir regardless of the current directory --- rpmbuild/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpmbuild/main.py b/rpmbuild/main.py index 749be073e..84c90c90c 100755 --- a/rpmbuild/main.py +++ b/rpmbuild/main.py @@ -227,7 +227,8 @@ def build_srpm(args, config): os.listdir(resultdir))) # extract spec file from SRPM - subprocess.run(f"rpm2archive -n < {locate_srpm(resultdir)} | tar xf - '*.spec'", shell=True, check=False) + cmd = f"rpm2archive -n < {locate_srpm(resultdir)} | tar xf - '*.spec'" + subprocess.run(cmd, shell=True, check=False, cwd=resultdir) with open(os.path.join(resultdir, 'success'), "w") as success: success.write("done")