aboutsummaryrefslogtreecommitdiff
path: root/linaro-hwpack-replace
diff options
context:
space:
mode:
authorJames Westby <james.westby@linaro.org>2011-07-28 17:32:53 +0100
committerJames Westby <james.westby@linaro.org>2011-07-28 17:32:53 +0100
commit712a559a7247d9ad8a7c57e112ef4a3712c4a21c (patch)
tree3279aeca3efa81b26daff8aeb91603a57a2fd303 /linaro-hwpack-replace
parentb9f5ba1bf6f2cb1cf5683d5f555d23dabe2d2fae (diff)
hwpack-replace: Always add the new info the Packages file.
Also only add a single staza of the new package, even if there are multiple packages to remove.
Diffstat (limited to 'linaro-hwpack-replace')
-rwxr-xr-xlinaro-hwpack-replace7
1 files changed, 4 insertions, 3 deletions
diff --git a/linaro-hwpack-replace b/linaro-hwpack-replace
index 3422efc..0a169d9 100755
--- a/linaro-hwpack-replace
+++ b/linaro-hwpack-replace
@@ -135,11 +135,12 @@ def modify_Packages_info(debpack_dirname, new_debpack_info):
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: