docs: def _get_ignore_from_manifest_lines(lines):
      """Gather the various ignore patterns from a MANIFEST.in.
  
      'lines' should be a list of strings with comments removed
      and continuation lines joined.
  
      Returns a list of standard ignore patterns and a list of regular
      expressions to ignore.
      """
      ignore = []
      ignore_regexps = []
      for line in lines:
          try:
              cmd, rest = line.split(None, 1)
          except ValueError:
              # no whitespace, so not interesting
              continue
          for part in rest.split():
              # distutils enforces these warnings on Windows only
              if part.startswith('/'):
                  warning("ERROR: Leading slashes are not allowed in MANIFEST.in on Windows: %s" % part)
              if part.endswith('/'):
                  warning("ERROR: Trailing slashes are not allowed in MANIFEST.in on Windows: %s" % part)
          if cmd == 'exclude':
              # An exclude of 'dirname/*css' can match 'dirname/foo.css'
              # but not 'dirname/subdir/bar.css'.  We need a regular
              # expression for that, since fnmatch doesn't pay attention to
              # directory separators.
              for pat in rest.split():
                  if '*' in pat or '?' in pat or '[!' in pat:
                      ignore_regexps.append(_glob_to_regexp(pat))
                  else:
                      # No need for special handling.
                      ignore.append(pat)
          elif cmd == 'global-exclude':
              ignore.extend(rest.split())
          elif cmd == 'recursive-exclude':
              try:
                  dirname, patterns = rest.split(None, 1)
              except ValueError:
                  # Wrong MANIFEST.in line.
                  warning("You have a wrong line in MANIFEST.in: %r\n"
                          "'recursive-exclude' expects <dir> <pattern1> "
                          "<pattern2> ..." % line)
                  continue
              # Strip path separator for clarity.
              dirname = dirname.rstrip(os.path.sep)
              for pattern in patterns.split():
                  if pattern.startswith('*'):
                      ignore.append(dirname + os.path.sep + pattern)
                  else:
                      # 'recursive-exclude plone metadata.xml' should
                      # exclude plone/metadata.xml and
                      # plone/*/metadata.xml, where * can be any number
                      # of sub directories.  We could use a regexp, but
                      # two ignores seems easier.
                      ignore.append(dirname + os.path.sep + pattern)
                      ignore.append(
                          dirname + os.path.sep + '*' + os.path.sep + pattern)
          elif cmd == 'prune':
              # rest is considered to be a directory name.  It should
              # not contain a path separator, as it actually has no
              # effect in that case, but that could differ per python
              # version.  We strip it here to avoid double separators.
              # XXX: mg: I'm not 100% sure the above is correct, AFAICS
              # all pythons from 2.6 complain if the path has a leading or
              # trailing slash -- on Windows, that is.
              rest = rest.rstrip('/\\')
              ignore.append(rest)
              ignore.append(rest + os.path.sep + '*')
      return ignore, ignore_regexps