d06308c
commit 4e207bfdfce434a6484babc14fe86aeadeec5329
d06308c
Author: Panu Matilainen <pmatilai@redhat.com>
d06308c
Date:   Tue Feb 28 10:31:28 2012 +0200
d06308c
d06308c
    Unbreak rpm -V output (RhBug:797964)
d06308c
    
d06308c
    - Commit ac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7 unintentionally
d06308c
      changed the order of the problems shown in verify strings due to
d06308c
      a dumb oversight (greetings to self, duh). In other words, this
d06308c
      fixes a verify output regression in rpm >= 4.9.x by restoring
d06308c
      the long-standing (and documented) order of the verify output chars.
d06308c
    - Also fix the testcase which unfortunately was only added after
d06308c
      the output-changing commit so it didn't catch the breakage either :-/
d06308c
d06308c
diff --git a/lib/verify.c b/lib/verify.c
d06308c
index 35612fe..1edb27f 100644
d06308c
--- a/lib/verify.c
d06308c
+++ b/lib/verify.c
d06308c
@@ -292,14 +292,14 @@ char * rpmVerifyString(uint32_t verifyResult, const char *pad)
d06308c
 {
d06308c
     char *fmt = NULL;
d06308c
     rasprintf(&fmt, "%s%s%s%s%s%s%s%s%s",
d06308c
-		_verifyfile(RPMVERIFY_FILEDIGEST, "5", pad),
d06308c
 		_verify(RPMVERIFY_FILESIZE, "S", pad),
d06308c
-		_verifylink(RPMVERIFY_LINKTO, "L", pad),
d06308c
-		_verify(RPMVERIFY_MTIME, "T", pad),
d06308c
+		_verify(RPMVERIFY_MODE, "M", pad),
d06308c
+		_verifyfile(RPMVERIFY_FILEDIGEST, "5", pad),
d06308c
 		_verify(RPMVERIFY_RDEV, "D", pad),
d06308c
+		_verifylink(RPMVERIFY_LINKTO, "L", pad),
d06308c
 		_verify(RPMVERIFY_USER, "U", pad),
d06308c
 		_verify(RPMVERIFY_GROUP, "G", pad),
d06308c
-		_verify(RPMVERIFY_MODE, "M", pad),
d06308c
+		_verify(RPMVERIFY_MTIME, "T", pad),
d06308c
 		_verify(RPMVERIFY_CAPS, "P", pad));
d06308c
 		
d06308c
     return fmt;
d06308c
diff --git a/tests/rpmverify.at b/tests/rpmverify.at
d06308c
index dd23a4a..77d6bfe 100644
d06308c
--- a/tests/rpmverify.at
d06308c
+++ b/tests/rpmverify.at
d06308c
@@ -79,7 +79,7 @@ dd if=/dev/zero of="${RPMTEST}"/usr/local/bin/hello \
d06308c
 runroot rpm -Va --nodeps --nouser --nogroup
d06308c
 ],
d06308c
 [1],
d06308c
-[5..T...M.    /usr/local/bin/hello
d06308c
+[.M5....T.    /usr/local/bin/hello
d06308c
 missing   d /usr/share/doc/hello-1.0/FAQ
d06308c
 ],
d06308c
 [])
f510e14
diff -up rpm-4.9.1.2/tests/rpmtests.verify-output rpm-4.9.1.2/tests/rpmtests
f510e14
--- rpm-4.9.1.2/tests/rpmtests.verify-output	2012-03-07 12:20:31.889830559 +0200
f510e14
+++ rpm-4.9.1.2/tests/rpmtests	2012-03-07 12:21:01.651753987 +0200
f510e14
@@ -3619,7 +3619,7 @@ runroot rpm -Va --nodeps --nouser --nogr
f510e14
 at_status=$? at_failed=false
f510e14
 $at_check_filter
f510e14
 at_fn_diff_devnull "$at_stderr" || at_failed=:
f510e14
-echo >>"$at_stdout"; $as_echo "5..T...M.    /usr/local/bin/hello
f510e14
+echo >>"$at_stdout"; $as_echo ".M5....T.    /usr/local/bin/hello
f510e14
 missing   d /usr/share/doc/hello-1.0/FAQ
f510e14
 " | \
f510e14
   $at_diff - "$at_stdout" || at_failed=: