From e810cdf72f7706520dad99af95c994de830a318e Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 12 Mar 2017 20:38:38 -0300 Subject: [PATCH] Silence dangling-symlink errors in debug packages --- Namcap/rules/symlink.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Namcap/rules/symlink.py b/Namcap/rules/symlink.py index c43e498..a42bc61 100644 --- a/Namcap/rules/symlink.py +++ b/Namcap/rules/symlink.py @@ -17,14 +17,21 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # import os +import re from Namcap.ruleclass import * +exceptions = [ + re.compile('^usr/lib/debug/\.build-id/[0-9a-f/]+$') +] + class package(TarballRule): name = "symlink" description = "Checks that symlinks point to the right place" def analyze(self, pkginfo, tar): filenames = [s.name for s in tar] for i in tar: + if any(x.match(i.name) for x in exceptions): + continue if i.issym(): self.infos.append(("symlink-found %s points to %s", (i.name, i.linkname))) linktarget = i.linkname -- 2.12.0