madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

migrate from tempfile to mktemp
authormartin f. krafft <madduck@madduck.net>
Thu, 9 Sep 2021 02:58:38 +0000 (14:58 +1200)
committermartin f. krafft <madduck@madduck.net>
Sun, 12 Sep 2021 23:13:41 +0000 (11:13 +1200)
.mutt/bgrun
.mutt/filter-proxy
.mutt/reuse-message
.mutt/sendmail
.mutt/sendmail-checks.d/ack-recipients
.mutt/sendmail-checks.d/zzz_add-spool-bcc

index c19920f56abc654805308fd1ceae5006f17ad1bb..ad432dfc8b8ea892e86c6b9045adb83de755afb3 100755 (executable)
@@ -83,7 +83,7 @@ guess_extension() {
 get_file() {
   local t
   if [ -z "$1" ]; then
-    t=$(TMPDIR="$PWD" tempfile -s $(guess_extension "$MIMETYPE"))
+    t=$(mktemp -p "$PWD" tmp.XXXXXXXXXX.$(guess_extension "$MIMETYPE"))
     cat > "$t"
     echo "$t"
   else
index a2cf5808260cd7eb9c2b8b0869786725660d26cf..e0b1ad2982edc67e8551609611b07f436410de88 100755 (executable)
@@ -21,7 +21,7 @@ while [ -n "${1:-}" ]; do
   shift
 done
 
-TMPFILE="$(tempfile -p proxy)"
+TMPFILE="$(mktemp --tmpdir proxy.XXXXXXXXXX)"
 trap "rm -f $TMPFILE" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15
 
 eval $cmd <"$file" >$TMPFILE
index 0bdb3f83cb4b1026edec96d0299d3e26c6a66d89..0d8ed2341f5d524c1b1103fc1a7a111186e85819 100755 (executable)
@@ -11,7 +11,7 @@ for i in "$@"; do
   esac
 done
 
-tmpfile=$(tempfile -p reuse)
+tmpfile=$(mktemp --tmpdir reuse.XXXXXXXXXX)
 cleanup() { rm -f "$tmpfile"; trap - 1 2 3 4 5 6 7 8 10 11 12 13 14 15; }
 trap cleanup 1 2 3 4 5 6 7 8 10 11 12 13 14 15
 
index b125941554d8dace86a6ee509e7fc8b439dad253..80fd4a1bba72f221c5fd2a7050297ec5ac00306f 100755 (executable)
 # Copyright © 2010 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
-set -eu
+set -eux
 
 CHECKSDIR="$HOME/.mutt/sendmail-checks.d"
 SENDMAIL="/usr/sbin/sendmail -oem -oi"
 
-TMPFILE=$(tempfile -p mutt-sendmail -s .msg)
+TMPFILE=$(mktemp --tmpdir mutt-sendmail.XXXXXXXXXX.msg)
 settrap () { trap "$@" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15; }
 cleanup () { rm -f "$TMPFILE"; settrap -; }
 settrap cleanup
index d341964f47fcc42d47056e7f89184f4076dad141..749b1d6d0fe9542fdbb9fc081a3efbfbd259f725 100755 (executable)
@@ -43,7 +43,7 @@ done
 [ $ret -eq 0 ] || exit $ret
 
 # now remove the X-Acked header from the mail
-TMPFILE=$(tempfile -p mutt-sendmail -s .msg)
+TMPFILE=$(mktemp --tmpdir mutt-sendmail.XXXXXXXXXX.msg)
 settrap () { trap "$@" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15; }
 cleanup () { rm -f "$TMPFILE"; settrap -; }
 settrap cleanup
index f9f7cbf0fc0c0df791bf3e913b77f31c36dcab99..d0856797102bd8151602d07111d2df5c14351de7 100755 (executable)
@@ -15,7 +15,7 @@ DEST="$SPOOL_MAILDIR/cur/${INPUT##*/}:2,S"
 
 if ! cp -n "$INPUT" "$DEST"; then
   echo >&1 "W: failed to spool message file '$1'."
-  TMPFILE=$(tempfile -p mutt-sendmail -s .msg)
+  TMPFILE=$(mktemp --tmpdir mutt-sendmail.XXXXXXXXXX.msg)
   echo >&1 "W: leaving a copy in '$TMPFILE'…"
 else
   RECIPIENTS=$(for i in "$@"; do echo -n " $i,"; done)