From patchwork Fri Jan 17 13:19:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Panteleev X-Patchwork-Id: 1452 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 96CBA165B94F8 for ; Fri, 17 Jan 2020 13:20:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_NONE=-0.0001,SPF_HELO_NONE=0.001,T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.0.6] [127.0.9.0] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:20:07 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 0E4CC182649B1A; Fri, 17 Jan 2020 13:19:57 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id CE651182649B13; Fri, 17 Jan 2020 13:19:57 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id BC6982BFEB; Fri, 17 Jan 2020 13:19: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 6D2EE2BFE1 for ; Fri, 17 Jan 2020 13:19:51 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:51 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 7A817182649AFF for ; Fri, 17 Jan 2020 13:19:45 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:45 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id j42so22651933wrj.12 for ; Fri, 17 Jan 2020 05:19:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lV75jHHNHVM+1s9OCmHfhQKVq6Zj8PQfKt1p5XMX5+Y=; b=oE+zk3G3eAAOssMPPA4gfi5rnIheTvOlZ9d2LQQQp346ERtvdQeUNhvwTPXC8Tj9IX bcm61cyqsmossUufUQ/mjce401esXWrAZ2AYA1knOX0n51fNzm2NP0EBsNqcX96Dr4yf wKBINUkjM4HdGt1gWPzDNMPtbmknymjY+ms/vFTwacB1KVOJ5CjSYjuqJhdpRA3E837d NQ/LBsodXhE8H+eeXrIuKaP9jhhU4+pjQlb8VjB4h6DaMoqqk0dqf4a5Jlvbdb1ccpNv qF4EEia4jpGc11wqqYz+SLsruRIydSRHWQ0wdqO+vGk7UErmtTEdwLVx99Ruu2ANXXg0 hY4w== X-Gm-Message-State: APjAAAV05AobJcm0pE2piAZoEbP0txM0MPJa0Mbam9e7aNS+/NzxsXmB JL3I+c2EWTXkdeA6eDI4bZcTzpA3xOM= X-Google-Smtp-Source: APXvYqwDESoT336vtoD0Ol4h5NWX5yAGr6dXgB78oIClggXgdOElmIgjPNm3kSuViSo7b6fCWvoTwg== X-Received: by 2002:a5d:6a10:: with SMTP id m16mr2974487wru.411.1579267184814; Fri, 17 Jan 2020 05:19:44 -0800 (PST) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id z124sm10577779wmc.20.2020.01.17.05.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:19:44 -0800 (PST) From: Vladimir Panteleev To: arch-projects@archlinux.org Date: Fri, 17 Jan 2020 13:19:27 +0000 Message-Id: <20200117131931.1746498-1-archlinux@thecybershadow.net> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH 1/5] namcap-devel: Quote arguments X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 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 Cc: Vladimir Panteleev Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" --- namcap-devel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namcap-devel b/namcap-devel index 8619a67..bdb94df 100755 --- a/namcap-devel +++ b/namcap-devel @@ -6,4 +6,4 @@ export PARSE_PKGBUILD_PATH PYTHONPATH="$(pwd)" export PYTHONPATH -./namcap -t namcap-tags $@ +./namcap -t namcap-tags "$@" From patchwork Fri Jan 17 13:19:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Panteleev X-Patchwork-Id: 1454 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 43B4C165B97A2 for ; Fri, 17 Jan 2020 13:20:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.0.6] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:20:37 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 7B459182649B8E; Fri, 17 Jan 2020 13:20:19 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 0660A182649B20; Fri, 17 Jan 2020 13:19:59 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E778D2BFE3; Fri, 17 Jan 2020 13:19:58 +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 87DCD2BFE3 for ; Fri, 17 Jan 2020 13:19:52 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:52 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 8513D182649B03 for ; Fri, 17 Jan 2020 13:19:46 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:46 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id b6so22724535wrq.0 for ; Fri, 17 Jan 2020 05:19:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I3CuuZKaHXkon8gdBEuYw9BO7URExboZhEwhfiHmlbI=; b=rU0CiwaoubmC+Fi7tG45mvpBQez8Kr2+kmAX/IkRJh6xggO9Ys5Yr/I6vUgR7Bw5EG ZD/KtWxk7Mv2qKXGzRkoifU0PR2rZHF6iP2v6x3730cu4wQ6ofhRWJbM4RaHNTvCDuYZ 4e7qljPxyRq6G1SGqx9akIxvqLdhlX1sqVDY9FDSJYbXaQzMCLMy6uyPOKrRL6fBeXQE A4LyR3UDYHNVX34m0fmspE5UujKGJUBk2lC4DlJhiuVZ84Qcpgy+WUBx8yfE5QS1DGAk GgW9DcyXbnAHHXEn/gffQs/lcZ6sLqdtB6nKREvcmlDvGeqeyGskL8wKxUU+EcHAUyeC IeIw== X-Gm-Message-State: APjAAAXnu3D9aVQP64C7LCiuVFj/2Sy7D31RH8u/TEnihlU16w3JgwOL TwmCVOrMMk+PHVY76yvbS+TAyG0diFs= X-Google-Smtp-Source: APXvYqyHA5rrOUJy3Z0U0P43dI1XdLP17DjlcBH6hUuqdc5xGphHXgROqJTwABRAhzv0GclhZHoUJA== X-Received: by 2002:adf:fd0d:: with SMTP id e13mr3019407wrr.421.1579267185864; Fri, 17 Jan 2020 05:19:45 -0800 (PST) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id z124sm10577779wmc.20.2020.01.17.05.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:19:45 -0800 (PST) From: Vladimir Panteleev To: arch-projects@archlinux.org Date: Fri, 17 Jan 2020 13:19:28 +0000 Message-Id: <20200117131931.1746498-2-archlinux@thecybershadow.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200117131931.1746498-1-archlinux@thecybershadow.net> References: <20200117131931.1746498-1-archlinux@thecybershadow.net> MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH 2/5] namcap-devel: Allow running from any directory X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 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 Cc: Vladimir Panteleev Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" --- namcap-devel | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/namcap-devel b/namcap-devel index bdb94df..5b88fe3 100755 --- a/namcap-devel +++ b/namcap-devel @@ -1,9 +1,8 @@ #!/bin/sh -PATH="$(pwd):$PATH" -PARSE_PKGBUILD_PATH="$(pwd)" -export PARSE_PKGBUILD_PATH +namcap=$(cd "$(dirname "$0")" && pwd) +PATH=$namcap:$PATH +export PARSE_PKGBUILD_PATH=$namcap -PYTHONPATH="$(pwd)" -export PYTHONPATH +export PYTHONPATH=$namcap -./namcap -t namcap-tags "$@" +"$namcap"/namcap -t "$namcap"/namcap-tags "$@" From patchwork Fri Jan 17 13:19:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Panteleev X-Patchwork-Id: 1456 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 DA6D6165B97AC for ; Fri, 17 Jan 2020 13:20:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] [127.0.0.6] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:20:43 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4A653182649BBB; Fri, 17 Jan 2020 13:20:26 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 3C11B182649B27; Fri, 17 Jan 2020 13:19:59 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 1C1CB2BFE3; Fri, 17 Jan 2020 13:19:59 +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 A23EB2BFE8 for ; Fri, 17 Jan 2020 13:19:53 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:53 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4BF71182649B05 for ; Fri, 17 Jan 2020 13:19:47 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:47 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id c9so22693049wrw.8 for ; Fri, 17 Jan 2020 05:19:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t/9x5+iO5FjUJsItbSzphHKmj17dsrUUf+joWxRhmJ8=; b=a3baqhFO9l+ggpYW+QQuc+sm1ck4Sv8XiqqiXCBdflJomEf2GnHDEmwfT3kSCAZfzl 1RgB+TcSNU8MkG3NSvZoapeEsuE0Ynt23Quu9s9U3SNzrW6XeMCxqzIXwYZX1NxS3oq7 A0wgMg/VNWL6VUQsfO3NMlG/EoxV6kyJIY1bAovEaJRL4WngpGurIdgogjhDpgqScD2H UkDx13G5+VcFjl/QO9H2WEEf5M/M5dPm8ckw0MaYteUpxB3Najk9dU8lCtDAMfroYrCU bRFDOaUq8tWjhVn4U5dylyzVPGnYy8kjBi/+6QAIh63d6IgBwyFeliBwVKii+lbNKJ3u bISw== X-Gm-Message-State: APjAAAVGpc6T2lD4VpgjpSTe3B80IkVXQlanalnjrcSXjAyuUO6b0i9q K04Ppzk6yGSmgZ4bFyOaa46P0HviV6k= X-Google-Smtp-Source: APXvYqwFSI7wN6L/AXqgGcJonSHfPMnBeXHMTBShj7BxiZh1ovp0h+VpQ/nN0P8xMadqXViGjbX5wg== X-Received: by 2002:a5d:6551:: with SMTP id z17mr3051287wrv.269.1579267186739; Fri, 17 Jan 2020 05:19:46 -0800 (PST) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id z124sm10577779wmc.20.2020.01.17.05.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:19:46 -0800 (PST) From: Vladimir Panteleev To: arch-projects@archlinux.org Date: Fri, 17 Jan 2020 13:19:29 +0000 Message-Id: <20200117131931.1746498-3-archlinux@thecybershadow.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200117131931.1746498-1-archlinux@thecybershadow.net> References: <20200117131931.1746498-1-archlinux@thecybershadow.net> MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH 3/5] README: Document how to run the test suite X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 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 Cc: Vladimir Panteleev Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" --- README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README b/README index c90315e..83b406b 100644 --- a/README +++ b/README @@ -141,6 +141,16 @@ warnings we are expecting from the rules. The test suite is in Namcap/tests. The makepkg and pkgbuild_test submodules provide easy generic methods to test a rule. +To run the test suite, run: + +env PARSE_PKGBUILD_PATH="$PWD" \ + PATH="$PWD:$PATH" \ + python setup.py test + +To run a single test, append e.g. +"-s Namcap.tests.package.test_shebangdepends" +to the command-line above. + Here is an example testing the rule "pkgnameindesc" from Namcap.tests.pkgbuild_test import PkgbuildTest From patchwork Fri Jan 17 13:19:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Panteleev X-Patchwork-Id: 1455 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 A772E165B97A4 for ; Fri, 17 Jan 2020 13:20:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=LOCAL_FAKEBUSINESS=0.5, MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001, T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] [127.0.0.6] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:20:38 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id B6D10182649B93; Fri, 17 Jan 2020 13:20:20 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 8452C182649B35; Fri, 17 Jan 2020 13:20:00 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 73D082BFE3; Fri, 17 Jan 2020 13:20:00 +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 2BCB32BFEE for ; Fri, 17 Jan 2020 13:19:54 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:54 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 5B2F5182649B07 for ; Fri, 17 Jan 2020 13:19:48 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:48 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id z7so22645578wrl.13 for ; Fri, 17 Jan 2020 05:19:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=onYXO98N7S8ZRwhl6eC07riHc/6DwRbEJnjeelyi6r8=; b=h1YtZj+St8k6JAO8cNyntOuutjlFawpPaXiZTQgQ2uayp47pFztHWlP86hLih+2KmJ AcKfgA00r+ChS8RUSMg/Jn9BcZuxoh2DiaSDoAULFaRijRt4Op1rQFEWD4nb5V7Sqmqg m0i1weCO9HR5mQyZq8vUahJw1Ddgpsx3TvAWZa5YUpJQrbrBJbx6Amb3CbCDt3xQnQ+l aQHRRCWiM8pHEuQxOMZmInDNj4o36wOb7hIsCX5gn1QCEkTxu1f6ZzQGrpb0nd3JaNDZ 9a/fXC+xnY1b2kM0p/1zYdBjWgYirxZhqK7fZ7F+c3KbIzFqQKmv8fWLmU9T7/biJ1eL RTuQ== X-Gm-Message-State: APjAAAUNOejtQfs7RblLbE+MUa3XMtSi4TDJ6bhQiVhRz1RdOwEP3uuN ua7gSHCPeBItxh/TN8D+GGOJSPyUujA= X-Google-Smtp-Source: APXvYqxtIbg2gHerueeguQ8KWe2ifsU/2c+BF7SCkyp4VNO21ntSIJRBljsEgr0PdxAHEyU4uQKu6A== X-Received: by 2002:a5d:6151:: with SMTP id y17mr2996898wrt.110.1579267187747; Fri, 17 Jan 2020 05:19:47 -0800 (PST) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id z124sm10577779wmc.20.2020.01.17.05.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:19:47 -0800 (PST) From: Vladimir Panteleev To: arch-projects@archlinux.org Date: Fri, 17 Jan 2020 13:19:30 +0000 Message-Id: <20200117131931.1746498-4-archlinux@thecybershadow.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200117131931.1746498-1-archlinux@thecybershadow.net> References: <20200117131931.1746498-1-archlinux@thecybershadow.net> MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH 4/5] README: Document how to submit patches X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 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 Cc: Vladimir Panteleev Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" --- README | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README b/README index 83b406b..b018466 100644 --- a/README +++ b/README @@ -21,8 +21,14 @@ Minimal examples (very simple packages forged to exhibit unexpected behaviour from namcap) are also welcome to extend namcap's test suite. If you've a patch (fixing a bug or a new namcap module), then you can send it -to the arch-projects mailing list. Namcap development is managed with git, so -git-formatted patches are preferred. +to the arch-projects mailing list. + +Namcap development is managed with git, so git-formatted patches are preferred. +When sending patches to the mailing list, make sure to set a valid +subjectprefix, otherwise the email will be rejected by Mailman. Git can be +configured as follows: + +git config format.subjectprefix namcap] [PATCH' Namcap's source is available on: From patchwork Fri Jan 17 13:19:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Panteleev X-Patchwork-Id: 1453 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 8DEB4165B96C1 for ; Fri, 17 Jan 2020 13:20:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] [127.0.0.6] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:20:29 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4E3E2182649B64; Fri, 17 Jan 2020 13:20:08 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 636B5182649B2E; Fri, 17 Jan 2020 13:19:59 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 49BCA2BFEA; Fri, 17 Jan 2020 13:19:59 +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 E90792BFEA for ; Fri, 17 Jan 2020 13:19:53 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:53 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 94121182649B09 for ; Fri, 17 Jan 2020 13:19:49 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 17 Jan 2020 13:19:49 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id g17so22667640wro.2 for ; Fri, 17 Jan 2020 05:19:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5DUEMYcd7hh3H59sFTRDI6HnlWbpQxS6I4ge7j0l20Y=; b=G4NSzgd7LakUbHnQTeyKAMrMqMs1e+zPMvJawsqedTJMRciMKE1QNGaYTo7G5sZDS5 KAUkyxfypcPkMLKo+2dSYh7Um+8xWznNUM4FQnO1hSDYgT3SHkRkSLUJ5XqYlrYXgxJI P4mQ5tAWq/uJXJ1OomGMck0/jwTXuB6GTHG3+FH8MSff2BYqQbLMyJ+schsCR008//Sg IkHExJ1ZFUCND8so/OB1yGB/etclZCEs+IfpJUgoDZ+tiPm+KHrBr2w/ARPa+7pKvX9M ic3XeMEpdNBMvrjUQR7bJ0hpglD2HgxOc1Kmn0Ad/SWp8b2bP4V+uxIQhOcjfcXBWWq/ Dkcw== X-Gm-Message-State: APjAAAXMzfrqg8sW7w47AUhYyjllQxTpNcr6rEqyLGjjgRCinmgTb0d6 XSSiLDGmS87hMJMKdB92sL6I+isvYRg= X-Google-Smtp-Source: APXvYqzC5SenvYFGv1wEun0lFafNaujFWfiqJ3BRTMowk8oP/QJCFa9op3MepnaeCgGjTHN4lTRmSw== X-Received: by 2002:a5d:6390:: with SMTP id p16mr3179004wru.170.1579267188787; Fri, 17 Jan 2020 05:19:48 -0800 (PST) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id z124sm10577779wmc.20.2020.01.17.05.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:19:48 -0800 (PST) From: Vladimir Panteleev To: arch-projects@archlinux.org Date: Fri, 17 Jan 2020 13:19:31 +0000 Message-Id: <20200117131931.1746498-5-archlinux@thecybershadow.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200117131931.1746498-1-archlinux@thecybershadow.net> References: <20200117131931.1746498-1-archlinux@thecybershadow.net> MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH 5/5] Fix shebangdepends rule for programs found in noncanonical locations X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 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 Cc: Vladimir Panteleev Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" If the user has a non-canonical (i.e. symlinked on Arch) location in front of their $PATH, such as /usr/sbin, shutil.which will return locations with that path. This later causes the rule to fail to find the binary in any packages, causing spurious library-no-package-associated and dependency-not-needed warnings. Fix this by resolving all symlinks for executables (using os.path.realpath) before trying to find them among installed packages. --- Namcap/rules/shebangdepends.py | 3 +- Namcap/tests/package/test_shebangdepends.py | 38 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Namcap/rules/shebangdepends.py b/Namcap/rules/shebangdepends.py index 07896df..fc359c3 100644 --- a/Namcap/rules/shebangdepends.py +++ b/Namcap/rules/shebangdepends.py @@ -21,7 +21,7 @@ """Checks dependencies on programs specified in shebangs.""" -import shutil +import shutil, os.path import Namcap.package from Namcap.util import is_script, script_type from Namcap.ruleclass import * @@ -59,6 +59,7 @@ def findowners(scriptlist): out = shutil.which(s) if not out: continue + out = os.path.realpath(out) # strip leading slash scriptpath = out.lstrip('/') diff --git a/Namcap/tests/package/test_shebangdepends.py b/Namcap/tests/package/test_shebangdepends.py index dbacd86..b92e9fe 100644 --- a/Namcap/tests/package/test_shebangdepends.py +++ b/Namcap/tests/package/test_shebangdepends.py @@ -60,5 +60,43 @@ package() { ]) self.assertEqual(w, []) + valid_pkgbuild = """ +pkgname=__namcap_test_shebangdepends +pkgver=1.0 +pkgrel=1 +pkgdesc="A package" +arch=('any') +url="http://www.example.com/" +license=('GPL') +depends=('python') +source=() +options=(!purge !zipman) +build() { + cd "${srcdir}" + echo -e "#! /usr/bin/env python\nprint('a script')" > python_sample +} +package() { + install -Dm755 "$srcdir/python_sample" "$pkgdir/usr/bin/python_sample" +} +""" + def test_shebangdepends_noncanonical(self): + "shutil.which returns noncanonical path (e.g. in /usr/sbin)" + pkgfile = "__namcap_test_shebangdepends-1.0-1-any.pkg.tar" + with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f: + f.write(self.valid_pkgbuild) + self.run_makepkg() + old_path = os.environ['PATH'] + try: + os.environ['PATH'] = '/usr/sbin:' + old_path + pkg, r = self.run_rule_on_tarball( + os.path.join(self.tmpdir, pkgfile), + Namcap.rules.shebangdepends.ShebangDependsRule + ) + finally: + os.environ['PATH'] = old_path + e, w, i = Namcap.depends.analyze_depends(pkg) + self.assertEqual(e, []) + self.assertEqual(w, []) + # vim: set ts=4 sw=4 noet: