diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-03-17 09:44:03 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-03-17 09:44:03 -0700 |
commit | 2dac56fa282645031eb29860abc403e983a04b2d (patch) | |
tree | b6f373ebeecdeb7f8492d9497bacde1f9d001b99 /pym | |
parent | ea755bfec221290cb1f3b09aae3a885996146458 (diff) | |
download | portage-2dac56fa282645031eb29860abc403e983a04b2d.tar.gz portage-2dac56fa282645031eb29860abc403e983a04b2d.tar.bz2 portage-2dac56fa282645031eb29860abc403e983a04b2d.zip |
Manifest: filter file names with repoman's regex
This makes Manifest generation consistent with repoman, which is
necessary if repoman is going to ignore irrelevant files as requested
in bug #406877.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/manifest.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index da40ae117..90324eebe 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -1,8 +1,9 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import errno import io +import re import warnings import portage @@ -22,6 +23,9 @@ from portage.const import (MANIFEST1_HASH_FUNCTIONS, MANIFEST2_HASH_DEFAULTS, MANIFEST2_HASH_FUNCTIONS, MANIFEST2_IDENTIFIERS, MANIFEST2_REQUIRED_HASH) from portage.localization import _ +# Characters prohibited by repoman's file.name check. +_prohibited_filename_chars_re = re.compile(r'[^a-zA-Z0-9._\-+:]') + class FileNotInManifestException(PortageException): pass @@ -33,10 +37,14 @@ def manifest2AuxfileFilter(filename): for x in mysplit: if x[:1] == '.': return False + if _prohibited_filename_chars_re.search(x) is not None: + return False return not filename[:7] == 'digest-' def manifest2MiscfileFilter(filename): filename = filename.strip(os.sep) + if _prohibited_filename_chars_re.search(filename) is not None: + return False return not (filename in ["CVS", ".svn", "files", "Manifest"] or filename.endswith(".ebuild")) def guessManifestFileType(filename): |