Tuesday, August 11, 2026

Re: Update mail/mutt-wizard to latest upstream commit

David Uhden Collado wrote: > Hello, > > Please find attached a patch that updates the mail/mutt-wizard port > from the v3.3.1 release to the latest upstream commit: > > b4a28b2548e94c167bb74fcb5e8c44c34d2be842 > > Upstream has not published a new tagged release since v3.3.1, so the > port now follows the current upstream commit instead. > > The changes since v3.3.1 can be reviewed at: > > https://github.com/LukeSmithxyz/mutt-wizard/compare/ > v3.3.1...b4a28b2548e94c167bb74fcb5e8c44c34d2be842 > > There have been a number of useful improvements since the last release. > These include support for goimapnotify push notifications, basic Zsh > completion, improved XDG directory handling, and moving the msmtp log > to XDG_STATE_HOME. > > Mail synchronization and notifications have also received several > fixes. These include more reliable display detection, fixes for > notify-send and multiline subjects, better handling of synchronization > errors, and avoiding mailsync attempts with a locked GPG key in > non-interactive sessions. > > Account configuration has also been improved. Upstream now avoids > prompting for a password when one is already stored, pipes passwords > directly to pass, has more robust mbsync version detection, and fixes > several problems in account setup and command-line option handling. > > There are also improvements to the notmuch integration, including > correct XDG_CACHE_HOME handling and escaping of message IDs, as well as > support for LMDB when available. > > More recent changes improve portability by replacing non-portable > command usage with POSIX-compatible alternatives, allow PREFIX to be > set by the user, fix goimapnotify configuration and directory creation, > and improve general error handling. > > For the OpenBSD port, I also removed the sysutils/ggrep dependency. > The only remaining GNU grep-specific expression used "\S", which is > replaced by the equivalent POSIX "[^[:space:]]" expression, allowing > the base system grep to be used instead. > > I refreshed the existing OpenBSD-specific patches for the new upstream > code while preserving the account switching, account deletion, dynamic > mailbox loading, GPG WKS, pgrep, and sed compatibility adjustments. > > Finally, I updated the package list for the new upstream configuration > templates and Zsh completion file and regenerated distinfo for the > selected commit. > > Thank you for your time and consideration. > > Best regards, > David. Hello, Please find attached a revised version of the mutt-wizard patch I sent previously. Please disregard the previous patch. The main changes in this revision are additional OpenBSD portability fixes for bin/mw. The script now uses /bin/sh instead of /bin/bash. The script does not require Bash-specific functionality, so depending on Bash is unnecessary on OpenBSD. I also removed the PWR signal from the cleanup trap. PWR is not a POSIX signal and is not supported by OpenBSD, while the remaining HUP, INT, QUIT, TERM, and EXIT handlers provide the required cleanup behavior. Thank you, and apologies for the additional revision. Best regards, David.

Index: mail/mutt-wizard/Makefile
===================================================================
RCS file: /cvs/ports/mail/mutt-wizard/Makefile,v
diff -u -p -u -p -r1.10 Makefile
--- mail/mutt-wizard/Makefile	24 Feb 2023 22:14:17 -0000	1.10
+++ mail/mutt-wizard/Makefile	11 Aug 2026 15:13:19 -0000
@@ -3,10 +3,8 @@ CATEGORIES =	mail
 
 GH_ACCOUNT =	LukeSmithxyz
 GH_PROJECT =	mutt-wizard
-GH_TAGNAME =	v3.3.1
-
-EPOCH =		0
-REVISION =	0
+GH_COMMIT =	b4a28b2548e94c167bb74fcb5e8c44c34d2be842
+DISTNAME =      mutt-wizard-3.3.2
 
 MAINTAINER =	Aisha Tammy <aisha@openbsd.org>
 
@@ -16,17 +14,12 @@ PERMIT_PACKAGE =	Yes
 RUN_DEPENDS =	mail/neomutt,gpgme,sasl,notmuch \
 		mail/isync \
 		mail/msmtp \
-		security/password-store \
-		sysutils/ggrep
+		security/password-store
 
 NO_BUILD =	Yes
 NO_TEST =	Yes
 USE_GMAKE =	Yes
 
 FAKE_FLAGS =	PREFIX=${TRUEPREFIX} MANPREFIX=${PREFIX}/man
