def normalize_excludes(rootpath, excludes):
sep = os.path.sep<EOL>f_excludes = []<EOL>for exclude in excludes:<EOL><INDENT>if not os.path.isabs(exclude) and not exclude.startswith(rootpath):<EOL><INDENT>exclude = os.path.join(rootpath, exclude)<EOL><DEDENT>if not exclude.endswith(sep):<EOL><INDENT>exclude += sep<EOL><DEDENT>f_excludes.append(exclude)<EOL><DEDENT>return f_excludes<EOL>
Normalize the excluded directory list:
* must be either an absolute path or start with rootpath,
* otherwise it is joined with rootpath
* with trailing slash