diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 398: hwpack-replace: Always add the new info the Packages file.

Message ID 20110803113052.11390.11945.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Deepti B. Kalakeri Aug. 3, 2011, 11:30 a.m. UTC
Merge authors:
  James Westby (james-w)
Related merge proposals:
  https://code.launchpad.net/~james-w/linaro-image-tools/fix-repack-packages-file/+merge/69682
  proposed by: James Westby (james-w)
  review: Approve - James Tunnicliffe (dooferlad)
------------------------------------------------------------
revno: 398 [merge]
committer: Deepti B. Kalakeri<deepti.kalakeri@linaro.org>
branch nick: linaro-image-tools
timestamp: Wed 2011-08-03 12:27:28 +0100
message:
  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.
modified:
  linaro-hwpack-replace


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== 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: