2023-04-26 08:32:14 +02:00
|
|
|
#!/bin/sh -e
|
2022-12-08 13:17:01 +01:00
|
|
|
|
|
|
|
# needs converters/qprint
|
2024-01-02 08:22:26 +01:00
|
|
|
# mutt: macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/portpatch2.sh /tmp/muttpatch.diff<enter>"
|
2022-12-08 13:17:01 +01:00
|
|
|
|
|
|
|
clear
|
2023-04-26 08:32:14 +02:00
|
|
|
|
2022-12-08 13:17:01 +01:00
|
|
|
printf '\n---------------------------------------------------------------------\n'
|
|
|
|
grep -E 'Subject: |^Index|^RCS|^diff --git|^file +|^[-+]{3} ' "${1}"
|
|
|
|
printf '---------------------------------------------------------------------\n\n'
|
|
|
|
|
2023-02-22 08:18:57 +01:00
|
|
|
printf "Apply patch on path? "
|
2022-12-08 13:17:01 +01:00
|
|
|
read -r _path
|
2023-02-22 08:18:57 +01:00
|
|
|
_path=$(dev-dirs $_path)
|
2022-12-08 13:17:01 +01:00
|
|
|
|
2023-04-26 08:32:14 +02:00
|
|
|
print "Using: $_path"
|
|
|
|
|
2022-12-08 13:17:01 +01:00
|
|
|
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
|
|
|
|
|
2023-04-26 08:32:14 +02:00
|
|
|
echo "CMD: ${_catcmd} "${1}" | doas -u sdk patch -E -pp${_strip:=0} -d ${_path}"
|
2023-05-21 14:36:14 +02:00
|
|
|
${_catcmd} "${1}" | doas -u sdk patch -E -N -p${_strip:=0} -d ${_path}
|
2023-08-28 08:12:53 +02:00
|
|
|
echo ${_path} > /var/cache/pmark
|