From f912225d0bc665b112a059b193471efdeaa1f7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 12 Jan 2025 19:10:43 -0300 Subject: [PATCH] xbps-src: add a command `show-diff` Usage: ./xbps-src show-diff PKG Shows differences between the original sources and $wrksrc, in the form of a patch that can be used for the template. Note this ignores new files. --- xbps-src | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xbps-src b/xbps-src index c17270b62ee4b5..63e570dd7b1a00 100755 --- a/xbps-src +++ b/xbps-src @@ -968,6 +968,18 @@ case "$XBPS_TARGET" in fi # The trailing space gets stripped before printing anyway done ;; + show-diff) + read_pkg ignore-problems + mkdir -p "${XBPS_STATEDIR}/show-diff" + cd "${XBPS_STATEDIR}/show-diff" + if [ ! -d clean-wrksrc ]; then + ( . "${XBPS_COMMONDIR}/hooks/do-extract/00-distfiles.sh" + wrksrc="$PWD/clean-wrksrc" hook ) + ln -Ts clean-wrksrc a + ln -Trs "$wrksrc" b + fi + diff -ru a b | grep -v '^Only in b[/:]' + ;; dbulk-dump) read_pkg check_pkg_arch "$XBPS_CROSS_BUILD"