From patchwork Fri Oct 12 14:21:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 12189 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 CCFE523FB3 for ; Fri, 12 Oct 2012 14:21:20 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2046DA18694 for ; Fri, 12 Oct 2012 14:21:20 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so4716782iej.11 for ; Fri, 12 Oct 2012 07:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=y1LizVVTIYz2zpVl9ArWJkLqCWFRxbhyxjzRM6Nxevk=; b=HB69wvCfKc9mEUj3MjzyVUvb1jORirPVerBv4M07dQ86+53q9bcXCU1vZoJuVWwgMj QAjpdFlVSa7sNJPP7CiRk/PE/VMtEB+58NklHATtXKSyHpzjS2prRnbRNGE01MY+OoAy pMoyWb6xuMekW/7rhmhjmeD6tLI7P2W2cUU7KEvNNoshZYL7BZmPTY/vka/2ECEeVIH7 IluYow9Xl+uiw87l8d5dhKx2t9TRDxgFb0NLqUAQEWJCSdq7IiYjypAtoQ8z5jfjKbs8 SEickvbjVaBkWeLBbckKZia9Sz0rcPy7wexqnDOVdchfa6B36bD4WHkFUcNPuVoLDESj n2PA== Received: by 10.43.7.132 with SMTP id oo4mr3592878icb.6.1350051679573; Fri, 12 Oct 2012 07:21:19 -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.50.67.148 with SMTP id n20csp203158igt; Fri, 12 Oct 2012 07:21:18 -0700 (PDT) Received: by 10.216.141.16 with SMTP id f16mr3004023wej.130.1350051677698; Fri, 12 Oct 2012 07:21:17 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id s4si4250264wiz.35.2012.10.12.07.21.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 07:21:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TMg72-0000SF-6r for ; Fri, 12 Oct 2012 14:21:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 130F5E0409 for ; Fri, 12 Oct 2012 14:21:16 +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: 575 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 575: Skip symlink-ed or invalid debian package file. (LP: #1065826) Message-Id: <20121012142116.15300.40775.launchpad@ackee.canonical.com> Date: Fri, 12 Oct 2012 14:21:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16137"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f50f1a52f1eaa68da2456b3b0a4e7243ed053a2c X-Gm-Message-State: ALoCoQn07KPQcVklPsLcKXPY0UgA7TG7+FGvBppCaSvw/RaLx/gvmr0hbsJb2YfCM5/PG+U4Dy8A Merge authors: Fathi Boudra (fboudra) Related merge proposals: https://code.launchpad.net/~fboudra/linaro-image-tools/bug-1065826/+merge/129410 proposed by: Fathi Boudra (fboudra) ------------------------------------------------------------ revno: 575 [merge] committer: Fathi Boudra branch nick: linaro-image-tools timestamp: Fri 2012-10-12 17:20:25 +0300 message: Skip symlink-ed or invalid debian package file. (LP: #1065826) modified: linaro_image_tools/hwpack/builder.py --- 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_image_tools/hwpack/builder.py' --- linaro_image_tools/hwpack/builder.py 2012-10-11 09:24:36 +0000 +++ linaro_image_tools/hwpack/builder.py 2012-10-12 12:31:22 +0000 @@ -28,6 +28,7 @@ from glob import iglob from debian.debfile import DebFile +from debian.arfile import ArError from linaro_image_tools import cmd_runner @@ -337,11 +338,21 @@ 'build-info') build_info_available = 0 for deb_pkg in self.packages: - # Extract Build-Info attribute from debian control deb_pkg_file_path = deb_pkg.filepath - deb_control = \ + if os.path.islink(deb_pkg_file_path): + # Skip symlink-ed debian package file + # e.g. fetched package with dummy information + continue + try: + # Extract Build-Info attribute from debian + # control + deb_control = \ DebFile(deb_pkg_file_path).control.debcontrol() - build_info = deb_control.get('Build-Info') + build_info = deb_control.get('Build-Info') + except ArError: + # Skip invalid debian package file + # e.g. fetched package with dummy information + continue if build_info is not None: build_info_available += 1 # Extract debian packages with build