[pacman-dev] [PATCH 1/3] makepkg: send messages to stdout rather than stderr

Eli Schwartz eschwartz at archlinux.org
Thu Jun 28 17:19:41 UTC 2018


This behavior is confusing, since it means absolutely everything goes to
stderr and makepkg itself is a quiet program that produces no expected
output???

The only situation where messages should go to stderr rather than
stdout, is with --geninteg which is meant to return the checksums on
stdout (but we don't want to totally get rid of status messages when
redirecting the results elsewhere, or, worse, redirect status messages
to a PKGBUILD). For this specific case, redirect message output to
stderr in the --geninteg callers directly.

Implements FS#17173

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---

It took us 9 years, but we got there...

 scripts/libmakepkg/integrity/generate_checksum.sh.in | 2 +-
 scripts/libmakepkg/util/message.sh.in                | 6 +++---
 scripts/makepkg.sh.in                                | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/libmakepkg/integrity/generate_checksum.sh.in b/scripts/libmakepkg/integrity/generate_checksum.sh.in
index eb9b74fc..8edc48d3 100644
--- a/scripts/libmakepkg/integrity/generate_checksum.sh.in
+++ b/scripts/libmakepkg/integrity/generate_checksum.sh.in
@@ -78,7 +78,7 @@ generate_one_checksum() {
 }
 
 generate_checksums() {
-	msg "$(gettext "Generating checksums for source files...")"
+	msg "$(gettext "Generating checksums for source files...")" >&2
 
 	local integlist
 	if (( $# == 0 )); then
diff --git a/scripts/libmakepkg/util/message.sh.in b/scripts/libmakepkg/util/message.sh.in
index 0746b677..36790c26 100644
--- a/scripts/libmakepkg/util/message.sh.in
+++ b/scripts/libmakepkg/util/message.sh.in
@@ -45,17 +45,17 @@ colorize() {
 
 plain() {
 	local mesg=$1; shift
-	printf "${BOLD}    ${mesg}${ALL_OFF}\n" "$@" >&2
+	printf "${BOLD}    ${mesg}${ALL_OFF}\n" "$@"
 }
 
 msg() {
 	local mesg=$1; shift
-	printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
+	printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
 }
 
 msg2() {
 	local mesg=$1; shift
-	printf "${BLUE}  ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
+	printf "${BLUE}  ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
 }
 
 warning() {
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 32423262..650b8494 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1469,7 +1469,7 @@ if (( GENINTEG )); then
 	mkdir -p "$srcdir"
 	chmod a-s "$srcdir"
 	cd_safe "$srcdir"
-	download_sources novcs allarch
+	download_sources novcs allarch >&2
 	generate_checksums
 	exit $E_OK
 fi
-- 
2.18.0


More information about the pacman-dev mailing list