From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id iPONBUTNqmBvLAAAsNZ9tg (envelope-from ); Sun, 23 May 2021 21:46:44 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CIQ3LT/NqmCyNAAAbx9fmQ (envelope-from ); Sun, 23 May 2021 21:46:39 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1621806399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=abyJxEh7xqUwC70OKdKdUOXWZvehjICas30pAxo8I3k=; b=m2Z26QEMudVg+Hd0ruJ56Cs+GKVrcXljK3nZmwQFwM7qqqR5t7OF1WynOScz5ot6CYurZb cgXJw0Qb7HhzD9OY9P0fRLxuvxUdqQLJglCZxmdlw0uqN2NicKQ41VjdNuHM+8aH0nk3pE ZxUlS82n8dfZK+NOojzZmSZSlgV0BheBX2JXjm3PE5tQNA7ZBR5DXsbnEGL48GqndvzIA6 FCeTL/5ZgBHrzM5MCMdplogZtZK30vwJoYLKq/1WvG3lRi8Msyeo9oUoxhs3XBSxuJ9+X0 PCpF4dHYMPpOqaFIF76Pjyy1L3XryQizN68ZZ0Pj1WdKgOvMVgYnKHnH2JcyfA== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 3/5] piem-gunzip-buffer: Check for gunzip executable Date: Sun, 23 May 2021 17:46:21 -0400 Message-Id: <20210523214623.31331-4-kyle@kyleam.com> In-Reply-To: <20210523214623.31331-1-kyle@kyleam.com> References: <20210523214623.31331-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: nfN+r5c2C9Bb Make piem-gunzip-buffer handle the executable check so that callers don't have to worry about it. --- piem-b4.el | 1 - piem.el | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/piem-b4.el b/piem-b4.el index 92ddea8..e76953e 100644 --- a/piem-b4.el +++ b/piem-b4.el @@ -73,7 +73,6 @@ (defun piem-b4--get-am-files (mid coderepo args) ;; back to b4's configuration. (unless local-mbox-p (when-let ((url (and (equal mid (piem-mid)) - (piem-check-gunzip) (piem-inbox-get :url)))) (ignore-errors (piem-with-url-contents diff --git a/piem.el b/piem.el index 7b98005..20f2f8b 100644 --- a/piem.el +++ b/piem.el @@ -536,6 +536,8 @@ (defun piem-check-gunzip () piem--has-gunzip) (defun piem-gunzip-buffer () + (unless (piem-check-gunzip) + (user-error "gunzip executable not found")) (goto-char (point-min)) (unless (= 0 (call-process-region nil nil "gunzip" nil t)) (error "Decompressing t.mbox.gz failed")) @@ -630,9 +632,7 @@ (defun piem-inject-thread-into-maildir (mid &optional message-only) (user-error "No directory returned by `piem-inbox-maildir-directory'")) ((not (piem-maildir-dir-is-maildir-p maildir-directory)) (user-error - "Does not look like a Maildir directory: %s" maildir-directory)) - ((not (or message-only (piem-check-gunzip))) - (user-error "gunzip executable not found"))) + "Does not look like a Maildir directory: %s" maildir-directory))) (let ((url (concat (piem-mid-url mid) (if message-only "/raw" "/t.mbox.gz")))) (piem-with-url-contents url -- 2.31.1