rpmfile
rpmfile copied to clipboard
Add `is_rpmfile` function
The module currently has no function is_rpmfile() -> bool (similiar to https://docs.python.org/3/library/tarfile.html#tarfile.is_tarfile).
It could check the magic bytes from the file lead and return accordingly.
@LeStahL what if you could use this?
rpm = None
is_rpmfile = False
try:
rpm = rpmfile.open(...)
is_rpmfile = isinstance(rpm, rpmfile.RPMFile)
except rpmfile.errors.RPMError:
pass
Then at least you have your check without code changes.