search for: string_prefix

Displaying 20 results from an estimated 51 matches for "string_prefix".

2015 Jan 22
3
[PATCH 1/2] configure: look for the oUnit OCaml module
It will be used for the OCaml unit tests. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index e0fb481..e360bbb 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,6 +1120,7 @@ AS_IF([test "x$OCAMLC" != "xno"],[ ]) OCAML_PKG_gettext=no +OCAML_PKG_oUnit=no AS_IF([test "x$OCAMLC" != "xno"],[ #
2015 Jan 22
0
[PATCH 2/2] mllib: convert common_utils_tests to oUnit
...6_L)); + assert_equal_string "1.3M" (human_size 1363149_L); + assert_equal_string "-1.3M" (human_size (-1363149_L)); + assert_equal_string "3.4G" (human_size 3650722201_L); + assert_equal_string "-3.4G" (human_size (-3650722201_L)) + +(* Test Common_utils.string_prefix. *) +let test_string_prefix () = + assert_bool "string_prefix,," (string_prefix "" ""); + assert_bool "string_prefix,foo," (string_prefix "foo" ""); + assert_bool "string_prefix,foo,foo" (string_prefix "foo" "fo...
2016 Nov 11
1
[PATCH] Add hppa, hppa64, ppc64el architectures
...ost_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] | _ -> [host_cpu] diff --git a/src/utils.ml b/src/utils.ml index 4223be4..e3b8742 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -183,6 +183,8 @@ let compare_architecture a1 a2 = | a when string_prefix "armv6" a -> 32 | a when string_prefix "armv7" a -> 32 | a when string_prefix "armv8" a -> 64 + | "hppa" | "parisc" -> 32 + | "hppa64" | "parisc64" -> 64 | "ppc" | "ppc32" -...
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase. These are replaced by safe functions that won't break UTF-8 strings. Other miscellaneous refactoring. Rich.
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
This is just a straight refactoring. Various ad hoc string_* functions that appeared in Common_utils have been renamed and placed in the String.* namespace. The old vs "new" functions are: string_prefix -> String.is_prefix string_suffix -> String.is_suffix string_find -> String.find replace_str -> String.replace string_nsplit -> String.nsplit string_split -> String.split string_lines_split -> String.lines_split string_random8 -> String.random8 --- builder/checks...
2014 Apr 28
2
Re: [supermin] Be smarter about finding suitable kernel images
* Richard W.M. Jones: > On Sat, Apr 26, 2014 at 02:27:07PM +0200, Hilko Bengen wrote: >> --- >> src/kernel.ml | 43 ++++++++++++++++++++++++++++--------------- >> 1 file changed, 28 insertions(+), 15 deletions(-) >> >> diff --git a/src/kernel.ml b/src/kernel.ml >> index ed5aea3..436b1b0 100644 >> --- a/src/kernel.ml >> +++ b/src/kernel.ml
2014 Dec 04
2
[PATCH v3 0/2] v2v: When picking a default kernel, favour non-debug
Since v2: - Use string_suffix kernel_name "-debug" || string_suffix kernel_name "-dbg" - This requires addition of the string_suffix function and some tests
2014 Jan 09
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
On Thu, Jan 09, 2014 at 04:21:10PM +0100, Pino Toscano wrote: > + and set_operations op_string = > + let currentopset = > + match (!operations) with No need for parentheses around !operations. > + let n = ref op_name in > + let remove = string_prefix op_name "-" in > + if remove then > + n := String.sub op_name 1 (String.length op_name - 1); > + match !n with This can be written a bit more naturally as ... let n, remove = if string_prefix op_name "-" then String.sub op_name 1 (St...
2019 Apr 12
0
[supermin PATCH 5/5] utils: remove unused 'compare_architecture' function
...;i386" | "i486" | "i586" | "i686" | "x86_32" | "x86-32" -> 32 - | "x86_64" | "x86-64" | "amd64" -> 64 - | "armel" | "armhf" -> 32 - | "aarch64" -> 64 - | a when string_prefix "armv5" a -> 32 - | a when string_prefix "armv6" a -> 32 - | a when string_prefix "armv7" a -> 32 - | a when string_prefix "armv8" a -> 64 - | "hppa" | "parisc" -> 32 - | "hppa64" | "parisc64&qu...
2012 Apr 18
1
[PATCH RFC] sysprep: remove user accounts
...Guestfs + +let user_account_perform g root = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( + let login_def = "/etc/login.defs" in + let lines = Array.to_list (g#read_lines login_def) in + let line_min = Array.filter ( + fun line -> (string_prefix line "UID_MIN") + ) lines in + let _,min_uid = sscanf line_min "%s %d" (fun a b -> a,b) in + let line_max = Array.filter ( + fun line -> (string_prefix line "UID_MAX") + ) lines in + let _,max_uid = sscanf line_max "%s %d" (fun a b -...
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
...ng "100" (human_size 100_L); assert_equal_string "-100" (human_size (-100_L)); assert_equal_string "1.0K" (human_size 1024_L); @@ -87,7 +87,7 @@ let test_human_size () = assert_equal_string "-3.4G" (human_size (-3650722201_L)) (* Test Common_utils.string_prefix. *) -let test_string_prefix () = +let test_string_prefix ctx = assert_bool "string_prefix,," (string_prefix "" ""); assert_bool "string_prefix,foo," (string_prefix "foo" ""); assert_bool "string_prefix,foo,foo" (string_p...
2014 Apr 26
2
[supermin] Be smarter about finding suitable kernel images
...t with it).\n"; +supermin use, you shouldn't boot the Xen guest with it).\n" + host_cpu; exit 1 and find_dtb debug copy_kernel kernel_name wildcard dtb = @@ -200,7 +212,8 @@ and has_modpath kernel_name = | Not_found -> false and get_kernel_version kernel_name = - if string_prefix "vmlinuz-" kernel_name then ( + if (string_prefix "vmlinuz-" kernel_name) || + (string_prefix "vmlinux-" kernel_name) then ( let kv = String.sub kernel_name 8 (String.length kernel_name - 8) in if modules_dep_exists kv then kv else get_kernel_version...
2014 Jan 10
0
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...014 at 04:21:10PM +0100, Pino Toscano wrote: > > + and set_operations op_string = > > + let currentopset = > > + match (!operations) with > > No need for parentheses around !operations. > > > + let n = ref op_name in > > + let remove = string_prefix op_name "-" in > > + if remove then > > + n := String.sub op_name 1 (String.length op_name - 1); > > + match !n with > > This can be written a bit more naturally as ... > > let n, remove = > if string_prefix op_name "-&q...
2019 Apr 12
6
[supermin PATCH 0/5] rpm: fix package selection w/ multilib
This patch series fixes the way supermin sorts the list of installed packages when resolving a name, picking the right package for the host architecture. Pino Toscano (5): rpm: do not unpack parameters rpm: fix version comparison rpm: query the RPM architecture rpm: fix package sorting (RHBZ#1696822) utils: remove unused 'compare_architecture' function src/librpm-c.c | 10
2014 Mar 10
2
[supermin 2/3] Add file.source_path, no functional changes
...+++ src/pacman.ml | 2 +- src/rpm.ml | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dpkg.ml b/src/dpkg.ml index c28354a..5a650b8 100644 --- a/src/dpkg.ml +++ b/src/dpkg.ml @@ -166,7 +166,8 @@ let dpkg_get_all_files pkgs = let config = try string_prefix "/etc/" path && (lstat path).st_kind = S_REG with Unix_error _ -> false in - { ft_path = path; ft_config = config } + let cmd = sprintf "%s --truename %s" Config.dpkg_divert path in + { ft_path = path; ft_source_path = path; ft_config = config } )...
2015 Aug 28
7
v2v: -i libvirtxml: Map empty network or bridge name to a default (RHBZ#1257895).
When importing from VMware via the libvirt driver, the libvirt driver can add an empty source bridge name: <interface type='bridge'> <mac address='00:01:02:03:04:05:06'/> <source bridge=''/> </interface> Replicate what we do on the -i ova path, and map these to "eth0", "eth1" etc. This also includes a bunch
2015 Oct 07
1
Re: [PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
On Tuesday 06 October 2015 13:30:50 Richard W.M. Jones wrote: > This is just a straight refactoring. Various ad hoc string_* > functions that appeared in Common_utils have been renamed and placed > in the String.* namespace. The old vs "new" functions are: > > string_prefix -> String.is_prefix > string_suffix -> String.is_suffix > string_find -> String.find > replace_str -> String.replace > string_nsplit -> String.nsplit > string_split -> String.split > string_lines_split -> String.lines_split > string_random8 ->...
2018 Oct 02
1
[supermin PATCH] rpm: generalize openSUSE support
...rpm_is_available () && Config.zypper <> "no" && - (List.mem (Os_release.get_id ()) [ "opensuse-leap"; "opensuse"; "sled"; "sles" ] || + (List.mem (Os_release.get_id ()) [ "sled"; "sles" ] || + string_prefix "opensuse" (Os_release.get_id ()) || try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false) let mageia_detect () = diff --git a/tests/test-harder.sh b/tests/test-harder.sh index 54362de..c827f13 100755 --- a/tests/test-harder.sh +++ b/tests/test-h...
2014 Mar 08
9
supermin and dpkg-divert
While trying to run libguestfs tests after building with "--enable-appliance --with-supermin-extra-options=--use-installed", I ran into a peculiar error message in the c-api test: ,---- | libguestfs: error: strings: /abssymlink: strings: error while loading | shared libraries: libbfd-2.24-multiarch.so: cannot open shared object | file: No such file or directory `---- The problem here
2015 Mar 18
0
[PATCH 1/2] mllib: allow external_command to return on nonzero return value
This is useful for probing probing for cache files such as: external_command ?ignore_error:(Some true) ~prog "ls .cache/something.*" will return command output (matched files) on its success or empty list whenits exit code is other than 0 (there are no such files). --- mllib/common_utils.ml | 15 ++++++++++----- mllib/common_utils.mli | 2 +- 2 files changed, 11 insertions(+), 6