inspector: Sort application names.
authorRichard Jones <rjones@redhat.com>
Mon, 8 Mar 2010 19:24:48 +0000 (19:24 +0000)
committerRichard Jones <rjones@redhat.com>
Mon, 8 Mar 2010 19:24:48 +0000 (19:24 +0000)
This ensures the list of applications is stable.

perl/lib/Sys/Guestfs/Lib.pm

index e8796ad..98cdb88 100644 (file)
@@ -1439,6 +1439,7 @@ sub _check_for_applications
                 (["rpm",
                   "-q", "-a",
                   "--qf", "%{name} %{epoch} %{version} %{release} %{arch}\n"]);
+            @lines = sort @lines;
             foreach (@lines) {
                 if (m/^(.*) (.*) (.*) (.*) (.*)$/) {
                     my $epoch = $2;
@@ -1458,6 +1459,7 @@ sub _check_for_applications
                 (["dpkg-query",
                   "-f", '${Package} ${Version} ${Architecture} ${Status}\n',
                   "-W"]);
+            @lines = sort @lines;
             foreach (@lines) {
                 if (m/^(.*) (.*) (.*) (.*) (.*) (.*)$/) {
                     if ( $6 eq "installed" ) {