-
-post-extract:
-	cd ${WRKSRC} && \
-	sed -e "s/\<grep\>/ggrep/g" -i bin/mw
 
 .include <bsd.port.mk>
Index: mail/mutt-wizard/distinfo
===================================================================
RCS file: /cvs/ports/mail/mutt-wizard/distinfo,v
diff -u -p -u -p -r1.8 distinfo
--- mail/mutt-wizard/distinfo	13 May 2022 14:49:56 -0000	1.8
+++ mail/mutt-wizard/distinfo	11 Aug 2026 15:13:19 -0000
@@ -1,2 +1,2 @@
-SHA256 (mutt-wizard-3.3.1.tar.gz) = QJH7oFN4bUFDJJ5h3939Z5wV9WHsNK8X8TCjyoDDm1M=
-SIZE (mutt-wizard-3.3.1.tar.gz) = 34813
+SHA256 (mutt-wizard-3.3.2-b4a28b25.tar.gz) = vzo20h3NU9AazgpH+wlDGKHczZjvmXTAKUEH0TtIRac=
+SIZE (mutt-wizard-3.3.2-b4a28b25.tar.gz) = 37434
Index: mail/mutt-wizard/patches/patch-bin_mailsync
===================================================================
RCS file: /cvs/ports/mail/mutt-wizard/patches/patch-bin_mailsync,v
diff -u -p -u -p -r1.3 patch-bin_mailsync
--- mail/mutt-wizard/patches/patch-bin_mailsync	13 May 2022 14:49:56 -0000	1.3
+++ mail/mutt-wizard/patches/patch-bin_mailsync	11 Aug 2026 15:13:19 -0000
@@ -1,12 +1,16 @@
+$OpenBSD$
+
+OpenBSD pgrep does not support -ax, use -x instead
+
 Index: bin/mailsync
 --- bin/mailsync.orig
 +++ bin/mailsync
-@@ -42,7 +42,7 @@ case "$(uname)" in
- 			*systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
- 		esac
- 		# remember if a display server is running since `ps` doesn't always contain a display
--		pgrepoutput="$(pgrep -a X\(org\|wayland\))"
-+		pgrepoutput="$(pgrep X\(org\|wayland\))"
- 		displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)"
- 		notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do
- 				export DISPLAY=$x
+@@ -42,7 +42,7 @@
+ 		*systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
+ 	esac
+ 	# remember if a display server is running since `ps` doesn't always contain a display
+-	pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))"
++	pgrepoutput="$(pgrep X\(\|org\|wayland\))"
+ 	displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)"
+ 	[ -z "$displays" ] && [ -d /tmp/.X11-unix ] && displays=$(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done)
+ 
Index: mail/mutt-wizard/patches/patch-bin_mw
===================================================================
RCS file: /cvs/ports/mail/mutt-wizard/patches/patch-bin_mw,v
diff -u -p -u -p -r1.2 patch-bin_mw
--- mail/mutt-wizard/patches/patch-bin_mw	11 Mar 2022 19:34:43 -0000	1.2
+++ mail/mutt-wizard/patches/patch-bin_mw	11 Aug 2026 15:13:19 -0000
@@ -1,31 +1,67 @@
+$OpenBSD$
+
 fix account number switch macro
 fix account deletion
 publish gpg using gpg-wks protocol
 dynamically load mailboxes
+replace GNU grep \S with POSIX [^[:space:]]
+use /bin/sh instead of /bin/bash, remove non-POSIX PWR signal
 
 Index: bin/mw
 --- bin/mw.orig
 +++ bin/mw
