From patchwork Thu Jan 25 18:31:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Shumaker X-Patchwork-Id: 353 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 46FBE1F4C7C0 for ; Thu, 25 Jan 2018 18:32:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Thu, 25 Jan 2018 18:32:06 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id CFC0B85E8F176; Thu, 25 Jan 2018 18:31:57 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Thu, 25 Jan 2018 18:31:57 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id B728120887; Thu, 25 Jan 2018 18:31:57 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 9426B20876 for ; Thu, 25 Jan 2018 18:31:55 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Thu, 25 Jan 2018 18:31:55 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D465A85E8F16E for ; Thu, 25 Jan 2018 18:31:48 +0000 (UTC) Received: from mav.lukeshu.com (mav.lukeshu.com [104.207.138.63]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Thu, 25 Jan 2018 18:31:47 +0000 (UTC) Received: from build64-par (unknown [IPv6:2601:803:202:9275:da50:e6ff:fe00:4a5b]) by mav.lukeshu.com (Postfix) with ESMTPSA id 35EC180502 for ; Thu, 25 Jan 2018 13:31:46 -0500 (EST) From: Luke Shumaker To: arch-projects@archlinux.org Date: Thu, 25 Jan 2018 13:31:45 -0500 Message-Id: <20180125183145.9296-1-lukeshu@lukeshu.com> X-Mailer: git-send-email 2.15.1 Subject: [arch-projects] [PATCH] [namcap] Treat all non-tar files as PKGBUILD files, regardless of filename X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Arch Linux projects development discussion Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" From: Luke Shumaker https://bugs.archlinux.org/task/57193 If the user mistakenly passes in some other (non-package, non-PKGBUILD) file, instead of refusing to process it (saying "Error: Cannot process ${filename}"), it will now try to parse it as a PKGBUILD, probably encounter and print at least one error, but finally say "Error: ${filename} is not a valid PKGBUILD". This is actually probably *more* helpful to a confused user who passed in the wrong file. --- namcap.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/namcap.py b/namcap.py index b62a2fa..fd62d3c 100755 --- a/namcap.py +++ b/namcap.py @@ -248,9 +248,7 @@ for package in packages: if os.path.isfile(package) and tarfile.is_tarfile(package): process_realpackage(package, active_modules) - elif package.endswith('PKGBUILD'): + else: process_pkgbuild(package, active_modules) - else: - print("Error: Cannot process %s" % package) # vim: set ts=4 sw=4 noet: