def addpackage(sitedir, name, known_paths):
if known_paths is None:<EOL><INDENT>_init_pathinfo()<EOL>reset = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>reset = <NUM_LIT:0><EOL><DEDENT>fullname = os.path.join(sitedir, name)<EOL>try:<EOL><INDENT>f = open(fullname, "<STR_LIT>")<EOL><DEDENT>except IOError:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>for line in f:<EOL><INDENT>if line.startswith("<STR_LIT:#>"):<EOL><INDENT>continue<EOL><DEDENT>if line.startswith("<STR_LIT>"):<EOL><INDENT>exec(line)<EOL>continue<EOL><DEDENT>line = line.rstrip()<EOL>dir, dircase = makepath(sitedir, line)<EOL>if not dircase in known_paths and os.path.exists(dir):<EOL><INDENT>sys.path.append(dir)<EOL>known_paths.add(dircase)<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>f.close()<EOL><DEDENT>if reset:<EOL><INDENT>known_paths = None<EOL><DEDENT>return known_paths<EOL>
Add a new path to known_paths by combining sitedir and 'name' or execute
    sitedir if it starts with 'import