-@@ -173,7 +173,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # New mw muttwizard
+ # Please see README and LICENSE
+@@ -64,7 +64,7 @@
+ 	}
+ }
+ 
+-getaccounts() { accounts="$(find -L "$accdir" -type f 2>/dev/null | grep -o "\S*.muttrc" | sed "s|.*/\([0-9]-\)*||;s/\.muttrc$//" | nl)"; }
++getaccounts() { accounts="$(find -L "$accdir" -type f 2>/dev/null | grep -o "[^[:space:]]*.muttrc" | sed "s|.*/\([0-9]-\)*||;s/\.muttrc$//" | nl)"; }
  
- 	sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" 2>/dev/null ; rm -f "$mbsyncrc"bu
- 	rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/$fulladdr.muttrc"  "$accdir/"[0-9]-"$fulladdr.muttrc"
--	sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm -f "$muttrc"bu
-+	sed -ibu "/macro.*i[0-9].*$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm -f "$muttrc"bu
- 	sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null; rm -f "$msmtprc"bu
- 	sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null; rm -f "$mpoprc"bu
- 	pass rm -f "$fulladdr" >/dev/null 2>&1
-@@ -224,11 +224,11 @@ getboxes() { if [ -n "${force+x}" ] ; then
- 		mailboxes="$(echo "$info" | ggrep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')"
+ list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" || exit 1; }
+ 
+@@ -152,7 +152,7 @@
+ 	sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" 2>/dev/null
+ 	rm -f "$mbsyncrc"bu
+ 	rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/$fulladdr.muttrc" "$accdir/"[0-9]-"$fulladdr.muttrc"
+-	sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null
++	sed -ibu "/macro.*i[0-9].*$fulladdr.muttrc/d" "$muttrc" 2>/dev/null
+ 	rm -f "$muttrc"bu
+ 	sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null
+ 	rm -f "$msmtprc"bu
+@@ -225,14 +225,11 @@
+ 		mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')"
  	fi
  	[ "$type" = "pop" ] && mailboxes="INBOX"
--	for x in $(sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " "$muttrc" | sort -u; echo 0); do
-+	for x in $(ggrep -Eo "^macro.* i[0-9] " "$muttrc" | sed "s/^macro.* i//g" | sort -u; echo 0); do
+-	for x in $(
+-		sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " "$muttrc" 2>/dev/null | sort -u
+-		echo 0
+-	); do
++	for x in $(grep -Eo "^macro.* i[0-9] " "$muttrc" | sed "s/^macro.* i//g" | sort -u; echo 0); do
  		idnum=$((idnum + 1))
  		[ "$idnum" -eq "$x" ] || break
  	done
--	toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' - )"
+-	toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/;s/'/\\\'/g" | paste -sd ' ' -)"
 +	toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 -type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr '\\\n' ' '\`"
  }
- 
- finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc"
+
++@@ -313,7 +310,7 @@
++ 	tempfile="$(mktemp -u)"
++-	trap 'rm -f $tempfile' HUP INT QUIT TERM PWR EXIT
+++	trap 'rm -f $tempfile' HUP INT QUIT TERM EXIT
++
+ finalize() {
+@@ -318,7 +315,7 @@
+ 	/ i[0-9] / s?\(.* i\|'<sync.*/\|\.muttrc.*\)??g p
+ 	" "$muttrc" >>"$tempfile"
+ 	${EDITOR:-vim} "$tempfile" || exit 1
+-	sed -i -e 's/#.*//' -e '/^$/d' "$tempfile"
++	sed -i '' -e 's/#.*//' -e '/^$/d' "$tempfile"
+ 	default="$(sort -n "$tempfile" | head -n 1)"
+ 	default="${default#* }"
+ 	sed -ibu "
Index: mail/mutt-wizard/patches/patch-share_mutt-wizard_muttrc
===================================================================
RCS file: /cvs/ports/mail/mutt-wizard/patches/patch-share_mutt-wizard_muttrc,v
diff -u -p -u -p -r1.1 patch-share_mutt-wizard_muttrc
--- mail/mutt-wizard/patches/patch-share_mutt-wizard_muttrc	13 May 2022 14:49:56 -0000	1.1
+++ mail/mutt-wizard/patches/patch-share_mutt-wizard_muttrc	11 Aug 2026 15:13:19 -0000
@@ -1,9 +1,11 @@
+$OpenBSD$
+
 add ctrl-l for open, as default ctrl-o is set to discard in shell
 
 Index: share/mutt-wizard.muttrc
 --- share/mutt-wizard.muttrc.orig
 +++ share/mutt-wizard.muttrc
-@@ -109,6 +109,7 @@ set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?'
+@@ -114,6 +114,7 @@
  bind index,pager \Ck sidebar-prev
  bind index,pager \Cj sidebar-next
  bind index,pager \Co sidebar-open

No comments:

Post a Comment