This utilizes the 'scissors' feature as described here

https://git-scm.com/docs/git-mailinfo#Documentation/git-mailinfo.txt---scissors

and allows easy handling of AUH emails with tools like b4, patchwork or
even 'git am' directly, eliminating the need to get the attachment first.

Signed-off-by: Alexander Kanavin <a...@linutronix.de>
---
 upgrade-helper.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/upgrade-helper.py b/upgrade-helper.py
index 4393589..4f0b6b7 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -358,6 +358,10 @@ class Updater(object):
             attachment_fullpath = os.path.join(pkg_ctx['workdir'], attachment)
             if os.path.isfile(attachment_fullpath):
                 attachments.append(attachment_fullpath)
+                # Also add the patch inline using the 'scissors':
+                # 
https://git-scm.com/docs/git-mailinfo#Documentation/git-mailinfo.txt---scissors
+                if attachment_fullpath.endswith('.patch'):
+                    msg_body += "\n\n-- >8 --\n%s" % 
(open(attachment_fullpath).read())
 
         if self.opts['send_email']:
             self.email_handler.send_email(to_addr, subject, msg_body, 
attachments, cc_addr=cc_addr)
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#60252): https://lists.yoctoproject.org/g/yocto/message/60252
Mute This Topic: https://lists.yoctoproject.org/mt/99479963/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to