Add a check for dosym with target path matching absolute paths
controlled by the package manager, e.g. /bin, /etc...

Example output:

  ebuild.absdosym               5
   app-editors/nano/nano-2.5.3.ebuild: dosym '/bin/nano'... could use relative 
path on line: 81
---
 repoman/man/repoman.1                             | 4 ++++
 repoman/pym/repoman/modules/scan/ebuild/checks.py | 2 +-
 repoman/pym/repoman/qa_data.py                    | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
index 9b106906f..78e4b7275 100644
--- a/repoman/man/repoman.1
+++ b/repoman/man/repoman.1
@@ -292,6 +292,10 @@ Some files listed in SRC_URI aren't referenced in the 
Manifest
 .B digest.unused
 Some files listed in the Manifest aren't referenced in SRC_URI
 .TP
+.B ebuild.absdosym
+Ebuild uses 'dosym' with explicit absolute path where relative path
+could be used
+.TP
 .B ebuild.badheader
 This ebuild has a malformed header
 .TP
diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py 
b/repoman/pym/repoman/modules/scan/ebuild/checks.py
index 57c8b10a5..e6e5d78ba 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py
@@ -921,7 +921,7 @@ class EbuildNonRelativeDosym(LineCheck):
        def check(self, num, line):
                match = self.regex.match(line)
                if match:
-                       return "dosym '%s' could use relative path" % 
(match.group(1), ) + " on line: %d"
+                       return "dosym '%s'... could use relative path" % 
(match.group(1), ) + " on line: %d"
 
 
 _base_check_classes = (InheritEclass, LineCheck, PhaseCheck)
diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
index 132a55be3..a59fed778 100644
--- a/repoman/pym/repoman/qa_data.py
+++ b/repoman/pym/repoman/qa_data.py
@@ -195,6 +195,9 @@ qahelp = {
                "Some files listed in SRC_URI aren't referenced in the 
Manifest"),
        "digest.unused": (
                "Some files listed in the Manifest aren't referenced in 
SRC_URI"),
+       "ebuild.absdosym": (
+               "This ebuild uses absolute target to dosym where relative 
symlink"
+               " could be used instead"),
        "ebuild.majorsyn": (
                "This ebuild has a major syntax error"
                " that may cause the ebuild to fail partially or fully"),
@@ -262,6 +265,7 @@ qawarnings = set((
        "RDEPEND.suspect",
        "virtual.suspect",
        "RESTRICT.invalid",
+       "ebuild.absdosym",
        "ebuild.minorsyn",
        "ebuild.badheader",
        "ebuild.patches",
-- 
2.12.2


Reply via email to