From nobody Thu Sep 05 06:19:12 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wzq290cKPz5VH72; Thu, 05 Sep 2024 06:19:13 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzq285JtJz3yhp; Thu, 5 Sep 2024 06:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725517152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t3V9qv7PhE/Xs4Hu9R38uTRZ2S5lSJbODHyxcXaG6Q=; b=uOifi2DD7WONdslI9r8CzvBDHbbUvtBCMtJwQHPJqCinnyBcezX2MuUwO7SPUD46F+lbxb ZNPTa7phvbo4Wi7fWk3n/VsQv6XHxQUcxYrSRl9SNgzKn7M1L+BkcM04Xzx1CZqS8bPwN5 /ukH7eBjsakfztok7ZOh4EuesWOBUBv5sWKLz3JiIyjYVLjf+PQlC86mhKG1HrLVpksAVJ mh+E+zqk1NUFLI3+S76YLqEZRSKxMr/ELVRE6mqpIhzpg7kANJlazWDUisFtFMF4EUPsyu 09FQVk/bAMIJ0bcYfjjIW1IcagK4nPzhRXuQBCSL+M1UXVNkxgizsytRI6kknQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725517152; a=rsa-sha256; cv=none; b=yEAZVkRKfYwlhif+NF6FIBjwGN0xLBlAY5rep4cGCcD+QwfH8plHYPjbRr6HzBpzm0uqw/ jyoH/bkObXjVL1KjhpyVlyB23IyVrJ0hNAmvqCPD6hjqrxJd/kw8jWwJx2j5J5r7cwAXMs DeRYXJzj3XraT1gVjfNw8j4BUBuf+82A211RySYGKLD6/TH8sEN6saSrI1rq/N1hgNuOPt c3G0k3h/+NhUicX0g0IdCTY3Wwx7hJuuSns0YHZyXvcphhN/1C3kCNsLXRtNLglOfefN+U dbbmGvyV+Y6gLD/Qab4PNjGSTchL8zet/IYyXvifcoqXfBQHbysHdEIhhGY5yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725517152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t3V9qv7PhE/Xs4Hu9R38uTRZ2S5lSJbODHyxcXaG6Q=; b=M623D9rFAx8zKUv7k/T00U9dbIvjiw5G5Fh11t4U8+YXS1XpmdrlzEI1JFe/oRg7Nt2I4m ooUiqGAJszV1WUSohz3TwoReDF3EvsvdnC2Ml6ERYkGLBkr2OPYGgzKD9wdmDxpM37p31X 50AuvIh/NB+5f1beuJ5bWwk2jtQbr6bWHIzE0omNrk/QhcQLNxlBhOznTJuYzV4cj8jnjV C6ajZoLqnlMN4zhKcB1B83lJ3Y4FS7uPpiILhcaR8L87xbDxz6OVzobSKMNAHXOO+cbZag +1pRXKdWpVM154cqQUyaJSIwXkp22T7JNd3z8gBfqOmHWqUjhFFYGUN/Knm0Rw== 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 4Wzq284k1czxCj; Thu, 5 Sep 2024 06:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4856JCQX090976; Thu, 5 Sep 2024 06:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4856JC4U090973; Thu, 5 Sep 2024 06:19:12 GMT (envelope-from git) Date: Thu, 5 Sep 2024 06:19:12 GMT Message-Id: <202409050619.4856JC4U090973@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: d8f371acc012 - main - devel/p5-Data-ModeMerge: Add p5-Data-ModeMerge 0.360 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org 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: d8f371acc012ee0c679bde59c18b893c963bcb23 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=d8f371acc012ee0c679bde59c18b893c963bcb23 commit d8f371acc012ee0c679bde59c18b893c963bcb23 Author: Po-Chuan Hsieh AuthorDate: 2024-09-05 05:13:39 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-09-05 06:11:14 +0000 devel/p5-Data-ModeMerge: Add p5-Data-ModeMerge 0.360 There are already several modules on CPAN to do recursive data structure merging, like Data::Merger and Hash::Merge. Data::ModeMerge differs in that it offers merging "modes" and "options". It provides greater flexibility on what the result of a merge between two data should/can be. This module may or may not be what you need. One application of this module is in handling configuration. Often there are multiple levels of configuration, e.g. in your typical Unix command-line program there are system-wide config file in /etc, per-user config file under ~/, and command-line options. It's convenient programatically to load each of those in a hash and then merge system-wide hash with the per-user hash, and then merge the result with the command-line hash to get the a single hash as the final configuration. Your program can from there on deal with this just one hash instead of three. In a typical merging process between two hashes (left-side and right-side), when there is a conflicting key, then the right-side key will override the left-side. This is usually the desired behaviour in our said program as the system-wide config is there to provide defaults, and the per-user config (and the command-line arguments) allow a user to override those defaults. --- devel/Makefile | 1 + devel/p5-Data-ModeMerge/Makefile | 26 ++++++++++++++++++++++++++ devel/p5-Data-ModeMerge/distinfo | 3 +++ devel/p5-Data-ModeMerge/pkg-descr | 20 ++++++++++++++++++++ devel/p5-Data-ModeMerge/pkg-plist | 18 ++++++++++++++++++ 5 files changed, 68 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index fbebdb523eac..27501dfa1a62 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -2241,6 +2241,7 @@ SUBDIR += p5-Data-MessagePack SUBDIR += p5-Data-MessagePack-Stream SUBDIR += p5-Data-Miscellany + SUBDIR += p5-Data-ModeMerge SUBDIR += p5-Data-Model SUBDIR += p5-Data-Munge SUBDIR += p5-Data-Object diff --git a/devel/p5-Data-ModeMerge/Makefile b/devel/p5-Data-ModeMerge/Makefile new file mode 100644 index 000000000000..5a1d1dc7cd80 --- /dev/null +++ b/devel/p5-Data-ModeMerge/Makefile @@ -0,0 +1,26 @@ +PORTNAME= Data-ModeMerge +PORTVERSION= 0.36.0 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- +DISTNAME= Data-ModeMerge-${PORTVERSION:R}${PORTVERSION:E} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Merge two nested data structures, with merging modes and options +WWW= https://metacpan.org/dist/Data-ModeMerge + +LICENSE= ART10 GPLv1+ +LICENSE_COMB= dual +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${RUN_DEPENDS} +RUN_DEPENDS= p5-Data-Dmp>=0.241:devel/p5-Data-Dmp \ + p5-Mo>=0:devel/p5-Mo +TEST_DEPENDS= p5-Test-Exception>=0:devel/p5-Test-Exception + +USES= perl5 +USE_PERL5= configure + +NO_ARCH= yes + +.include diff --git a/devel/p5-Data-ModeMerge/distinfo b/devel/p5-Data-ModeMerge/distinfo new file mode 100644 index 000000000000..5590ddc687c0 --- /dev/null +++ b/devel/p5-Data-ModeMerge/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1724084446 +SHA256 (Data-ModeMerge-0.360.tar.gz) = 1bac4f668a13be28b7b835f84b3543e5b73d963b6fb38b71c735d9079fbe7454 +SIZE (Data-ModeMerge-0.360.tar.gz) = 47971 diff --git a/devel/p5-Data-ModeMerge/pkg-descr b/devel/p5-Data-ModeMerge/pkg-descr new file mode 100644 index 000000000000..726e65ea1c31 --- /dev/null +++ b/devel/p5-Data-ModeMerge/pkg-descr @@ -0,0 +1,20 @@ +There are already several modules on CPAN to do recursive data structure +merging, like Data::Merger and Hash::Merge. Data::ModeMerge differs in that it +offers merging "modes" and "options". It provides greater flexibility on what +the result of a merge between two data should/can be. This module may or may not +be what you need. + +One application of this module is in handling configuration. Often there are +multiple levels of configuration, e.g. in your typical Unix command-line program +there are system-wide config file in /etc, per-user config file under ~/, and +command-line options. It's convenient programatically to load each of those in a +hash and then merge system-wide hash with the per-user hash, and then merge the +result with the command-line hash to get the a single hash as the final +configuration. Your program can from there on deal with this just one hash +instead of three. + +In a typical merging process between two hashes (left-side and right-side), when +there is a conflicting key, then the right-side key will override the left-side. +This is usually the desired behaviour in our said program as the system-wide +config is there to provide defaults, and the per-user config (and the +command-line arguments) allow a user to override those defaults. diff --git a/devel/p5-Data-ModeMerge/pkg-plist b/devel/p5-Data-ModeMerge/pkg-plist new file mode 100644 index 000000000000..62ec00f99fd8 --- /dev/null +++ b/devel/p5-Data-ModeMerge/pkg-plist @@ -0,0 +1,18 @@ +%%SITE_PERL%%/Data/ModeMerge.pm +%%SITE_PERL%%/Data/ModeMerge/Config.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/ADD.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/Base.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/CONCAT.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/DELETE.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/KEEP.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/NORMAL.pm +%%SITE_PERL%%/Data/ModeMerge/Mode/SUBTRACT.pm +%%PERL5_MAN3%%/Data::ModeMerge.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Config.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::ADD.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::Base.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::CONCAT.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::DELETE.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::KEEP.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::NORMAL.3.gz +%%PERL5_MAN3%%/Data::ModeMerge::Mode::SUBTRACT.3.gz