search for: run_command_get_lines

Displaying 17 results from an estimated 17 matches for "run_command_get_lines".

2014 Mar 15
5
A few easy dpkg optimizations for supermin
I have done some printf profiling and found that supermin's calls to dpkg for individual packages are quite expensive. Here are some patches that gather all information on demand where possible. On my Debian/unstable-based workstation at home, preparing a minimal appliance using $ ./supermin --use-installed --prepare bash -o supermin.d now takes ~3.5s (previously ~15s). Turning that
2013 Jun 06
1
[supermin PATCH] RFC: Add a --names-only flag.
...#39;^[<[:space:]]' | grep -Ev ':\\w+\\b'" + sprintf "%s depends %s %s | grep -v '^[<[:space:]]' | grep -Ev ':\\w+\\b'" Config.apt_cache which_dependencies (String.concat " " (List.map Filename.quote names)) in let pkgs = run_command_get_lines cmd in let pkgs = if Config.apt_cache_depends_recurse_broken then diff --git a/src/supermin_package_handlers.ml b/src/supermin_package_handlers.ml index aea557e..7048f66 100644 --- a/src/supermin_package_handlers.ml +++ b/src/supermin_package_handlers.ml @@ -23,11 +23,11 @@ open Supermin_ut...
2011 Sep 12
1
[PATCH] febootstrap: Use contents of installed Debian packages instead of downloading and unpacking them.
...n.ml b/src/febootstrap_debian.ml index 23f3593..bb10f15 100644 --- a/src/febootstrap_debian.ml +++ b/src/febootstrap_debian.ml @@ -28,6 +28,9 @@ open Febootstrap_cmdline (* Create a temporary directory for use by all the functions in this file. *) let tmpdir = tmpdir () +let installed_pkgs = + run_command_get_lines "dpkg-query --show --showformat='${Package}\\n'" + let debian_detect () = file_exists "/etc/debian_version" && Config.aptitude <> "no" && Config.apt_cache <> "no" && Config.dpkg <> "no" @@ -...
2011 Oct 18
5
[PATCH febootstrap] Some cleanups for Debian and Ubuntu
I just tried to get libguestfs to compile on Ubuntu 11.10 using the latest febootstrap, and the following patches were necessary for me. They are all just reasonable code cleanups *except* for patch 5/5 which is a gross hack for something I don't understand about how Ubuntu 11.10 multiarch support works. Rich.
2013 Apr 11
2
[PATCH] handle --use-installed in zypp driver
...erbose then "--verbose --verbose" else "--quiet") + (match packager_config with None -> "" + | Some filename -> sprintf "--config %s" filename) + tmpdir tmpdir (String.concat " " (List.map Filename.quote names)) in + let pkg_names = run_command_get_lines cmd in + + (* Return list of package names, remove empty lines. *) + List.filter (fun s -> s <> "") pkg_names + +let zypp_rpm_resolve_dependencies_and_download names = + if use_installed then + zypp_rpm_resolve_dependencies_and_download_use_installed names + else + zypp...
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
2016 Feb 18
0
[PATCH 3/3] Add and use an helper error function
...zcat file = let cmd = sprintf "%s %s" zcat (quote file) in diff --git a/src/dpkg.ml b/src/dpkg.ml index ddfb03a..70acfa2 100644 --- a/src/dpkg.ml +++ b/src/dpkg.ml @@ -39,9 +39,7 @@ let dpkg_init s = let cmd = sprintf "%s --print-architecture" Config.dpkg in let lines = run_command_get_lines cmd in match lines with - | [] -> - eprintf "supermin: dpkg: expecting %s to return some output\n" cmd; - exit 1 + | [] -> error "dpkg: expecting %s to return some output" cmd | arch :: _ -> dpkg_primary_arch := arch type dpkg_t = { diff --git a/src/ker...
2016 Feb 18
4
[PATCH 0/3] supermin: miscellaneous cleanups
Hi, few cleanups in the supermin codebase; no actual functional change. Thanks, -- Pino Toscano (3): ext2: simplify tracking of visited modules utils: remove unused run_python function Add and use an helper error function src/build.ml | 20 +++++----------- src/dpkg.ml | 4 +--- src/ext2_initrd.ml | 10 ++++---- src/kernel.ml | 27
2014 Sep 17
4
[PATCH 0/2] supermin: use librpm for rpm support
Hi, this work makes supermin use the rpm library instead of invoking rpm directly. This, together with a needed refactoring of the dependency resolution, should help in make supermin faster on rpm-based systems. Surely the patches will still need polishing, especially for behaviours of newly added stuff, but at least it's a good starting point. Noting that you need rpm-devel on most of rpm
2014 Mar 05
3
[PATCH 0/2] supermin: fix with no dpkg installed
f093ba80e0918484838dba46a747ffaecf983fb3 caused a regression (startup failure) when dpkg is not installed. Simple fix with simple test for it. Pino Toscano (2): dpkg: do not always run dpkg_primary_arch tests: add a basic run test src/dpkg.ml | 4 ++-- tests/Makefile.am | 3 ++- tests/test-basic.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3
2011 Jun 15
2
[PATCH 1/2] use apt-get instead of aptitude
--- config.ml.in | 2 +- configure.ac | 2 +- febootstrap_debian.ml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.ml.in b/config.ml.in index a8c008a..262c913 100644 --- a/config.ml.in +++ b/config.ml.in @@ -22,7 +22,7 @@ let package_version = "@PACKAGE_VERSION@" let yum = "@YUM@" let rpm = "@RPM@"
2013 Aug 19
5
[PATCH v2 0/3 supermin] URPMI & xz support.
Joseph, Please try my modified versions of these patches. These are compile-tested on Fedora and they don't break any existing functionality, but I don't have either urpmi nor a statically-linked xz so I cannot fully test them. I have also fixed detection of zlib (2/3). Rich.
2013 Jun 04
2
[PATCH / RFC] Handle --packager-config in zypp_rpm
...fig with None -> "" | Some filename -> sprintf "--config %s" filename) - tmpdir tmpdir (String.concat " " (List.map Filename.quote names)) in + tmpdir repos_dir tmpdir (String.concat " " (List.map Filename.quote names)) in let pkg_names = run_command_get_lines cmd in (* Return list of package names, remove empty lines. *)
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...-> + let chan = open_in file in + let lines = input_all_lines chan in + close_in chan; + update_appliance appliance lines t + | GZip ((Packages|Hostfiles|Excludefiles) as t) -> + let cmd = sprintf "zcat %s" (quote file) in + let lines = run_command_get_lines cmd in + update_appliance appliance lines t + | XZ ((Packages|Hostfiles|Excludefiles) as t) -> + let cmd = sprintf "xzcat %s" (quote file) in + let lines = run_command_get_lines cmd in + update_appliance appliance lines t + | Uncompressed Base_imag...
2013 Apr 09
2
[PATCH 1/2] add run_shell helper
The new run_shell helper is a copy of run_python, and will be used by upcoming changes. Signed-off-by: Olaf Hering <olaf at aepfle.de> --- src/supermin_utils.ml | 9 +++++++++ src/supermin_utils.mli | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/supermin_utils.ml b/src/supermin_utils.ml index f98e09a..cb8a27e 100644 --- a/src/supermin_utils.ml +++ b/src/supermin_utils.ml
2014 Mar 13
3
[supermin 1/3] Recognize dpkg-divert
--- configure.ac | 1 + src/config.ml.in | 1 + src/dpkg.ml | 1 + 3 files changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 2141540..99ea913 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,7 @@ AC_PATH_PROG(APT_GET,[apt-get],[no]) AC_PATH_PROG(DPKG,[dpkg],[no]) AC_PATH_PROG(DPKG_DEB,[dpkg-deb],[no]) AC_PATH_PROG(DPKG_QUERY,[dpkg-query],[no])
2014 Mar 10
3
[supermin 3/3] Use the file tuple up to the point where files are copied into the filesystem / chroot
...ath, st) -> diff --git a/src/dpkg.ml b/src/dpkg.ml index 5a650b8..efc8123 100644 --- a/src/dpkg.ml +++ b/src/dpkg.ml @@ -155,6 +155,17 @@ let dpkg_get_all_requires pkgs = loop pkgs let dpkg_get_all_files pkgs = + let cmd = sprintf "%s --list" Config.dpkg_divert in + let lines = run_command_get_lines cmd in + let diversions = Hashtbl.create (List.length lines) in + List.iter ( + fun line -> + let items = string_split " " line in + match items with + | ["diversion"; "of"; path; "to"; real_path; "by"; pkg] -> + Hashtbl.add...