Skip to content

Commit 5ffcb37

Browse files
committed
log the number of patches applied
We log the individual filenames when patches are applied, but if we do not have a patch there is no indication that we tried to patch the source at all.
1 parent 5a58514 commit 5ffcb37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/fromager/sources.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,25 +261,25 @@ def patch_source(
261261
source_root_dir: pathlib.Path,
262262
req: Requirement,
263263
) -> None:
264-
# Flag to check whether patch has been applied
265-
has_applied = False
264+
patch_count = 0
266265
# apply any unversioned patch first
267266
for p in overrides.patches_for_source_dir(
268267
ctx.settings.patches_dir, overrides.pkgname_to_override_module(req.name)
269268
):
270269
_apply_patch(p, source_root_dir)
271-
has_applied = True
270+
patch_count += 1
272271

273272
# make sure that we don't apply the generic unversioned patch again
274273
if source_root_dir.name != overrides.pkgname_to_override_module(req.name):
275274
for p in overrides.patches_for_source_dir(
276275
ctx.settings.patches_dir, source_root_dir.name
277276
):
278277
_apply_patch(p, source_root_dir)
279-
has_applied = True
278+
patch_count += 1
280279

280+
logger.debug("%s: applied %d patches", req.name, patch_count)
281281
# If no patch has been applied, call warn for old patch
282-
if not has_applied:
282+
if not patch_count:
283283
_warn_for_old_patch(source_root_dir, ctx.settings.patches_dir)
284284

285285

0 commit comments

Comments
 (0)