search for: unlink_on_exit

Displaying 20 results from an estimated 77 matches for "unlink_on_exit".

2014 Feb 20
4
[PATCH 1/2] mllib: add an hook to cleanup directories on exit
Much similar to unlink_on_exit, but recursively cleaning directories. --- mllib/common_utils.ml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 3943417..f49ede6 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -386,6 +386,35...
2016 Oct 24
0
[PATCH 2/2] builder: consolidate handling of temporary files/dirs
...e t = { subkeys_fingerprints : string list; check_signature : bool; gpghome : string; + tmpdir : string; } (* Import the specified key file. *) -let import_keyfile ~gpg ~gpghome ?(trust = true) keyfile = - let status_file = Filename.temp_file "vbstat" ".txt" in - unlink_on_exit status_file; +let import_keyfile ~gpg ~gpghome ~tmpdir ?(trust = true) keyfile = + let status_file = Filename.temp_file ~temp_dir:tmpdir "vbstat" ".txt" in let cmd = sprintf "%s --homedir %s --status-file %s --import %s%s" gpg gpghome (quote status_file) (quot...
2016 Oct 25
0
[PATCH v2 2/2] builder: consolidate handling of temporary files/dirs
...e t = { subkeys_fingerprints : string list; check_signature : bool; gpghome : string; + tmpdir : string; } (* Import the specified key file. *) -let import_keyfile ~gpg ~gpghome ?(trust = true) keyfile = - let status_file = Filename.temp_file "vbstat" ".txt" in - unlink_on_exit status_file; +let import_keyfile ~gpg ~gpghome ~tmpdir ?(trust = true) keyfile = + let status_file = Filename.temp_file ~temp_dir:tmpdir "vbstat" ".txt" in let cmd = sprintf "%s --homedir %s --status-file %s --import %s%s" gpg gpghome (quote status_file) (quot...
2016 Oct 25
2
[PATCH v2 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be created in a specified directory (which is supposed to be temporary, and disposed only when the application quits). --- mllib/curl.ml | 10 ++++++---- mllib/curl.mli | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..baa75ec 100644 --- a/mllib/curl.ml +++
2015 Jul 28
0
[PATCH 09/10] builder: add Sigchecker.verify_and_remove_signature
...-and do_verify t args = +and verify_and_remove_signature t filename = + if t.check_signature then ( + (* Copy the input file as temporary file with the .asc extension, + * so gpg recognises that format. *) + let asc_file = Filename.temp_file "vbfile" ".asc" in + unlink_on_exit asc_file; + let cmd = sprintf "cp %s %s" (quote filename) (quote asc_file) in + if verbose () then printf "%s\n%!" cmd; + if Sys.command cmd <> 0 then exit 1; + let out_file = Filename.temp_file "vbfile" "" in + unlink_on_exit out_file; +...
2016 Oct 24
2
[PATCH 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be created in a specified directory (which is supposed to be temporary, and disposed only when the application quits). --- mllib/curl.ml | 16 +++++++++++----- mllib/curl.mli | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..7d07125 100644 --- a/mllib/curl.ml
2015 Mar 23
1
[PATCH v4] [RFE] virt-builder should support download resume
...uming downloads in virt-builder. Partially downloaded image is not deleted on exit anymore. There is a check for partially downloaded image in cache directory based on its name. When found, download_to crafts appropriate options to continue its download. Fixes RHBZ#1198344 Ammended for forgotten unlink_on_exit and fixed call with optional aguments. Maros Zatko (1): builder: support for download resume builder/downloader.ml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) -- 1.9.3
2015 Mar 23
2
[PATCH v3] [RFE] virt-builder should support download resume
...suming downloads in virt-builder. Partially downloaded file is not deleted on exit anymore. There is a check for partially downloaded image in cache directory based on its name. When found, download_to crafts appropriate options to continue its download. Fixes RHBZ#1198344 Ammended for forgotten unlink_on_exit. Maros Zatko (1): builder: support for download resume builder/downloader.ml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) -- 1.9.3
2014 Feb 21
2
Re: [PATCH 2/2] builder: use a disposable GPG keyring for every Sigchecker
...ature; > + gpghome = tmpdir; > + key_imported = false; > } > > (* Compare two strings of hex digits ignoring whitespace and case. *) > @@ -159,8 +176,9 @@ and do_verify t args = > let status_file = Filename.temp_file "vbstat" ".txt" in > unlink_on_exit status_file; > let cmd = > - sprintf "%s --verify%s --status-file %s %s" > - t.gpg (if t.debug then "" else " -q --logger-file /dev/null") > + sprintf "%s --homedir %s --verify%s --status-file %s %s" > + t.gpg t.gpghome &...
2015 Oct 20
1
[PATCH v3 02/13] v2v: factor out overlay creation
...let overlay_dir = (new Guestfs.guestfs ())#get_cachedir () in - let overlays = - List.map ( - fun ({ s_qemu_uri = qemu_uri; s_format = format } as source) -> - let overlay_file = - Filename.temp_file ~temp_dir:overlay_dir "v2vovl" ".qcow2" in - unlink_on_exit overlay_file; - - let options = - "compat=1.1" ^ - (match format with None -> "" - | Some fmt -> ",backing_fmt=" ^ fmt) in - let cmd = - sprintf "qemu-img create -q -f qcow2 -b %s -o %s %s" -...
2015 Dec 04
1
[PATCH] builder: create temporary images in the cachedir (RHBZ#1288201)
...n won't run in parallel, we don't only need * to choose unique tempfiles per transition, so this is OK: *) - let tempfile = Filename.temp_file "vb" ".img" in + let tempfile = Filename.temp_file ~temp_dir:cache_dir "vb" ".img" in unlink_on_exit tempfile; (* Always possible to copy from one place to another. The only -- 2.1.0
2015 Mar 18
0
[PATCH 2/2] builder: support for download resume
...try URI.parse_uri uri with Invalid_argument "URI.parse_uri" -> @@ -82,7 +82,6 @@ and download_to ~prog t ?(progress_bar = false) ~proxy uri filename = * atomically rename it to the final filename. *) let filename_new = filename ^ "." ^ string_random8 () in - unlink_on_exit filename_new; (match parseduri.URI.protocol with | "file" -> @@ -115,11 +114,20 @@ and download_to ~prog t ?(progress_bar = false) ~proxy uri filename = if bad_status_code status_code then error (f_"failed to download %s: HTTP status code %s") uri status_c...
2020 Apr 06
0
[v2v PATCH 2/2] Consolidate handling of temporary files/dirs
...ec allows the file to be gzip-compressed, in * which case we must uncompress it into a temporary. *) - let temp_dir = (open_guestfs ())#get_cachedir () in - let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in - unlink_on_exit new_filename; + let new_filename = Filename.temp_file ~temp_dir:cachedir "ova" ".vmdk" in let cmd = sprintf "zcat %s > %s" (quote filename) (quote new_filename) in if shell_command cmd <> 0 then diff --git a/v2v/...
2014 May 14
2
[PATCH 1/2] builder: save the proxy for each entry
Copy the information about the proxy of a source in all the entries of that source; this way it is possible to use it later when accessing to the actual image of an entry. --- builder/index_parser.ml | 2 ++ builder/index_parser.mli | 1 + 2 files changed, 3 insertions(+) diff --git a/builder/index_parser.ml b/builder/index_parser.ml index 2040656..40b2116 100644 --- a/builder/index_parser.ml
2016 Jul 07
0
[PATCH 3/3] builder: Use the new Curl module for passing parameters to curl.
...revision in message (f_"Downloading: %s") file_uri; let progress_bar = not (quiet ()) in - Downloader.download downloader ~template ~progress_bar ~proxy + Downloader.download downloader ~template ~progress_bar ?proxy file_uri in if delete_on_exit then unlink_on_exit template; template in diff --git a/builder/downloader.ml b/builder/downloader.ml index 8c47bad..de9b404 100644 --- a/builder/downloader.ml +++ b/builder/downloader.ml @@ -32,29 +32,24 @@ type t = { cache : Cache.t option; (* cache for templates *) } -type proxy_mode = - |...
2015 Aug 11
0
[PATCH v2 03/17] v2v: factor out overlay creation
...eing modified"); + let overlay_dir = (new Guestfs.guestfs ())#get_cachedir () in + List.mapi ( + fun i ({ s_qemu_uri = qemu_uri; s_format = format } as source) -> + let overlay_file = + Filename.temp_file ~temp_dir:overlay_dir "v2vovl" ".qcow2" in + unlink_on_exit overlay_file; + + let options = + "compat=1.1" ^ + (match format with None -> "" + | Some fmt -> ",backing_fmt=" ^ fmt) in + let cmd = + sprintf "qemu-img create -q -f qcow2 -b %s -o %s %s" + (quote qem...
2015 Mar 18
5
[PATCH 0/2] [RFE] virt-builder should support download resume
This patchset adds support for resuming downloads in virt-builder. Partially downloaded file is not deleted on exit anymore. There is a check for partially downloaded image in cache directory based on its name. When found, download_to crafts appropriate options to continue its download. Maros Zatko (2): mllib: allow external_command to return [] on nonzero return value builder: support for
2015 May 11
3
[PATCH 1/3] builder: move gpg status parsing within import_keyfile
...: "IMPORT_OK" :: _ :: fp :: _ -> fingerprint := fp - | _ -> () - ) status; - !fingerprint + import_keyfile gpg tmpdir verbose kf | Fingerprint fp -> let filename = Filename.temp_file "vbpubkey" ".asc" in unlink_on_exit filename; -- 2.1.0
2018 Aug 23
2
[PATCH v4] v2v: Add --print-estimate option to print copy size estimate.
v4: - Same as v3, but depends on and uses new --machine-readable work. Rich.
2020 Apr 06
4
[v2v PATCH 1/2] v2v: nbdkit: change base dir for nbdkit sockets/pidfiles
Since this new temporary directory will contain UNIX sockets for communicating with nbdkit, then its path must not be too long. Use the existing directory that libguestfs exposes for this, i.e. sockdir. --- v2v/nbdkit.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml index 65317f9b..46b20c9d 100644 --- a/v2v/nbdkit.ml +++ b/v2v/nbdkit.ml