From nobody Sun Oct 10 17:47:46 2021 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 10B2417E4C5F; Sun, 10 Oct 2021 17:47:47 +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 4HS8XL70Mmz3j9b; Sun, 10 Oct 2021 17:47:46 +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 D02EB11EF2; Sun, 10 Oct 2021 17:47:46 +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 19AHlk9O070761; Sun, 10 Oct 2021 17:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AHlkNY070760; Sun, 10 Oct 2021 17:47:46 GMT (envelope-from git) Date: Sun, 10 Oct 2021 17:47:46 GMT Message-Id: <202110101747.19AHlkNY070760@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 6f5d234138dc - main - framework: new USES trigger 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: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f5d234138dcb857baea070853fbc9a7736f408b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/ports/commit/?id=6f5d234138dcb857baea070853fbc9a7736f408b commit 6f5d234138dcb857baea070853fbc9a7736f408b Author: Baptiste Daroussin AuthorDate: 2021-09-14 15:24:59 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-10 17:43:02 +0000 framework: new USES trigger Triggers are a new feature from pkg 1.17 (stable in 1.17.2) they are script that are executed at the end of a transaction if anything triggered them. To trigger them a files should have been installed in a location which matches predefined pattern (glob, regexp, or exact matching) When a package is installed in a cross root installation for example: pkg -r XXX install something and if it triggers a trigger, then the execution will be deferred. The pkg trigger command will execute the deferred triggers Reviewed by: tcberner Differential Revision: https://reviews.freebsd.org/D31960 --- Mk/Uses/gnome.mk | 25 ------------------------- Mk/Uses/trigger.mk | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Mk/Uses/gnome.mk b/Mk/Uses/gnome.mk index 66d7f4d0169c..b53cc71590e5 100644 --- a/Mk/Uses/gnome.mk +++ b/Mk/Uses/gnome.mk @@ -46,12 +46,6 @@ # file and add apropriate @postexec/@postunexec directives for # each .omf file found to track OMF registration database. # -# INSTALLS_ICONS - If a GTK+ port installs Freedesktop-style icons to -# ${LOCALBASE}/share/icons, then you should use this -# macro. Using this macro ensures that icons are cached -# and will display correctly. This macro isn't needed -# for QT based applications, which use a different method. -# # MAINTAINER: gnome@FreeBSD.org .if !defined(_INCLUDE_USES_GNOME_MK) @@ -458,24 +452,5 @@ gnome-post-omf: done .endif -.if defined(INSTALLS_ICONS) -_USES_install+= 690:gnome-post-icons -gnome-post-icons: - @${RM} ${TMPPLIST}.icons1 - @for i in `${GREP} "^share/icons/.*/" ${TMPPLIST} | ${CUT} -d / -f 1-3 | ${SORT} -u`; do \ - ${ECHO_CMD} "@rmtry $${i}/icon-theme.cache" \ - >> ${TMPPLIST}.icons1; \ - ${ECHO_CMD} "@postexec ${LOCALBASE}/bin/gtk-update-icon-cache -q -f %D/$${i} 2>/dev/null || /usr/bin/true" \ - >> ${TMPPLIST}; \ - ${ECHO_CMD} "@postunexec ${LOCALBASE}/bin/gtk-update-icon-cache -q -f %D/$${i} 2>/dev/null || /usr/bin/true" \ - >> ${TMPPLIST}; \ - done - @if test -f ${TMPPLIST}.icons1; then \ - ${CAT} ${TMPPLIST}.icons1 ${TMPPLIST} > ${TMPPLIST}.icons2; \ - ${RM} ${TMPPLIST}.icons1; \ - ${MV} -f ${TMPPLIST}.icons2 ${TMPPLIST}; \ - fi -.endif - .endif # End of use part. diff --git a/Mk/Uses/trigger.mk b/Mk/Uses/trigger.mk new file mode 100644 index 000000000000..bf15e9512a84 --- /dev/null +++ b/Mk/Uses/trigger.mk @@ -0,0 +1,29 @@ +# Feature: trigger +# Usage: USES=trigger +# Valid ARGS: none +# +# Variables: +# TRIGGERS: list of triggers to package +# +# MAINTAINER= portmgr@FreeBSD.org + +.if !defined(_INCLUDE_USES_TRIGGER_MK) +_INCLUDE_USES_TRIGGER_MK= yes + +.if !empty(trigger_ARGS) +IGNORE= Incorrect 'USES+= trigger:${trigger_ARGS}' trigger takes no arguments +.endif + +TRIGGERS?= ${PORTNAME} +.for t in ${TRIGGERS} +SUB_FILES+= ${t}.ucl +PLIST_FILES+= ${LOCALBASE}/share/pkg/triggers/$t.ucl +.endfor + +_USES_install+= 601:trigger-post-install +trigger-post-install: + ${MKDIR} ${STAGEDIR}${LOCALBASE}/share/pkg/triggers +.for t in ${TRIGGERS} + ${INSTALL_DATA} ${WRKDIR}/$t.ucl ${STAGEDIR}${LOCALBASE}/share/pkg/triggers/ +.endfor +.endif