[pacman-dev,v2] Print relevant information about file conflicts or corrupted packages to stderr instead of stdout.

Message ID 20210603091628.12910-1-o.roesler@oscloud.info
State New
Headers show
Series [pacman-dev,v2] Print relevant information about file conflicts or corrupted packages to stderr instead of stdout. | expand

Commit Message

Oskar Roesler \(bionade24\) June 3, 2021, 9:16 a.m. UTC
Now using fprintf() instead of pm_printf() to prevent "ERROR:" prefix,
changes in lib/libalpm/sync.c are removed.
Still wonder why the error message in src/pacman/sync and
lib/libalpm/sync.c are redundant. Could someone please explain it to me?

Signed-off-by: Oskar Roesler (bionade24) <o.roesler@oscloud.info>
---
 src/pacman/sync.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index b6da1a36..6558d4b4 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -836,15 +836,15 @@  int sync_prepare_execute(void)
 					alpm_fileconflict_t *conflict = i->data;
 					switch(conflict->type) {
 						case ALPM_FILECONFLICT_TARGET:
-							printf(_("%s exists in both '%s' and '%s'\n"),
+							fprintf(stderr, _("%s exists in both '%s' and '%s'\n"),
 									conflict->file, conflict->target, conflict->ctarget);
 							break;
 						case ALPM_FILECONFLICT_FILESYSTEM:
 							if(conflict->ctarget[0]) {
-								printf(_("%s: %s exists in filesystem (owned by %s)\n"),
+								fprintf(stderr, _("%s: %s exists in filesystem (owned by %s)\n"),
 										conflict->target, conflict->file, conflict->ctarget);
 							} else {
-								printf(_("%s: %s exists in filesystem\n"),
+								fprintf(stderr, _("%s: %s exists in filesystem\n"),
 										conflict->target, conflict->file);
 							}
 							break;
@@ -857,7 +857,7 @@  int sync_prepare_execute(void)
 			case ALPM_ERR_PKG_INVALID_SIG:
 				for(i = data; i; i = alpm_list_next(i)) {
 					char *filename = i->data;
-					printf(_("%s is invalid or corrupted\n"), filename);
+					fprintf(stderr, _("%s is invalid or corrupted\n"), filename);
 					free(filename);
 				}
 				break;