[Pkg-libvirt-commits] [libguestfs] 48/384: v2v: Don't use epoch prefix on RPM command line for RHEL <= 4 (RHBZ#1170685).

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 16:55:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 205a8c7ca1ed1d66bef56d75c3c244e726e3bbbf
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Dec 5 13:09:10 2014 +0000

    v2v: Don't use epoch prefix on RPM command line for RHEL <= 4 (RHBZ#1170685).
    
    See the explanation here:
    https://bugzilla.redhat.com/show_bug.cgi?id=1170685#c7
---
 v2v/linux.ml | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/v2v/linux.ml b/v2v/linux.ml
index 4287a4f..32a4a21 100644
--- a/v2v/linux.ml
+++ b/v2v/linux.ml
@@ -129,9 +129,22 @@ let file_list_of_package verbose (g : Guestfs.guestfs) inspect app =
       sprintf "%s-%s-%s" app.G.app2_name
         app.G.app2_version app.G.app2_release in
     let pkg_name =
-      if app.G.app2_epoch > 0_l then
-        sprintf "%ld:%s" app.G.app2_epoch pkg_name
-      else
+      if app.G.app2_epoch > 0_l then (
+        (* RHEL 3/4 'rpm' does not support using the epoch prefix.
+         * (RHBZ#1170685).
+         *)
+        let is_rhel_lt_5 =
+          match inspect with
+          | { i_type = "linux";
+              i_distro = "rhel" | "centos" | "scientificlinux" |
+                  "redhat-based";
+              i_major_version = v } when v < 5 -> true
+          | _ -> false in
+        if is_rhel_lt_5 then
+          pkg_name
+        else
+          sprintf "%ld:%s" app.G.app2_epoch pkg_name
+      ) else
         pkg_name in
     let cmd = [| "rpm"; "-ql"; pkg_name |] in
     if verbose then eprintf "%s\n%!" (String.concat " " (Array.to_list cmd));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list