Return an empty list if depsolve results are empty

This commit is contained in:
Brian C. Lane 2018-05-03 14:18:42 -07:00
parent 6aa52b0b53
commit 99cdd573a3

View File

@ -204,7 +204,7 @@ def projects_depsolve(dbo, project_names):
raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e))) raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e)))
if len(dbo.transaction) == 0: if len(dbo.transaction) == 0:
raise ProjectsError("No packages installed for %s" % project_names) return []
return sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower()) return sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower())
@ -257,7 +257,7 @@ def projects_depsolve_with_size(dbo, project_names, with_core=True):
raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e))) raise ProjectsError("There was a problem depsolving %s: %s" % (project_names, str(e)))
if len(dbo.transaction) == 0: if len(dbo.transaction) == 0:
raise ProjectsError("No packages installed for %s" % project_names) return (0, [])
installed_size = estimate_size(dbo.transaction.install_set) installed_size = estimate_size(dbo.transaction.install_set)
deps = sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower()) deps = sorted(map(pkg_to_dep, dbo.transaction.install_set), key=lambda p: p["name"].lower())