(
    old_csv_rows,  # type: Iterable[List[str]]
    installed,  # type: Dict[str, str]
    changed,  # type: set
    generated,  # type: List[str]
    lib_dir,  # type: str
)
return installed_rows
:param installed: A map from archive RECORD path to installation RECORD
        path.
:param installed: A map from archive RECORD path to installation RECORD
        path.
: param installed : A map from archive RECORD path to installation RECORD path .
def get_csv_rows_for_installed(
    old_csv_rows,  # type: Iterable[List[str]]
    installed,  # type: Dict[str, str]
    changed,  # type: set
    generated,  # type: List[str]
    lib_dir,  # type: str
):
    # type: (...) -> List[InstalledCSVRow]
    """
    :param installed: A map from archive RECORD path to installation RECORD
        path.
    """
    installed_rows = []  # type: List[InstalledCSVRow]
    for row in old_csv_rows:
        if len(row) > 3:
            logger.warning(
                'RECORD line has more than three elements: {}'.format(row)
            )
        # Make a copy because we are mutating the row.
        row = list(row)
        old_path = row[0]
        new_path = installed.pop(old_path, old_path)
        row[0] = new_path
        if new_path in changed:
            digest, length = rehash(new_path)
            row[1] = digest
            row[2] = length
        installed_rows.append(tuple(row))
    for f in generated:
        digest, length = rehash(f)
        installed_rows.append((normpath(f, lib_dir), digest, str(length)))
    for f in installed:
        installed_rows.append((installed[f], '', ''))
    return installed_rows
def get_csv_rows_for_installed ( old_csv_rows , # type: Iterable[List[str]] installed , # type: Dict[str, str] changed , # type: set generated , # type: List[str] lib_dir , # type: str ) : # type: (...) -> List[InstalledCSVRow] installed_rows = [ ] # type: List[InstalledCSVRow] for row in old_csv_rows : if len ( row ) > 3 : logger . warning ( 'RECORD line has more than three elements: {}' . format ( row ) ) # Make a copy because we are mutating the row. row = list ( row ) old_path = row [ 0 ] new_path = installed . pop ( old_path , old_path ) row [ 0 ] = new_path if new_path in changed : digest , length = rehash ( new_path ) row [ 1 ] = digest row [ 2 ] = length installed_rows . append ( tuple ( row ) ) for f in generated : digest , length = rehash ( f ) installed_rows . append ( ( normpath ( f , lib_dir ) , digest , str ( length ) ) ) for f in installed : installed_rows . append ( ( installed [ f ] , '' , '' ) ) return installed_rows