Update 2024-12-22 09:05 OpenBSD/amd64-t14
This commit is contained in:
@@ -212,7 +212,7 @@ alternative_order text/plain text/enriched text/html
|
||||
auto_view text/html text/enriched text/calendar
|
||||
|
||||
# Preview HTML
|
||||
macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/portpatch2.sh /tmp/muttpatch.diff<enter>"
|
||||
macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/apply_patch.sh /tmp/muttpatch.diff<enter>"
|
||||
|
||||
# Save Patch
|
||||
#macro pager \cs "<shell-escape>rm -f /tmp/mutt-patch.diff<enter><copy-message>/tmp/mutt-patch.diff<enter><enter-command>echo 'Saved as /tmp/mutt-patch.diff'<enter><shell-escape>~/.mutt/scripts/portpatch.sh /tmp/mutt-patch.diff<enter>"
|
||||
|
||||
35
.mutt/scripts/apply_patch.sh
Executable file
35
.mutt/scripts/apply_patch.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/ksh -e
|
||||
|
||||
# needs converters/qprint
|
||||
# mutt: macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/apply_patch.sh /tmp/muttpatch.diff<enter>"
|
||||
|
||||
clear
|
||||
|
||||
printf '\n---------------------------------------------------------------------\n'
|
||||
grep -E 'Subject: |^Index|^RCS|^diff --git|^file +|^[-+]{3} ' "${1}"
|
||||
printf '---------------------------------------------------------------------\n\n'
|
||||
|
||||
printf "Base path for the patch?\n"
|
||||
printf "Example: /usr/ports or /usr/src\n"
|
||||
printf ": "
|
||||
read -r _path
|
||||
cd $_path
|
||||
|
||||
print "Using: $_path"
|
||||
|
||||
printf "Fix quoted-printable mangeled patch? [y/N]: "
|
||||
read -r _qprint
|
||||
|
||||
case ${_qprint} in
|
||||
[y|Y]) _catcmd="qprint -d"; ;;
|
||||
*) _catcmd="cat"; ;;
|
||||
esac
|
||||
|
||||
printf "Strip? [0]: "
|
||||
read -r _strip
|
||||
|
||||
echo "CMD: ${_catcmd} "${1}" | doas -u sdk patch -E -pp${_strip:=0} -d ${_path}"
|
||||
${_catcmd} "${1}" | doas -u sdk patch -E -N -p${_strip:=0} -d ${_path}
|
||||
echo ${_path} | xclip
|
||||
echo "done."
|
||||
read
|
||||
Reference in New Issue
Block a user