[supermin][PATCH] os-release: use ID_LIKE as a fallback for SUSE detection
by Cédric Bosdonnat
SUSE distros all have in common suse in ID_LIKE field. The ID field
could be varying and is even set to 'Dummy' when building the packages.
If the usual values for openSUSE/SLE can't be found in ID, try with
ID_LIKE.
---
src/os_release.ml | 10 +++++++++-
src/os_release.mli | 7 +++++++
src/ph_rpm.ml | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/os_release.ml b/src/os_release.ml
index b2de259..daa8b07 100644
--- a/src/os_release.ml
+++ b/src/os_release.ml
@@ -29,6 +29,7 @@ let split sep str =
type os_release = {
id : string;
+ id_like : string list;
}
let data = ref None
@@ -52,6 +53,7 @@ and parse () =
let lines = List.filter (fun s -> s.[0] <> '#') lines in
let id = ref "" in
+ let id_like = ref [] in
List.iter (
fun line ->
@@ -65,10 +67,11 @@ and parse () =
else value in
match field with
| "ID" -> id := value
+ | "ID_LIKE" -> id_like := String.split_on_char ' ' value
| _ -> ()
) lines;
- Some { id = !id; }
+ Some { id = !id; id_like = !id_like }
) else
None
@@ -76,3 +79,8 @@ let get_id () =
match get_data () with
| None -> ""
| Some d -> d.id
+
+let get_id_like () =
+ match get_data () with
+ | None -> []
+ | Some d -> d.id_like
diff --git a/src/os_release.mli b/src/os_release.mli
index 2ae349b..e9f2993 100644
--- a/src/os_release.mli
+++ b/src/os_release.mli
@@ -24,3 +24,10 @@ val get_id : unit -> string
An empty string is returned if the file does not exist or cannot
be read. *)
+
+val get_id_like : unit -> string list
+(** Get the value of the "ID_LIKE" field from the /etc/os-release file
+ on the current system.
+
+ An empty list is returned if the file does not exist, cannot
+ be read or the ID_LIKE field is not defined. *)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index b0a5eb2..fd87822 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -41,6 +41,7 @@ let opensuse_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
Config.zypper <> "no" &&
(List.mem (Os_release.get_id ()) [ "opensuse"; "sled"; "sles" ] ||
+ List.mem "suse" (Os_release.get_id_like ()) ||
try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false)
let mageia_detect () =
--
2.13.2
7 years, 2 months
libguestfs binaries missing when built from source code
by emlyn.jose@wipro.com
Hello,
This is regarding the binary missing from libguestfs built from the source code(v 1.30.3).
Here there are some binaries missing when compared to the libguestfs rpm installed from the rhel6-server repo.
Below are the list of binaries
>From the os rpm libguestfs-tools-c-1.20.11-2.el6.x86_64:
>From the one built from source code(v 1.30.3) is :
guestfish
guestfish
guestmount
guestmount
virt-alignment-scan
virt-alignment-scan
virt-cat
virt-cat
virt-copy-in
virt-copy-in
virt-copy-out
virt-copy-out
virt-df
virt-df
virt-edit
virt-edit
virt-filesystems
virt-filesystems
virt-format
virt-format
virt-inspector2
virt-inspector
virt-ls
virt-ls
virt-rescue
virt-rescue
virt-resize
virt-sparsify
virt-sysprep
virt-tar-in
virt-tar-in
virt-tar-out
virt-tar-out
The highlighted binaries are missing from the v 1.30.3.
Below is the content inside the tar file:
[root(a)rhel6.3 SOURCES]# ls
appliance-1.30.1.tar.xz gdk-pixbuf-2.21.7.tar.gz libguestfs-1.30.3 linsee.env
atk-1.29.2.tar.gz glib-2.27.3.tar.gz libguestfs-1.30.3.tar.gz seehelp.content
augeas-1.0.0.tar.gz gtk+-2.24.4.tar.gz libguestfs-post.env seehelp.template
[root(a)rhel6.3 SOURCES]# cd libguestfs-1.30.3
[root(a)rhel6.3 libguestfs-1.30.3]# ls
aclocal.m4 configure.ac gnulib Makefile.in sparsify
align contrib GNUmakefile make-fs src
appliance COPYING gobject mllib subdir-rules.mk
AUTHORS COPYING.LIB golang ocaml sysprep
autogen.sh csharp guestfs-release-notes.pod ocaml-link.sh tests
bash customize guestfs-release-notes.txt p2v test-tool
bindtests daemon HACKING perl tmp
bootstrap df haskell php TODO
BUGS dib html pick-guests.pl.in tools
bugs-in-changelog.sh diff inspector po update-bugs.sh
build-aux edit installcheck.sh.in po-docs v2v
builder erlang java podwrapper.pl.in valgrind-suppressions
cat examples libtool-kill-dependency_libs.sh python zanata-pull.sh
cfg.mk fish logo README zanata.xml
ChangeLog format lua rescue
common-rules.mk fuse m4 resize
config.h.in generator maint.mk ruby
configure get-kernel Makefile.am run.in
What is missing here that results in missing those binaries?
Regards,
Emlyn Jose
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
7 years, 2 months