Forráskód Böngészése

dpkg-statoverride: Make --quiet actually do something

Quiesce most of the inoquous warning messages.

Closes: #403211
Guillem Jover 16 éve
szülő
commit
b2361bd918
2 módosított fájl, 7 hozzáadás és 4 törlés
  1. 2 0
      debian/changelog
  2. 5 4
      src/statcmd.c

+ 2 - 0
debian/changelog

@@ -15,6 +15,8 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     and the alternative it's pointing to. Closes: #549167
   * Refer to “half configured” instead of “failed config” in «dpkg-query -l»
     header and dselect package status printing for consistency.
+  * Make “dpkg-statoverride --quiet” actually do something, and quiesce
+    most of the inoquous warning messages. Closes: #403211
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).

+ 5 - 4
src/statcmd.c

@@ -123,7 +123,7 @@ path_cleanup(const char *path)
 	char *new_path = m_strdup(path);
 
 	path_rtrim_slash_slashdot(new_path);
-	if (strcmp(path, new_path) != 0)
+	if (opt_verbose && strcmp(path, new_path) != 0)
 		warning(_("stripping trailing /"));
 
 	return new_path;
@@ -281,7 +281,7 @@ statoverride_add(const char *const *argv)
 	if (opt_update) {
 		if (access(filename, F_OK) == 0)
 			statdb_node_apply(filename, *filestat);
-		else
+		else if (opt_verbose)
 			warning(_("--update given but %s does not exist"),
 			        filename);
 	}
@@ -305,14 +305,15 @@ statoverride_remove(const char *const *argv)
 	filename = path_cleanup(path);
 
 	if (!statdb_node_remove(filename)) {
-		warning(_("No override present."));
+		if (opt_verbose)
+			warning(_("No override present."));
 		if (opt_force)
 			exit(0);
 		else
 			exit(2);
 	}
 
-	if (opt_update)
+	if (opt_update && opt_verbose)
 		warning(_("--update is useless for --remove"));
 
 	statdb_write();