search for: get_file_cont

Displaying 8 results from an estimated 8 matches for "get_file_cont".

2018 Dec 03
3
[supermin PATCH] build: ignore empty files
...sub path 1 (n-1) ) lines in { appliance with excludefiles = appliance.excludefiles @ lines } - | Base_image -> assert false + | Base_image | Empty -> assert false (* Determine the [file_type] of [file], or exit with an error. *) and get_file_type file = @@ -331,6 +335,7 @@ and get_file_content file buf len = else if len >= 2 && buf.[0] = '/' then Hostfiles else if len >= 2 && buf.[0] = '-' then Excludefiles else if len >= 1 && isalnum buf.[0] then Packages + else if len = 0 then Empty else error "%s: unknown file type...
2018 Dec 03
4
[supermin PATCH v2 0/3] Better handle no config files
This is a "merge" of two previous series: https://www.redhat.com/archives/libguestfs/2018-December/msg00015.html https://www.redhat.com/archives/libguestfs/2018-December/msg00020.html The goal is to handle better situations like: - empty file in the appliance directory - no config files available in the packages to include in an appliance Compared to the two series, the changes are: -
2018 Dec 03
4
[supermin PATCH 0/2] Create a really empty base.tar.gz
See patch #2 for more explanation. Pino Toscano (2): prepare: keep config_files available for longer prepare: create a really empty base.tar.gz with no config files src/mode_prepare.ml | 87 +++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 35 deletions(-) -- 2.17.2
2018 Dec 03
0
Re: [supermin PATCH] build: ignore empty files
...t; { appliance with excludefiles = appliance.excludefiles @ lines } > - | Base_image -> assert false > + | Base_image | Empty -> assert false > > (* Determine the [file_type] of [file], or exit with an error. *) > and get_file_type file = > @@ -331,6 +335,7 @@ and get_file_content file buf len = > else if len >= 2 && buf.[0] = '/' then Hostfiles > else if len >= 2 && buf.[0] = '-' then Excludefiles > else if len >= 1 && isalnum buf.[0] then Packages > + else if len = 0 then Empty > else error &qu...
2018 Dec 03
0
[supermin PATCH 2/2] prepare: create a really empty base.tar.gz with no config files
...hat is compressed by gzip, resulting in few bytes. The issue happens later, during the build phase: base.tar.gz is correctly detected as gz, and zcat is run to detect its content: since the empty tar was 10K of zero's, the buffer in get_compressed_file_content will be filled by zero's, and get_file_content will fail to detect anything. As solution, at least for our own base.tar.gz: in case there are no config files to copy, create a gzip file from /dev/null, which is still recognized as empty tar. --- src/mode_prepare.ml | 49 ++++++++++++++++++++++++++++++--------------- 1 file changed, 33 inse...
2016 Feb 18
0
[PATCH 3/3] Add and use an helper error function
...t 1 - ); + if n < 1 || path.[0] <> '-' then + error "excludefiles line does not start with '-'"; String.sub path 1 (n-1) ) lines in { appliance with excludefiles = appliance.excludefiles @ lines } @@ -335,16 +331,12 @@ and get_file_content file buf len = (* However we intend to support them in future for both input * and output. *) - eprintf "supermin: %s: cpio files are not supported in this version of supermin\n" file; - exit 1 + error "%s: cpio files are not supported in this version of...
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 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...39; && buf.[2] = 'z' && + buf.[3] = 'X' && buf.[4] = 'Z' && buf.[5] = '\000' + then (* xz-compressed file *) + XZ (get_compressed_file_content "xzcat" file) + else + Uncompressed (get_file_content file buf len) + +and get_file_content file buf len = + if len >= 262 && buf.[257] = 'u' && buf.[258] = 's' && + buf.[259] = 't' && buf.[260] = 'a' && buf.[261] = 'r' + then...