Update 2024-12-25 14:31 OpenBSD/amd64-t14
This commit is contained in:
@@ -211,20 +211,16 @@ unalternative_order *
|
||||
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/apply_patch.sh /tmp/muttpatch.diff<enter>"
|
||||
macro index L '| git am'\n
|
||||
|
||||
|
||||
# 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>"
|
||||
# apply inline patch
|
||||
macro index,pager,attach \cs "| ~/.mutt/scripts/patch.sh patch<enter>"
|
||||
macro index,pager,attach \ca "| ~/.mutt/scripts/patch.sh git<enter>"
|
||||
|
||||
# pipe-message
|
||||
set pipe_decode_weed = no
|
||||
set pipe_decode = yes # when piping via pipe-message command, strip headers and decode
|
||||
set pipe_split = yes # if several msgs are tagged, do the pipe-message command for each
|
||||
set prompt_after = no # promt if external pager exits
|
||||
set wait_key = no # wait for a key-press after performing shell/external commands
|
||||
set wait_key = yes # wait for a key-press after performing shell/external commands
|
||||
set beep_new = no # beep if new message arrives
|
||||
set check_new = no # check for new mails, while the mailbox is open
|
||||
set auto_tag = yes # function will applied to all tagged messages in the index
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
strip=0
|
||||
|
||||
clear
|
||||
printf '\n---------------------------------------------------------------------\n'
|
||||
egrep '^Index|^RCS|^diff --git|^file +' "$1" | sed 's,/cvs,/usr,g'
|
||||
printf '---------------------------------------------------------------------\n\n'
|
||||
|
||||
printf "Path for patch [/usr/ports]? "
|
||||
read _path
|
||||
|
||||
[ -z "$_path" ] && _path=/usr/ports
|
||||
egrep -q '^diff --git a/' "$1" && strip=1
|
||||
|
||||
#print "Trying to apply patch"
|
||||
#qprint -d "$1" "$1.out"
|
||||
|
||||
doas patch -Ep"$strip" -d $_path < "$1"
|
||||
cd $_path && ksh
|
||||
62
.mutt/scripts/patch.sh
Executable file
62
.mutt/scripts/patch.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/ksh -e
|
||||
# needs converters/qprint
|
||||
|
||||
if [ -t 0 ] || [ -z "$1" ]
|
||||
then
|
||||
echo "usage: patch.sh [git|patch] < patchfile.diff"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Shortcuts:"
|
||||
echo "ld - luakit-dev"
|
||||
echo "lt - luakit-test"
|
||||
echo "ltmp - luakit-tmp"
|
||||
echo "src - /usr/src"
|
||||
echo "sys - /usr/src/sys"
|
||||
echo "ports - /usr/ports"
|
||||
echo "www - /usr/www"
|
||||
echo
|
||||
printf "Path [$PWD]: "
|
||||
read _path < /dev/tty
|
||||
|
||||
# shortcuts!!!
|
||||
case "$_path" in
|
||||
ld) _path="/home/sdk/src/luakit-dev" ;;
|
||||
lt) _path="/home/sdk/src/luakit-test" ;;
|
||||
ltmp) _path="/home/sdk/src/luakit-tmp" ;;
|
||||
src) _path="/usr/src" ;;
|
||||
sys) _path="/usr/src/sys" ;;
|
||||
ports) _path="/usr/ports" ;;
|
||||
esac
|
||||
|
||||
if [ ! -d "$_path" ]
|
||||
then
|
||||
_path="$(port-jump $_path)"
|
||||
fi
|
||||
|
||||
_path=${_path:=$PWD}
|
||||
print "Using: $_path"
|
||||
|
||||
if [ ! -d "$_path" ]
|
||||
then
|
||||
echo "Error with path: $_path"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
cd "$_path"
|
||||
if [ "$1" == "git" ]
|
||||
then
|
||||
cat /dev/stdin | git am
|
||||
fi
|
||||
|
||||
if [ "$1" == "patch" ]
|
||||
then
|
||||
printf "Strip [0]: "
|
||||
read _strip < /dev/tty
|
||||
_strip=${_strip:=0}
|
||||
|
||||
cat /dev/stdin | doas -u sdk patch -E -N -p$_strip -d "$_path"
|
||||
fi
|
||||
|
||||
echo "$_path" | xclip
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/ksh -e
|
||||
|
||||
# needs converters/qprint
|
||||
# mutt: macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/portpatch2.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 -i -E -N -p${_strip:=0} -d ${_path}
|
||||
echo ${_path} | xclip
|
||||
echo "done.
|
||||
read
|
||||
Reference in New Issue
Block a user