Bug 1694267

Summary: [PATCH] Add OpenMandriva support
Product: [Community] Virtualization Tools Reporter: Bernhard Rosenkränzer <bero>
Component: superminAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch that adds OpenMandriva support none

Description Bernhard Rosenkränzer 2019-03-29 23:34:59 UTC
Created attachment 1549606 [details]
Patch that adds OpenMandriva support

The attached patch adds OpenMandriva 4.x support to supermin.
Verified to work well enough to use guestfish

Comment 1 Pino Toscano 2019-04-02 07:25:48 UTC
Hi Bernhard,

we generally handle patches on the libguestfs mailing list -- see:
http://libguestfs.org/guestfs-hacking.1.html#submitting-patches
I recommend you to send the patch there, so we can properly review it.

A first review follows, so we can avoid one patch roundtrip:

1) it looks like the the mageia package_handler should work fine also on OpenMandriva, except for the distro identification; we generally do not create new package handlers just for a different distro without any other change (e.g. a different package manager/downloader). What about the following (untested) change instead?

diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 46b7f1f..f5715f1 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -47,7 +47,7 @@ let opensuse_detect () =
 let mageia_detect () =
   Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
     ((Config.urpmi <> "no" && Config.fakeroot <> "no") || Config.dnf <> "no") &&
-    (Os_release.get_id () = "mageia" ||
+    (List.mem (Os_release.get_id ()) [ "mageia"; "openmandriva" ] ||
      try (stat "/etc/mageia-release").st_kind = S_REG with Unix_error _ -> false)
 
 let ibm_powerkvm_detect () =

2) in test-harder.sh, there is no need to set distro=openmandriva, as it is a no-op (it is already "openmageia" from ID in os-release)

3) in test-harder.sh, I guess rpm is a package with a non-zero epoch instead of tar? If so, please mention it as comment (as done in the "mageia", and "redhat" cases)

Thanks!

Comment 2 Richard W.M. Jones 2019-04-02 07:29:07 UTC
Thanks - pushed upstream in commit bca633bfd14aeeb8ae1331d468db75d1ef31f9ff.

Comment 3 Richard W.M. Jones 2019-04-02 07:29:52 UTC
So I pushed this upstream before reading Pino's remark above.  Please try what Pino suggested
in command 1 and if that works we can revert the change and try his fix instead.