Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] [RFC] xbps-src: add a command `show-diff`
Date: Sun, 12 Jan 2025 23:34:58 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-53950@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages show-diff
https://github.com/void-linux/void-packages/pull/53950

[RFC] 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.


#### Testing the changes
- I tested the changes in this PR: **briefly**


#### Alternatives

One alternative suggested in irc is to use unpatch from

https://leahneukirchen.org/dotfiles/bin/unpatch

Save the original files as .orig, then run

- `unpatch -g -p3 masterdir-*/builddir/pkg-ver`

With vim, one can use `:set patchmode=.orig`


Two more suggestions from irc related to this:

 - `alias xpatch="nvim -c 'set patchmode=.orig'"`

 - `autocmd BufNewFile,BufRead masterdir-*/builddir/* setlocal patchmode=.orig`


A patch file from https://github.com/void-linux/void-packages/pull/53950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-show-diff-53950.patch --]
[-- Type: text/x-diff, Size: 1248 bytes --]

From f912225d0bc665b112a059b193471efdeaa1f7e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
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"

             reply	other threads:[~2025-01-12 22:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-12 22:34 tornaria [this message]
2025-01-15 12:48 ` [RFC] xbps-src: add a command `show-diff` sgn
2025-04-16  2:08 ` github-actions
2025-04-16 13:56 ` tornaria
2025-06-07 19:07 ` [PR PATCH] [Closed]: " tornaria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-53950@inbox.vuxu.org \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).