import re
_normalize_needed = re.compile(r'.*//.*|^[^/]|.+/$|(^|.*/)\.\.?(/.*|$)')
+ _contents_split_counts = {
+ "dev": 1,
+ "dir": 1,
+ "fif": 1,
+ "obj": 4,
+ "sym": 5
+ }
def __init__(self, cat, pkg, myroot, mysettings, treetype=None,
vartree=None):
myc.close()
null_byte = "\0"
normalize_needed = self._normalize_needed
+ contents_split_counts = self._contents_split_counts
myroot = self.myroot
if myroot == os.path.sep:
myroot = None
noiselevel=-1)
continue
mydat = line.split()
+ correct_split_count = contents_split_counts.get(mydat[0])
+ if correct_split_count and len(mydat) != correct_split_count:
+ if mydat[0] == "obj" and \
+ len(mydat) > contents_split_counts["obj"]:
+ # File name contains spaces. Use field widths to infer the
+ # start and end points so that even multiple consecutive
+ # spaces are parsed correctly.
+ newsplit = ["obj"]
+ filename_start = len(mydat[0]) + 1
+ filename_end = len(line.rstrip()) - \
+ len(mydat[-1]) - len(mydat[-2]) - 2
+ newsplit.append(line[filename_start:filename_end])
+ newsplit.extend(mydat[-2:])
+ mydat = newsplit
# we do this so we can remove from non-root filesystems
# (use the ROOT var to allow maintenance on other partitions)
try: