mirror of
https://github.com/opnsense/tools.git
synced 2026-12-04 01:18:19 +00:00
make: add a "review" target which shows all recipe modifications
We need this for review and patch notes. This intentionally only works after "makedist" so we know the modification feed is complete and applies cleanly.
This commit is contained in:
1 parent
fcf17cb923
commit
25d8c66813
3 files changed
+74
-5
No files matched your search
@@ -28,8 +28,8 @@ STEPS= audit arm base boot chroot clean clone compress confirm \
|
||||
connect core distfiles download dvd fingerprint info \
|
||||
kernel list make.conf makedist nano obsolete options \
|
||||
packages pkgbase plugins ports prefetch print rebase \
|
||||
release rename serial sign skim sync test tests update \
|
||||
upload verify vga vm xtools
|
||||
release rename review serial sign skim sync test tests \
|
||||
update upload verify vga vm xtools
|
||||
SCRIPTS= custom distribution hotfix nightly patch pkgver source watch
|
||||
|
||||
.PHONY: ${STEPS} ${SCRIPTS}
|
||||
|
||||
+3
-3
@@ -249,10 +249,10 @@ if [ -n "${*}" ]; then
|
||||
fi
|
||||
|
||||
case "${SELF}" in
|
||||
base|core|kernel|makedist|packages|pkgbase|plugins|ports)
|
||||
ease|core|kernel|makedist|packages|pkgbase|plugins|ports|review)
|
||||
# explicit support
|
||||
;;
|
||||
clean|info|make.conf|print|rename)
|
||||
clean|info|make\.conf|print|rename)
|
||||
# implicit support
|
||||
;;
|
||||
*)
|
||||
@@ -518,7 +518,7 @@ git_recipe()
|
||||
|
||||
for MOD in ${GITMOD}; do
|
||||
if [ -f ${RECIPEDIR}/${MOD} ]; then
|
||||
cat ${RECIPEDIR}/${MOD} >> ${BASEDIR}/mbox
|
||||
cat ${RECIPEDIR}/${MOD} >> ${BASEDIR}/mbox
|
||||
else
|
||||
git -C ${BASEDIR}${GITDIR} format-patch -1 \
|
||||
--stdout ${MOD} >> ${BASEDIR}/mbox
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2026 Franco Fichtner <franco@opnsense.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
set -e
|
||||
|
||||
SELF=review
|
||||
|
||||
. ./common.sh
|
||||
|
||||
if [ -z "${RECIPE}" ]; then
|
||||
echo ">>> Need a RECIPE to continue" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
verify_recipe
|
||||
|
||||
DIFF="$(which delta 2> /dev/null || echo cat)"
|
||||
LESS=$(echo less -R -p "$(printf '\013')^From.[0-9a-f]{40}.*")
|
||||
|
||||
if [ "${DIFF}" != "cat" ]; then
|
||||
# package name is "git-delta"
|
||||
DIFF="${DIFF} --color-only --pager=never --syntax-theme=none"
|
||||
fi
|
||||
|
||||
mbox_out()
|
||||
{
|
||||
if [ -f ${RECIPEDIR}/${1} ]; then
|
||||
cat ${RECIPEDIR}/${1}
|
||||
else
|
||||
git -C ${2} --no-pager \
|
||||
format-patch -1 --stdout ${1}
|
||||
fi
|
||||
}
|
||||
|
||||
(
|
||||
for MOD in ${PORTSMOD}; do
|
||||
mbox_out ${MOD} ${PORTSDIR}
|
||||
done
|
||||
for MOD in ${PLUGINSMOD}; do
|
||||
mbox_out ${MOD} ${PLUGINSDIR}
|
||||
done
|
||||
for MOD in ${COREMOD}; do
|
||||
mbox_out ${MOD} ${COREDIR};
|
||||
done
|
||||
) | ${DIFF} | ${LESS}
|
||||
Reference in new issue
Block a user