From patchwork Wed Aug 3 11:30:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Deepti B. Kalakeri" X-Patchwork-Id: 3234 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3F6D123F46 for ; Wed, 3 Aug 2011 11:30:56 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 09CE2A182BA for ; Wed, 3 Aug 2011 11:30:55 +0000 (UTC) Received: by qwb8 with SMTP id 8so104724qwb.11 for ; Wed, 03 Aug 2011 04:30:55 -0700 (PDT) Received: by 10.229.44.195 with SMTP id b3mr2737598qcf.7.1312371054339; Wed, 03 Aug 2011 04:30:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.6.73 with SMTP id 9cs155214qcy; Wed, 3 Aug 2011 04:30:53 -0700 (PDT) Received: by 10.227.196.138 with SMTP id eg10mr1357200wbb.64.1312371052840; Wed, 03 Aug 2011 04:30:52 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id ev16si1370804wbb.92.2011.08.03.04.30.52; Wed, 03 Aug 2011 04:30:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QoZf2-00061Y-5m for ; Wed, 03 Aug 2011 11:30:52 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 2A2472E800E for ; Wed, 3 Aug 2011 11:30:52 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 398 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [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> Date: Wed, 03 Aug 2011 11:30:52 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13573"; Instance="initZopeless config overlay" X-Launchpad-Hash: 9088078b0aa9e05928c59b09e5f3cfae9e018da8 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 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 === 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: