From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1078315-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 44B3D138334
	for <garchives@archives.gentoo.org>; Tue, 19 Mar 2019 17:11:27 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0B882E0857;
	Tue, 19 Mar 2019 17:11:26 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D5D8DE0857
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2019 17:11:25 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 48861335D06
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2019 17:11:24 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 10E5C503
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2019 17:11:22 +0000 (UTC)
From: "Brian Evans" <grknight@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" <grknight@gentoo.org>
Message-ID: <1553014674.ad73851922df05d91b9be52f41529014c3482113.grknight@gentoo>
Subject: [gentoo-commits] proj/devmanual:master commit in: /
X-VCS-Repository: proj/devmanual
X-VCS-Files: Makefile
X-VCS-Directories: /
X-VCS-Committer: grknight
X-VCS-Committer-Name: Brian Evans
X-VCS-Revision: ad73851922df05d91b9be52f41529014c3482113
X-VCS-Branch: master
Date: Tue, 19 Mar 2019 17:11:22 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 3faf5af8-8d6e-4b38-9394-6adbaf2bc0c2
X-Archives-Hash: dceb6175e813a925100b0cb285412b8d

commit:     ad73851922df05d91b9be52f41529014c3482113
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 16:01:18 2019 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 16:57:54 2019 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=ad738519

Makefile: remove BASH-specific "type -p" and "&>" idioms.

The Makefile uses two "type -p" commands to determine if the "convert"
and "xsltproc" commands are present. The "type" command itself is
defined in POSIX,

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html

but the additional "-p" flag is BASH-specific. This can lead to
unexpected behavior when the /bin/sh symlink that the Makefile uses by
default points to a non-BASH shell:

  $ dash
  $ type -p convert
  -p: not found
  convert is /usr/bin/convert

By chance, this is ultimately not fatal, but does cause the default
target to output some confusing messages. And in fact the output from
the "type -p" command is never used, which means that "type" itself
should suffice, in any shell. Thus this commit drops the two "-p"
arguments to "type".

The same two "type" commands attempt to redirect both stdout and
stderr to /dev/null using the BASH "&>" shortcut. This commit replaces
it with the standard, but more verbose incantation ">/dev/null 2>&1"
that is portable to other shells.

Closes: https://bugs.gentoo.org/680932
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d4182a8..a61128b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,8 @@ image_files := $(shell find -name "*.svg" | sed -e "s/svg$$/png/")
 all: prereq $(text_files) $(image_files)
 
 prereq:
-	@type -p convert &>/dev/null || { echo "media-gfx/imagemagick with corefonts, svg and truetype required" >&2; exit 1; }; \
-		type -p xsltproc &>/dev/null || { echo "dev-libs/libxslt is required" >&2; exit 1; }
+	@type convert >/dev/null 2>&1 || { echo "media-gfx/imagemagick with corefonts, svg and truetype required" >&2; exit 1; }; \
+		type xsltproc >/dev/null 2>&1 || { echo "dev-libs/libxslt is required" >&2; exit 1; }
 
 %.png : %.svg
 	convert $< $@