From 1307ed98893d264b88d0919bcf9ab23319524fa6 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 4 May 2023 15:24:12 +0800 Subject: [PATCH] who_depends_this_lib: exclude debug packages and fix StopIteration --- who_depends_this_lib | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/who_depends_this_lib b/who_depends_this_lib index 4a79f05..725d1c4 100755 --- a/who_depends_this_lib +++ b/who_depends_this_lib @@ -144,6 +144,9 @@ def main(db: Path, lib_re: re.Pattern, dep_pkgname: Optional[str]) -> None: name = tarinfo.name.split('/', 1)[0] continue + if '-debug-' in name: + continue + if tarinfo.name.endswith('/depends'): continue @@ -154,7 +157,10 @@ def main(db: Path, lib_re: re.Pattern, dep_pkgname: Optional[str]) -> None: it = iter(data.splitlines()) while True: - l = next(it) + try: + l = next(it) + except StopIteration: + break if l == '%FILENAME%': filename = next(it) break