Skip to content

Commit

Permalink
v2v: Don't use epoch prefix on RPM command line for RHEL <= 4 (RHBZ#1…
Browse files Browse the repository at this point in the history
…170685).

See the explanation here:
https://bugzilla.redhat.com/show_bug.cgi?id=1170685#c7
  • Loading branch information
rwmjones committed Dec 5, 2014
1 parent eddc886 commit 205a8c7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions v2v/linux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 205a8c7

Please sign in to comment.