-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
area | librariesIssues related to beakerlib libraries supportIssues related to beakerlib libraries support
Description
tmt/tmt/libraries/beakerlib.py
Lines 206 to 217 in 2521049
| def _merge_metadata(self, library_path: Path, local_library_path: Path) -> None: | |
| """ | |
| Merge all inherited metadata into one metadata file | |
| """ | |
| for f in local_library_path.glob(r'*\.fmf'): | |
| f.unlink() | |
| write( | |
| path=local_library_path / 'main.fmf', | |
| data=tmt.utils.get_full_metadata(library_path, self.name), | |
| quiet=True, | |
| ) |
This function is supposed to delete all .fmf files and then write a single main.fmf file with only the current metadata. Notice the bug in here?
Spoiler
It's the bogus \ escape:
>>> from pathlib import Path
... some_tree = Path("docs/releases")
... print("[Original]")
... for f in some_tree.glob(r"*\.fmf"):
... print(f)
... print("[Expected]")
... for f in some_tree.glob("**/?*.fmf"):
... print(f)
[Original]
[Expected]
docs/releases/main.fmf
docs/releases/1.62.1/4125.fmf
docs/releases/1.62.1/4231.fmfSecondary bug though, if we fix it to actually delete all .fmf files, then we risk deleting also subtrees, so instead we need to get the exact fmf source files and delete only those. @HouMinXi I think this was a compounding issue for #4439.
Metadata
Metadata
Assignees
Labels
area | librariesIssues related to beakerlib libraries supportIssues related to beakerlib libraries support