Browse Source

fix: suppress ldconfig -p stderr noise on busybox/musl (Illegal option -p)

clanker 1 week ago
parent
commit
ecfef4d5b0
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/lib/ResourceFinder.vala

+ 6 - 3
src/lib/ResourceFinder.vala

@@ -88,7 +88,8 @@ namespace Usm {
 
         private string? locate_lib_ldconfig(ResourceRef resource) {
             try {
-                var proc = new Subprocess.newv(new string[] { "ldconfig", "-p" }, SubprocessFlags.STDOUT_PIPE);
+                var proc = new Subprocess.newv(new string[] { "ldconfig", "-p" },
+                    SubprocessFlags.STDOUT_PIPE | SubprocessFlags.STDERR_SILENCE);
                 var pipe = new DataInputStream(proc.get_stdout_pipe());
                 string line = null;
                 while((line = pipe.read_line()) != null) {
@@ -102,14 +103,16 @@ namespace Usm {
                 proc.wait_check();
             }
             catch(Error e) {
-                warning(@"Error checking for resource $resource: $(e.message)");
+                // busybox/musl ldconfig doesn't support -p; the fallback in
+                // locate_lib handles it — suppress the noise
             }
             return null;
         }
 
         private string? locate_canonlib(ResourceRef resource) {
             try {
-                var proc = new Subprocess.newv(new string[] { "ldconfig", "-p" }, SubprocessFlags.STDOUT_PIPE);
+                var proc = new Subprocess.newv(new string[] { "ldconfig", "-p" },
+                    SubprocessFlags.STDOUT_PIPE | SubprocessFlags.STDERR_SILENCE);
                 var pipe = new DataInputStream(proc.get_stdout_pipe());
                 string line = null;
                 while((line = pipe.read_line()) != null) {