This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Messages about overriding content and/or version URLs on STDOUT spoil JSON output #1620
Copy link
Copy link
Open
Description
If we override the content or version URLs using -u, -c, or -v, we print out a message on STDOUT warning about it:
swupd-client/src/swupd_lib/globals.c
Lines 553 to 572 in ec4a272
| case 'u': | |
| print("Overriding version and content URLs with %s\n", optarg); | |
| set_version_url(optarg); | |
| set_content_url(optarg); | |
| return true; | |
| case 'P': | |
| err = str_to_int(optarg, &globals.update_server_port); | |
| if (err < 0 || globals.update_server_port < 0) { | |
| error("Invalid --port argument: %s\n\n", optarg); | |
| return false; | |
| } | |
| return true; | |
| case 'c': | |
| print("Overriding content URL with %s\n", optarg); | |
| set_content_url(optarg); | |
| return true; | |
| case 'v': | |
| print("Overriding version URL with %s\n", optarg); | |
| set_version_url(optarg); | |
| return true; |
In most cases, this is probably fine. But if we've been given -j for JSON output, we really should only be outputting valid JSON strings. We should probably move these (and any other) warnings to STDERR.
This will likely affect test cases, too.
NextGenOP
Metadata
Metadata
Assignees
Labels
No labels