def get_csv_rows_for_installed(<EOL>old_csv_rows,  <EOL>installed,  <EOL>changed,  <EOL>generated,  <EOL>lib_dir,  <EOL>):<EOL>
installed_rows = []  <EOL>for row in old_csv_rows:<EOL><INDENT>if len(row) > <NUM_LIT:3>:<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>'.format(row)<EOL>)<EOL><DEDENT>row = list(row)<EOL>old_path = row[<NUM_LIT:0>]<EOL>new_path = installed.pop(old_path, old_path)<EOL>row[<NUM_LIT:0>] = new_path<EOL>if new_path in changed:<EOL><INDENT>digest, length = rehash(new_path)<EOL>row[<NUM_LIT:1>] = digest<EOL>row[<NUM_LIT:2>] = length<EOL><DEDENT>installed_rows.append(tuple(row))<EOL><DEDENT>for f in generated:<EOL><INDENT>digest, length = rehash(f)<EOL>installed_rows.append((normpath(f, lib_dir), digest, str(length)))<EOL><DEDENT>for f in installed:<EOL><INDENT>installed_rows.append((installed[f], '<STR_LIT>', '<STR_LIT>'))<EOL><DEDENT>return installed_rows<EOL>
:param installed: A map from archive RECORD path to installation RECORD
    path.