#: To ignore comment and whitespace lines.
re_whitespace_comment = re.compile(r"^\s*(#|$)")
re_no_epoch = re.compile(r"^\d+\:")
#: To ignore comment and whitespace lines.
re_whitespace_comment = re.compile(r"^\s*(#|$)")
re_no_epoch = re.compile(r"^\d+\:")
re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)")
re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$")
orig_source_ext_re = r"orig(?:-.+)?\.tar\.(?:gz|bz2|xz)"
re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)")
re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$")
orig_source_ext_re = r"orig(?:-.+)?\.tar\.(?:gz|bz2|xz)"
re_single_line_field = re.compile(r"^(\S*?)\s*:\s*(.*)")
re_multi_line_field = re.compile(r"^\s(.*)")
re_taint_free = re.compile(r"^[-+~/\.\w]+$")
re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
re_single_line_field = re.compile(r"^(\S*?)\s*:\s*(.*)")
re_multi_line_field = re.compile(r"^\s(.*)")
re_taint_free = re.compile(r"^[-+~/\.\w]+$")
re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
re_verwithext = re.compile(r"^(\d+)(?:\.(\d+))(?:\s+\((\S+)\))?$")
re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
re_verwithext = re.compile(r"^(\d+)(?:\.(\d+))(?:\s+\((\S+)\))?$")
html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'}
re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'}
re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
# From new_security_install.py
re_taint_free = re.compile(r"^['/;\-\+\.~\s\w]+$")
# From process_unchecked.py
# From new_security_install.py
re_taint_free = re.compile(r"^['/;\-\+\.~\s\w]+$")
# From process_unchecked.py
-re_file_safe = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_.:~+-]*$')
+re_file_safe = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_.~+-]*$')
+
+# Match safe filenames, including slashes
+re_file_safe_slash = re.compile(r'^[a-zA-Z0-9][/a-zA-Z0-9_.~+-]*$')
# Match binary packages
# Groups: package, version, architecture, type
# Match binary packages
# Groups: package, version, architecture, type
# Match other source files
# Groups: package, version
# Match other source files
# Groups: package, version