diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> | 2019-11-07 07:38:30 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2019-11-07 20:31:42 -0800 |
commit | 424f333b044a89f3a7a782ceef43480795696f3b (patch) | |
tree | 9af5ee2bbfb1ec3f8326c260335b7a7308321a8d | |
parent | emaint: log FileCopier exceptions (diff) | |
download | portage-424f333b044a89f3a7a782ceef43480795696f3b.tar.gz portage-424f333b044a89f3a7a782ceef43480795696f3b.tar.bz2 portage-424f333b044a89f3a7a782ceef43480795696f3b.zip |
repoman: ebuild.absdosym check: Detect absolute paths starting with ${D}, ${ED} etc.
Bug: https://bugs.gentoo.org/699514
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | repoman/lib/repoman/modules/linechecks/do/dosym.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/repoman/lib/repoman/modules/linechecks/do/dosym.py b/repoman/lib/repoman/modules/linechecks/do/dosym.py index bab4dad03..c342d3595 100644 --- a/repoman/lib/repoman/modules/linechecks/do/dosym.py +++ b/repoman/lib/repoman/modules/linechecks/do/dosym.py @@ -7,8 +7,10 @@ from repoman.modules.linechecks.base import LineCheck class EbuildNonRelativeDosym(LineCheck): """Check ebuild for dosym using absolute paths instead of relative.""" repoman_check_name = 'ebuild.absdosym' + variables = ('D', 'ED', 'ROOT', 'EROOT', 'BROOT') regex = re.compile( - r'^\s*dosym\s+["\']?(/(bin|etc|lib|opt|sbin|srv|usr|var)\S*)') + r'^\s*dosym\s+(["\']?((\$(%s)\W|\${(%s)(%%/)?})|/(bin|etc|lib|opt|sbin|srv|usr|var))\S*)' % + ('|'.join(variables), '|'.join(variables)), re.ASCII) def check(self, num, line): match = self.regex.match(line) |