Skip to content

Commit

Permalink
Search for extracted rpm src dir instead of hardcoded path
Browse files Browse the repository at this point in the history
  • Loading branch information
mildas committed Sep 26, 2024
1 parent baf020e commit 16e231a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/util/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ def get_content(build=True):
check=True, stdout=subprocess.PIPE, universal_newlines=True, cwd=tmpdir,
)
name_version = ret.stdout.strip()
extracted = Path(tmpdir) / 'BUILD' / name_version
try:
builddir = Path(tmpdir) / 'BUILD'
extracted = next(builddir.glob(f'**/{name_version}'))
except StopIteration:
raise FileNotFoundError(f"extracted SRPM content sources not found")
util.log(f"using {extracted} as content source")
if not extracted.exists():
raise FileNotFoundError(f"{extracted} not in extracted/patched SRPM")
# build content
if build:
cmd = ['./build_product', '--playbook-per-rule', f'rhel{rhel.major}']
Expand Down

0 comments on commit 16e231a

Please sign in to comment.