Accepting request 330886 from home:cbosdonnat:branches:Virtualization
- Create the .cache folder if it doesn't exist already. bsc#939097. OBS-URL: https://build.opensuse.org/request/show/330886 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=347
This commit is contained in:
parent
7a9cb2da14
commit
8e5ba8d20f
@ -154,3 +154,46 @@ Index: libguestfs-1.26.10/customize/password.ml
|
|||||||
| _, _ ->
|
| _, _ ->
|
||||||
warning ~prog (f_"password: using insecure md5 password encryption for
|
warning ~prog (f_"password: using insecure md5 password encryption for
|
||||||
guest of type %s version %d.\nIf this is incorrect, use --password-crypto option and file a bug.") distro major;
|
guest of type %s version %d.\nIf this is incorrect, use --password-crypto option and file a bug.") distro major;
|
||||||
|
Index: libguestfs-1.26.10/builder/builder.ml
|
||||||
|
===================================================================
|
||||||
|
--- libguestfs-1.26.10.orig/builder/builder.ml
|
||||||
|
+++ libguestfs-1.26.10/builder/builder.ml
|
||||||
|
@@ -159,7 +159,7 @@ let main () =
|
||||||
|
(* Try to make the directory. If that fails, warn and continue
|
||||||
|
* without any cache.
|
||||||
|
*)
|
||||||
|
- try mkdir dir 0o755; Some dir
|
||||||
|
+ try mkdir_p dir 0o755; Some dir
|
||||||
|
with exn ->
|
||||||
|
warning ~prog (f_"cache %s: %s") dir (Printexc.to_string exn);
|
||||||
|
warning ~prog (f_"disabling the cache");
|
||||||
|
Index: libguestfs-1.26.10/mllib/common_utils.ml
|
||||||
|
===================================================================
|
||||||
|
--- libguestfs-1.26.10.orig/mllib/common_utils.ml
|
||||||
|
+++ libguestfs-1.26.10/mllib/common_utils.ml
|
||||||
|
@@ -508,3 +508,14 @@ let is_char_device file =
|
||||||
|
let is_directory path =
|
||||||
|
try Sys.is_directory path
|
||||||
|
with Sys_error _ -> false
|
||||||
|
+
|
||||||
|
+let rec mkdir_p path permissions =
|
||||||
|
+ try Unix.mkdir path permissions
|
||||||
|
+ with
|
||||||
|
+ | Unix.Unix_error (Unix.EEXIST, _, _) -> ()
|
||||||
|
+ | Unix.Unix_error (Unix.ENOENT, _, _) ->
|
||||||
|
+ (* A component in the path does not exist, so first try
|
||||||
|
+ * creating the parent directory, and then again the requested
|
||||||
|
+ * directory. *)
|
||||||
|
+ mkdir_p (Filename.dirname path) permissions;
|
||||||
|
+ Unix.mkdir path permissions
|
||||||
|
Index: libguestfs-1.26.10/mllib/common_utils.mli
|
||||||
|
===================================================================
|
||||||
|
--- libguestfs-1.26.10.orig/mllib/common_utils.mli
|
||||||
|
+++ libguestfs-1.26.10/mllib/common_utils.mli
|
||||||
|
@@ -117,3 +117,6 @@ val is_block_device : string -> bool
|
||||||
|
val is_char_device : string -> bool
|
||||||
|
val is_directory : string -> bool
|
||||||
|
(** These don't throw exceptions, unlike the [Sys] functions. *)
|
||||||
|
+
|
||||||
|
+val mkdir_p : string -> int -> unit
|
||||||
|
+(** Creates a directory, and its parents if missing. *)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 14 11:27:19 UTC 2015 - cbosdonnat@suse.com
|
||||||
|
|
||||||
|
- Create the .cache folder if it doesn't exist already.
|
||||||
|
bsc#939097.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Sep 9 12:50:11 UTC 2015 - cbosdonnat@suse.com
|
Wed Sep 9 12:50:11 UTC 2015 - cbosdonnat@suse.com
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user