From owner-dev-commits-ports-main@freebsd.org Sun Aug 8 14:58:10 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80F93658155; Sun, 8 Aug 2021 14:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjMlj4ll8z4jcZ; Sun, 8 Aug 2021 14:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 171E91675B; Sun, 8 Aug 2021 14:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178Ew8Cr023703; Sun, 8 Aug 2021 14:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178Ew8Gx023702; Sun, 8 Aug 2021 14:58:08 GMT (envelope-from git) Date: Sun, 8 Aug 2021 14:58:08 GMT Message-Id: <202108081458.178Ew8Gx023702@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 70be34c9bb73 - main - devel/p5-Module-Installed-Tiny: Add p5-Module-Installed-Tiny 0.004 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70be34c9bb73ea7c16247e4edef1a197e441e504 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 14:58:10 -0000 The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=70be34c9bb73ea7c16247e4edef1a197e441e504 commit 70be34c9bb73ea7c16247e4edef1a197e441e504 Author: Po-Chuan Hsieh AuthorDate: 2021-08-08 14:32:13 +0000 Commit: Po-Chuan Hsieh CommitDate: 2021-08-08 14:53:54 +0000 devel/p5-Module-Installed-Tiny: Add p5-Module-Installed-Tiny 0.004 To check if a module is installed (available), generally the simplest way is to try to require() it. However, this actually loads the module. There are some cases where this is not desirable: 1) we have to check a lot of modules (actually loading the modules will take a lot of CPU time and memory; 2) some of the modules conflict with one another and cannot all be loaded; 3) the module is OS specific and might not load under another OS; 4) we simply do not want to execute the module, for security or other reasons. Module::Installed::Tiny provides a routine module_installed() which works like Perl's require but does not actually load the module. WWW: https://metacpan.org/dist/Module-Installed-Tiny --- devel/Makefile | 1 + devel/p5-Module-Installed-Tiny/Makefile | 23 +++++++++++++++++++++++ devel/p5-Module-Installed-Tiny/distinfo | 3 +++ devel/p5-Module-Installed-Tiny/pkg-descr | 12 ++++++++++++ devel/p5-Module-Installed-Tiny/pkg-plist | 2 ++ 5 files changed, 41 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index b6b5344e0568..be5ee8dc5676 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -2778,6 +2778,7 @@ SUBDIR += p5-Module-Install-Template SUBDIR += p5-Module-Install-TestBase SUBDIR += p5-Module-Install-XSUtil + SUBDIR += p5-Module-Installed-Tiny SUBDIR += p5-Module-List SUBDIR += p5-Module-Load SUBDIR += p5-Module-Load-Conditional diff --git a/devel/p5-Module-Installed-Tiny/Makefile b/devel/p5-Module-Installed-Tiny/Makefile new file mode 100644 index 000000000000..e5fc0fa7447c --- /dev/null +++ b/devel/p5-Module-Installed-Tiny/Makefile @@ -0,0 +1,23 @@ +# Created by: Po-Chuan Hsieh + +PORTNAME= Module-Installed-Tiny +PORTVERSION= 0.004 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Check if a module is installed, with as little code as possible + +LICENSE= ART10 GPLv1+ +LICENSE_COMB= dual +LICENSE_FILE= ${WRKSRC}/LICENSE + +TEST_DEPENDS= p5-Test-Needs>=0:devel/p5-Test-Needs + +USES= perl5 +USE_PERL5= configure + +NO_ARCH= yes + +.include diff --git a/devel/p5-Module-Installed-Tiny/distinfo b/devel/p5-Module-Installed-Tiny/distinfo new file mode 100644 index 000000000000..e4c409fc85a9 --- /dev/null +++ b/devel/p5-Module-Installed-Tiny/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1628103012 +SHA256 (Module-Installed-Tiny-0.004.tar.gz) = 0f880fc3aea773084e786d92feeeebe5021320005cba728d9ec640035fd8acb3 +SIZE (Module-Installed-Tiny-0.004.tar.gz) = 17418 diff --git a/devel/p5-Module-Installed-Tiny/pkg-descr b/devel/p5-Module-Installed-Tiny/pkg-descr new file mode 100644 index 000000000000..df49f0604395 --- /dev/null +++ b/devel/p5-Module-Installed-Tiny/pkg-descr @@ -0,0 +1,12 @@ +To check if a module is installed (available), generally the simplest way is to +try to require() it. However, this actually loads the module. There are some +cases where this is not desirable: 1) we have to check a lot of modules +(actually loading the modules will take a lot of CPU time and memory; 2) some of +the modules conflict with one another and cannot all be loaded; 3) the module is +OS specific and might not load under another OS; 4) we simply do not want to +execute the module, for security or other reasons. + +Module::Installed::Tiny provides a routine module_installed() which works like +Perl's require but does not actually load the module. + +WWW: https://metacpan.org/dist/Module-Installed-Tiny diff --git a/devel/p5-Module-Installed-Tiny/pkg-plist b/devel/p5-Module-Installed-Tiny/pkg-plist new file mode 100644 index 000000000000..ff48628622d7 --- /dev/null +++ b/devel/p5-Module-Installed-Tiny/pkg-plist @@ -0,0 +1,2 @@ +%%SITE_PERL%%/Module/Installed/Tiny.pm +%%PERL5_MAN3%%/Module::Installed::Tiny.3.gz