bin/fixsub: Add little script for hacking Dovecot subscription files.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 25 Apr 2020 20:54:05 +0000 (21:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 25 Apr 2020 20:54:05 +0000 (21:54 +0100)
Makefile
bin/fixsub [new file with mode: 0755]

index 9256ee7..e192950 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -224,6 +224,7 @@ SCRIPTLINKS         += svnwrap
 SCRIPTLINKS            += guest-console
 SCRIPTLINKS            += hyperspec
 SCRIPTLINKS            += datasyms
+SCRIPTLINKS            += fixsub
 SCRIPTLINKS            += check-debsyms
 SCRIPTLINKS            += check-blkdev-size
 
diff --git a/bin/fixsub b/bin/fixsub
new file mode 100755 (executable)
index 0000000..ab76cb1
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh -e
+cd $HOME/mail
+find . \
+  \( -name ".?*" -o \
+     -name bin -o \
+     -name "*~" -o \
+     -name "*.nov" -o \
+     -name "to.split" \) -prune -o \
+  -type f -print \
+  >.subscriptions.tmp
+{ echo INBOX; sort .subscriptions.tmp | sed 's:^./::'; } >.subscriptions.new
+mv .subscriptions.new .subscriptions
+rm -f .subscriptions.tmp