Displaying 20 results from an estimated 28 matches for "guestfs_int_version_from_x_y_or_x".
2016 Jul 25
1
[PATCH] osinfo: parse also single-digit version numbers
Switch to guestfs_int_version_from_x_y_or_x to parse version numbers --
although, restrict the parsing to what could look like a valid version
number, to discard quickly version strings like "unknown".
This makes sure that Debian, Fedora, Mageia, and SLED ISOs have the
right version number.
---
src/osinfo.c | 8 ++++++--
1 file c...
2017 Mar 22
1
[PATCH v2] inspect: improve detection of Mageia install discs
...l == NULL || equal == elem)
+ return -1;
+
+ const char *value = equal + 1;
+
+ if (STRPREFIX (elem, "distribution=")) {
+ if (STREQ (value, "Mageia"))
+ fs->distro = OS_DISTRO_MAGEIA;
+ } else if (STRPREFIX (elem, "version=")) {
+ if (guestfs_int_version_from_x_y_or_x (g, &fs->version, value) == -1)
+ return -1;
+ } else if (STRPREFIX (elem, "arch=")) {
+ fs->arch = safe_strdup (g, value);
+ }
+
+ elem = strtok_r (NULL, ",", &saveptr);
+ }
+
+ /* Not found. */
+ return 0;
+}
+
/* The currently mounted de...
2017 Mar 22
2
[PATCH] inspect: improve detection of Mageia install discs
...l == NULL || equal == elem)
+ return -1;
+
+ const char *value = equal + 1;
+
+ if (STRPREFIX (elem, "distribution=")) {
+ if (STREQ (value, "Mageia"))
+ fs->distro = OS_DISTRO_MAGEIA;
+ } else if (STRPREFIX (elem, "version=")) {
+ if (guestfs_int_version_from_x_y_or_x (g, &fs->version, value) == -1)
+ return -1;
+ } else if (STRPREFIX (elem, "arch=")) {
+ fs->arch = safe_strdup (g, value);
+ }
+
+ elem = strtok_r (NULL, ",", &saveptr);
+ }
+
+ /* Not found. */
+ return 0;
+}
+
/* The currently mounted de...
2017 Mar 22
0
Re: [PATCH] inspect: improve detection of Mageia install discs
...n -1;
> +
> + const char *value = equal + 1;
> +
> + if (STRPREFIX (elem, "distribution=")) {
> + if (STREQ (value, "Mageia"))
> + fs->distro = OS_DISTRO_MAGEIA;
> + } else if (STRPREFIX (elem, "version=")) {
> + if (guestfs_int_version_from_x_y_or_x (g, &fs->version, value) == -1)
> + return -1;
> + } else if (STRPREFIX (elem, "arch=")) {
> + fs->arch = safe_strdup (g, value);
> + }
> +
> + elem = strtok_r (NULL, ",", &saveptr);
> + }
> +
> + /* Not found. */
&...
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...id guestfs_int_version_from_values (struct version *v, int maj, int min, int mic);
+extern int guestfs_int_version_from_x_y (guestfs_h *g, struct version *v, const char *str);
+extern int guestfs_int_version_from_x_y_re (guestfs_h *g, struct version *v, const char *str, const pcre *re);
+extern int guestfs_int_version_from_x_y_or_x (guestfs_h *g, struct version *v, const char *str);
extern bool guestfs_int_version_ge (const struct version *v, int maj, int min, int mic);
+extern bool guestfs_int_version_cmp_ge (const struct version *a, const struct version *b);
#define version_init_null(v) guestfs_int_version_from_values (v,...
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi,
this adds an helper version struct, and uses it in the backends (for the
libvirt and qemu versions) and inspection code. This also moves common
code to that, so it is not repeated in many places.
This should help with the small refactoring proposed with
https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html
Thanks,
Pino Toscano (2):
src: start unifying version handling
2016 May 18
3
[PATCH v2 0/2] src: introduce an helper version struct
Hi,
this adds an helper version struct, and uses it in the backends (for the
libvirt and qemu versions) and inspection code. This also moves common
code to that, so it is not repeated in many places.
This should help with the small refactoring proposed with
https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html
Thanks,
Pino Toscano (2):
src: start unifying version handling
2017 Mar 07
0
[PATCH v4 2/9] lib: extract osinfo DB traversing API
...LL;
+
+ content = (char *) xmlNodeGetContent (node);
+ /* We parse either "X.Y" or "X" as version strings, so try to parse
+ * only if the first character is a digit.
+ */
+ if (content && c_isdigit (content[0])) {
+ struct version version;
+ const int res = guestfs_int_version_from_x_y_or_x (g, &version, content);
+ if (res < 0)
+ return -1;
+ else if (res > 0) {
+ osinfo->major_version = version.v_major;
+ osinfo->minor_version = version.v_minor;
+ }
+ }
+
+ return 0;
+}
+
+static int
+parse_family (guestfs_h *g, xmlNodePtr node, struct osinf...
2017 Feb 10
0
[PATCH v3 05/10] lib: extract osinfo DB traversing API
...LL;
+
+ content = (char *) xmlNodeGetContent (node);
+ /* We parse either "X.Y" or "X" as version strings, so try to parse
+ * only if the first character is a digit.
+ */
+ if (content && c_isdigit (content[0])) {
+ struct version version;
+ const int res = guestfs_int_version_from_x_y_or_x (g, &version, content);
+ if (res < 0)
+ return -1;
+ else if (res > 0) {
+ osinfo->major_version = version.v_major;
+ osinfo->minor_version = version.v_minor;
+ }
+ }
+
+ return 0;
+}
+
+static int
+parse_family (guestfs_h *g, xmlNodePtr node, struct osinf...
2017 Jun 19
0
[PATCH v7 2/9] lib: extract osinfo DB traversing API
...LL;
+
+ content = (char *) xmlNodeGetContent (node);
+ /* We parse either "X.Y" or "X" as version strings, so try to parse
+ * only if the first character is a digit.
+ */
+ if (content && c_isdigit (content[0])) {
+ struct version version;
+ const int res = guestfs_int_version_from_x_y_or_x (g, &version, content);
+ if (res < 0)
+ return -1;
+ else if (res > 0) {
+ osinfo->major_version = version.v_major;
+ osinfo->minor_version = version.v_minor;
+ }
+ }
+
+ return 0;
+}
+
+static int
+parse_family (guestfs_h *g, xmlNodePtr node, struct osinf...
2017 Apr 12
0
[PATCH v6 02/10] lib: extract osinfo DB traversing API
...LL;
+
+ content = (char *) xmlNodeGetContent (node);
+ /* We parse either "X.Y" or "X" as version strings, so try to parse
+ * only if the first character is a digit.
+ */
+ if (content && c_isdigit (content[0])) {
+ struct version version;
+ const int res = guestfs_int_version_from_x_y_or_x (g, &version, content);
+ if (res < 0)
+ return -1;
+ else if (res > 0) {
+ osinfo->major_version = version.v_major;
+ osinfo->minor_version = version.v_minor;
+ }
+ }
+
+ return 0;
+}
+
+static int
+parse_family (guestfs_h *g, xmlNodePtr node, struct osinf...
2017 Feb 07
0
[PATCH v2 3/7] mllib: expose libosinfo DB reading functions in mllib
...LL;
+
+ content = (char *) xmlNodeGetContent (node);
+ /* We parse either "X.Y" or "X" as version strings, so try to parse
+ * only if the first character is a digit.
+ */
+ if (content && c_isdigit (content[0])) {
+ struct version version;
+ const int res = guestfs_int_version_from_x_y_or_x (g, &version, content);
+ if (res < 0)
+ return -1;
+ else if (res > 0) {
+ osinfo->major_version = version.v_major;
+ osinfo->minor_version = version.v_minor;
+ }
+ }
+
+ return 0;
+}
+
+static int
+parse_family (guestfs_h *g, xmlNodePtr node, struct osinf...
2017 Jun 16
1
[PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
...l == NULL || equal == elem)
- return -1;
-
- const char *value = equal + 1;
-
- if (STRPREFIX (elem, "distribution=")) {
- if (STREQ (value, "Mageia"))
- fs->distro = OS_DISTRO_MAGEIA;
- } else if (STRPREFIX (elem, "version=")) {
- if (guestfs_int_version_from_x_y_or_x (g, &fs->version, value) == -1)
- return -1;
- } else if (STRPREFIX (elem, "arch=")) {
- fs->arch = safe_strdup (g, value);
- }
-
- elem = strtok_r (NULL, ",", &saveptr);
- }
-
- /* Not found. */
- return 0;
-}
-
-/* The currently mounted de...
2017 Sep 20
7
[PATCH v2] 0/6] Various clean ups in lib/
v1 -> v2:
- Remove the unnecessary calls to guestfs_int_lazy_make_tmpdir
in the final patch.
Rich.
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory.
Rich.
2017 Jun 19
11
[PATCH v7 0/9] Introducing virt-builder-repository
Hi all,
Here is an update of the series fixing Pino's latest comment.
It just doesn't implement the change based on never-accepted
run commands patch.
Cédric Bosdonnat (9):
lib/osinfo.c: Extract xml processing into a callback
lib: extract osinfo DB traversing API
mllib: ocaml wrapper for lib/osinfo
builder: rename docs test script
builder: add a template parameter to get_index
2017 Feb 07
11
[PATCH v2 0/7] Introducing virt-builder-repository
Hi all,
Here is a new version of the virt-builder-repository series taking
care of Pino's comments. It has also been rebased on recent master.
Cédric Bosdonnat (7):
mllib: factorize code to add Checksum.get_checksum function
Move xml and xpath_helpers OCAML code to mllib
mllib: expose libosinfo DB reading functions in mllib
builder: rename docs test script
builder: add
2017 Apr 12
12
[PATCH v6 00/10] Add a virt-builder-repository tool
Hi all,
Here is an updated version of that patch series.
Diff to v5:
* Apply Pino's comments
* Fix indentation issues
* Add a default value for arch in builder/index_parser.ml if template
is set
* Improved new images filtering: don't process image that didn't
change. This has been uncovered by introduction of --no-compression
Cédric Bosdonnat (10):
lib/osinfo.c:
2017 Mar 23
13
[PATCH v5 00/10] Introducing virt-builder-repository
Hi all,
Here is the v5 of my patches series applying the latest comments
from Pino.
Cédric Bosdonnat (10):
lib/osinfo.c: Extract xml processing into a callback
lib: extract osinfo DB traversing API
mllib: ocaml wrapper for lib/osinfo
builder: rename docs test script
builder: add a template parameter to get_index
builder: add Index.write_entry function
dib: move do_cp to
2017 Feb 10
15
[PATCH v3 00/10] Introducing virt-builder-repository
Hi guys,
Here is a v3 of the series, including changes to answer Richard's
comments.
Cédric Bosdonnat (10):
mllib: factorize code to add Checksum.get_checksum function
Move xml and xpath_helpers OCAML code to mllib
mllib: add Xml.parse_file helper
lib/osinfo.c: Extract xml processing into a callback
lib: extract osinfo DB traversing API
mllib: ocaml wrapper for lib/osinfo