Message ID | 20110803113052.11390.11945.launchpad@loganberry.canonical.com |
---|---|
State | Accepted |
Headers | show |
=== modified file 'linaro-hwpack-replace' --- linaro-hwpack-replace 2011-07-19 01:25:57 +0000 +++ linaro-hwpack-replace 2011-07-28 16:32:53 +0000 @@ -135,11 +135,12 @@ f = open(debpack_Packages_fname, "r+") try: output = [] + def should_remove(package_name): + return package_name == new_debpack_info.name for stanza in Packages.iter_paragraphs(f): - if stanza["Package"] == new_debpack_info.name: - output.append(DummyStanza(new_debpack_info)) - else: + if not should_remove(stanza["Package"]): output.append(stanza) + output.append(DummyStanza(new_debpack_info)) f.seek(0,0) for stanza in output: