Explorar el Código

Print the bogus version and prefix the error message with 'dpkg: '
when using '--compare-versions'. Closes: #369177

Guillem Jover hace 20 años
padre
commit
7e223c5f0c
Se han modificado 3 ficheros con 11 adiciones y 2 borrados
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 4 2
      src/enquiry.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2006-05-31  Guillem Jover  <guillem@debian.org>
+
+	* src/enquiry.c (cmpversions): Prefix the bad syntax error with a
+	'dpkg: ' and print the bogus version string.
+
 2006-05-25  Guillem Jover  <guillem@debian.org>
 
 	* scripts/install-info.pl: Exit if the lock file already exists.

+ 2 - 0
debian/changelog

@@ -66,6 +66,8 @@ dpkg (1.13.20~) UNRELEASED; urgency=low
     Based on patch by Ben Pfaff. Closes: #368874
   * Correct default info directory for '--infodir' in intall-info man
     page (Ben Pfaff). Closes: #368875
+  * Print the bogus version and prefix the error message with 'dpkg: '
+    when using '--compare-versions'. Closes: #369177
 
   [ Updated dpkg Translations ]
   * Portuguese (Miguel Figueiredo).

+ 4 - 2
src/enquiry.c

@@ -426,7 +426,8 @@ void cmpversions(const char *const *argv) {
   if (*argv[0] && strcmp(argv[0],"<unknown>")) {
     emsg= parseversion(&a,argv[0]);
     if (emsg) {
-      if (printf(_("version a has bad syntax: %s\n"),emsg) == EOF) werr("stdout");
+      if (printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[0], emsg) == EOF)
+        werr("stdout");
       if (fflush(stdout)) werr("stdout");
       exit(1);
     }
@@ -436,7 +437,8 @@ void cmpversions(const char *const *argv) {
   if (*argv[2] && strcmp(argv[2],"<unknown>")) {
     emsg= parseversion(&b,argv[2]);
     if (emsg) {
-      if (printf(_("version b has bad syntax: %s\n"),emsg) == EOF) werr("stdout");
+      if (printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[2], emsg) == EOF)
+        werr("stdout");
       if (fflush(stdout)) werr("stdout");
       exit(1);
     }