diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 6a22f4620..9a8e0fdec 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2021 Franco Fichtner +# Copyright (c) 2016-2022 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -121,18 +121,22 @@ ensure-stable: git config branch.stable/${PLUGIN_ABI}.remote origin; \ fi +diff_ARGS?= . + diff: ensure-stable @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${diff_ARGS:[1]} +mfc_ARGS?= . + mfc: ensure-stable .for MFC in ${mfc_ARGS} .if exists(${MFC}) @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${MFC} > /tmp/mfc.diff @git checkout stable/${PLUGIN_ABI} @git apply /tmp/mfc.diff - @git add ${.CURDIR} + @git add ${.CURDIR}/${MFC} @if ! git diff --quiet HEAD; then \ - git commit -m "${MFC}: sync with master"; \ + git commit -m "${MFC:S/^.$/${PLUGIN_DIR}/}: sync with master"; \ fi .else @git checkout stable/${PLUGIN_ABI} diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 9c3f4d547..9925f2bd8 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -80,6 +80,10 @@ PLUGIN_CONFLICTS+= ${${_PLUGIN_VARIANT}_NAME} PLUGIN_DEPENDS+= ${${PLUGIN_VARIANT}_DEPENDS} .endif +.if !empty(PLUGIN_NAME) +PLUGIN_DIR?= ${.CURDIR:S/\// /g:[-2]}/${.CURDIR:S/\// /g:[-1]} +.endif + PLUGIN_PKGNAMES= ${PLUGIN_PREFIX}${PLUGIN_NAME}${PLUGIN_SUFFIX} \ ${PLUGIN_PREFIX}${PLUGIN_NAME} .for CONFLICT in ${PLUGIN_CONFLICTS}