let from_apt_request request = function
|Apt.Install vpkgreqlist ->
List.fold_left (fun acc -> function
|(Some Format822.I, vpkg, _) -> {acc with install = vpkg :: acc.install}
|(Some Format822.R, vpkg, _) -> {acc with remove = vpkg :: acc.remove}
|(None, vpkg, _) -> {acc with install = vpkg :: acc.install}
) request vpkgreqlist
|Apt.Remove vpkgreqlist ->
List.fold_left (fun acc -> function
|(Some Format822.I, vpkg, _) -> {acc with install = vpkg :: acc.install}
|(Some Format822.R, vpkg, _) -> {acc with remove = vpkg :: acc.remove}
|(None, vpkg, _) -> {acc with remove = vpkg :: acc.remove}
) request vpkgreqlist
|Apt.Upgrade _ -> {request with upgrade = true }
|Apt.DistUpgrade _ -> {request with distupgrade = true}