From patchwork Thu Apr 11 01:15:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 1063 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 07B4AD2CB2E8 for ; Thu, 11 Apr 2019 01:15:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00=-1, DKIMWL_WL_HIGH=-0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.0.10] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Thu, 11 Apr 2019 01:15:53 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 3A4BD11E265CA3; Thu, 11 Apr 2019 01:15:48 +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) by orion.archlinux.org (Postfix) with ESMTPS; Thu, 11 Apr 2019 01:15:48 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 119AF2C569; Thu, 11 Apr 2019 01:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1554945348; bh=pJCmlaab9AuRKwFqN+nwGV1glxP4W1PT6vm539Px9Xs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=gR5VhdpsT+N9E587yKu2Ae7DzIgFIG1zzHoZ+qB659Cdoejk1usEHipj+1VFZTxsz jSHNZWl2SoJRRwJp0GAa5f2SjzKsJMOvmvjFE+2QKmTFli1aGAwF9m98WJ0noFNl2N gJPPWGVaimZnsQV4v6xVCiK+yQPHmDUPe+PNLfN4jrgJOfYWW1aLHB3GHQST5jPQjO aWd6dqZP3yZRDCybM3F1FZfhA636wmm10/15CY1SwF4apDN/ttWbLTEbmTCTjct2sD s4wpx9oF2+3gEqg93o+ZJomZxrE2ZKlRzn2RYkSNqvXtJADjBqqk4qsDeb6Z4iNEiI Bbbxtt5lTkr5stySrWanHPvWXYwS2+6ouN1vt4RPUbTk5tmMOeB2crB2WGDXaCOsjL 1zNGEgolWUqp8vvvNcnxoyW0sNRv8/uSs40aDe0fteYv9DV7Do/cw2AYDSUA35s2tT cTLlVSZOfDSfL1h7sUsesTrI/EXSkmps7qRt6gfd5UPbrVSP351F6YhT51LQ/Ps9hc ZFBjoYj9tuyHwJUP+K0Di4Nd4tiWW7FHZT57xZ+yWs8mQCjHpbBYnlkaxl4M0HU622 cva6LPYwpgiW/zviHGiXG3PXg+7bx43EDQ7iiLeQ9+3Ibm/k/5onsfP31fwQZDnhil pTexRu/xJBOSFA2pc0zHYjsk= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id C795F2BDD9 for ; Thu, 11 Apr 2019 01:15:44 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Thu, 11 Apr 2019 01:15:44 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4035711E265CA0; Thu, 11 Apr 2019 01:15:40 +0000 (UTC) Received: from localhost.localdomain (ool-3f8fe1f1.dyn.optonline.net [63.143.225.241]) (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) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id A978A11E265C9F; Thu, 11 Apr 2019 01:15:39 +0000 (UTC) To: arch-projects@archlinux.org Date: Wed, 10 Apr 2019 21:15:25 -0400 Message-Id: <20190411011526.22839-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [arch-projects] [namcap] [PATCH] Remove no longer useful warnings that have missing keys 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: , From: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" Arch Linux now has pacman hooks that provide automatic handling for update-{desktop,mime}-database without each package requiring a hard dependency and a post_upgrade hook. This means it is no longer correct to depend on the packages or provide an install script. Instead, remove this entirely. Signed-off-by: Eli Schwartz --- Namcap/rules/__init__.py | 7 ++- Namcap/rules/mimefiles.py | 40 --------------- Namcap/rules/pathdepends.py | 9 ++-- Namcap/tests/package/test_mimefiles.py | 62 ------------------------ Namcap/tests/package/test_pathdepends.py | 10 +--- 5 files changed, 8 insertions(+), 120 deletions(-) delete mode 100644 Namcap/rules/mimefiles.py delete mode 100644 Namcap/tests/package/test_mimefiles.py diff --git a/Namcap/rules/__init__.py b/Namcap/rules/__init__.py index dcc950f..1e05326 100644 --- a/Namcap/rules/__init__.py +++ b/Namcap/rules/__init__.py @@ -1,7 +1,7 @@ -# +# # namcap rules - __init__ # Copyright (C) 2003-2009 Jason Chu -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# from types import ModuleType import Namcap.ruleclass @@ -37,7 +37,6 @@ from . import ( libtool, licensepkg, lotsofdocs, - mimefiles, missingbackups, pathdepends, perllocal, diff --git a/Namcap/rules/mimefiles.py b/Namcap/rules/mimefiles.py deleted file mode 100644 index f9d56f4..0000000 --- a/Namcap/rules/mimefiles.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# namcap rules - mimefiles -# Copyright (C) 2009 Hugo Doria -# Copyright (C) 2011 Rémy Oudompheng -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -from Namcap.ruleclass import * - -class MimeDesktopRule(TarballRule): - name = "mimedesktop" - description = "Check for MIME desktop file depends" - def analyze(self, pkginfo, tar): - for entry in tar: - if entry.issym(): - continue - if not entry.name.startswith("usr/share/applications"): - continue - if not entry.name.endswith(".desktop"): - continue - with tar.extractfile(entry) as f: - if not any(l.startswith(b"MimeType=") for l in f): - continue - pkginfo.detected_deps["desktop-file-utils"].append( ('desktop-file-utils-needed', ()) ) - break - -# vim: set ts=4 sw=4 noet: diff --git a/Namcap/rules/pathdepends.py b/Namcap/rules/pathdepends.py index 5bc4313..87f9758 100644 --- a/Namcap/rules/pathdepends.py +++ b/Namcap/rules/pathdepends.py @@ -1,7 +1,7 @@ -# +# # namcap rules - pathdepends # Copyright (C) 2016 Kyle Keen -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# """ This contains a collection of essentially one-line rules: @@ -41,9 +41,6 @@ class PathDependsRule(TarballRule): {'path': '^usr/share/icons/hicolor$', 'dep':'hicolor-icon-theme', 'reason':'hicolor-icon-theme-needed-for-hicolor-dir'}, - {'path': '^usr/share/mime$', - 'dep':'shared-mime-info', - 'reason':'shared-mime-info-needed'}, ] def analyze(self, pkginfo, tar): names = [entry.name for entry in tar] diff --git a/Namcap/tests/package/test_mimefiles.py b/Namcap/tests/package/test_mimefiles.py deleted file mode 100644 index bfed439..0000000 --- a/Namcap/tests/package/test_mimefiles.py +++ /dev/null @@ -1,62 +0,0 @@ -# -# namcap tests - mimefiles -# Copyright (C) 2011 Rémy Oudompheng -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA -# - -import os -from Namcap.tests.makepkg import MakepkgTest -import Namcap.rules.mimefiles - -class MimeFilesTest(MakepkgTest): - pkgbuild = """ -pkgname=__namcap_test_mimefiles -pkgver=1.0 -pkgrel=1 -pkgdesc="A package" -arch=('i686' 'x86_64') -url="http://www.example.com/" -license=('GPL') -depends=('glibc') -source=() -options=(!purge !zipman) -build() { - true -} -package() { - mkdir -p "${pkgdir}/usr/share/applications" - echo "MimeType=applcation/pdf" > "${pkgdir}/usr/share/applications/foobar.desktop" -} -""" - def test_mimetype_in_desktop(self): - "Package with desktop files and an missing dependency" - pkgfile = "__namcap_test_mimefiles-1.0-1-%(arch)s.pkg.tar" % { "arch": self.arch } - with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f: - f.write(self.pkgbuild) - self.run_makepkg() - pkg, r = self.run_rule_on_tarball( - os.path.join(self.tmpdir, pkgfile), - Namcap.rules.mimefiles.MimeDesktopRule - ) - self.assertEqual(pkg.detected_deps, - {"desktop-file-utils": [('desktop-file-utils-needed', ())] } - ) - self.assertEqual(r.errors, []) - self.assertEqual(r.warnings, []) - self.assertEqual(r.infos, []) - -# vim: set ts=4 sw=4 noet: diff --git a/Namcap/tests/package/test_pathdepends.py b/Namcap/tests/package/test_pathdepends.py index 48f153c..7abe2a2 100644 --- a/Namcap/tests/package/test_pathdepends.py +++ b/Namcap/tests/package/test_pathdepends.py @@ -2,7 +2,7 @@ # namcap tests - glibfiles # Copyright (C) 2011 Rémy Oudompheng # Copyright (C) 2016 Kyle Keen -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA -# +# import os from Namcap.tests.makepkg import MakepkgTest @@ -50,10 +50,6 @@ package() { # hicolor-icon-theme-needed-for-hicolor-dir mkdir -p "${pkgdir}/usr/share/icons/hicolor/64x64/apps" touch "${pkgdir}/usr/share/icons/hicolor/64x64/apps/example.png" - - # shared-mime-info-needed - mkdir -p "${pkgdir}/usr/share/mime/text" - touch "${pkgdir}/usr/share/mime/text/example.xml" } """ @@ -70,7 +66,6 @@ package() { {'dconf': [('dconf-needed-for-glib-schemas', ())], 'glib2': [('glib2-needed-for-gio-modules', ())], 'hicolor-icon-theme': [('hicolor-icon-theme-needed-for-hicolor-dir', ())], - 'shared-mime-info': [('shared-mime-info-needed', ())], }) self.assertEqual(r.errors, []) self.assertEqual(r.warnings, []) @@ -78,4 +73,3 @@ package() { # vim: set ts=4 sw=4 noet: -