Skip to content

Commit

Permalink
Improve 'build' and 'buildinfo' commands by injecting *.inc files int…
Browse files Browse the repository at this point in the history
…o spec that is sent to OBS for parsing BuildRequires (boo#1221340)
  • Loading branch information
dmach committed Apr 29, 2024
1 parent f908092 commit c02335f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,12 @@ def create_build_descr_data(
if defines:
build_descr_data = b"\n".join(defines) + b"\n\n" + build_descr_data

# HACK: OBS doesn't support *.inc for spec, let's inject them here
for include_file in glob.glob(os.path.join(topdir, "*.inc")):
print(f"Injecting include file into spec: {os.path.basename(include_file)}", file=sys.stderr)
with open(include_file, "rb") as f:
build_descr_data = b"\n" + f.read() + b"\n\n" + build_descr_data

# build recipe must go first for compatibility with the older OBS versions
result_data.append((os.path.basename(build_descr_path).encode("utf-8"), build_descr_data))

Expand Down

0 comments on commit c02335f

Please sign in to comment.