From c157dba2625ed6692d3a4fc92634d3b0a17685ca Mon Sep 17 00:00:00 2001 From: gcarq Date: Wed, 13 Mar 2024 14:11:38 +0100 Subject: [PATCH] Fix keep file parsing for packages with an underscore. Closes #7 Signed-off-by: gcarq --- lostfiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lostfiles.py b/lostfiles.py index 873b00d..6010394 100755 --- a/lostfiles.py +++ b/lostfiles.py @@ -388,7 +388,7 @@ def resolve_pkg_from_keepfile(filename: str) -> str: Returns the package atom from the given .keep file, for example: .keep_net-print_cups-0 -> net-print/cups """ - _, category, remainder = filename.split("_") + _, category, remainder = filename.split("_", maxsplit=2) package, _ = remainder.rsplit("-", maxsplit=1) return f"{category}/{package}"