[Pkg-libvirt-commits] [libguestfs] 367/384: customize: add --copy (RHBZ#1203817).

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 16:59:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 943fec0399ca2fc6c06fcc3d45ab74efae3188db
Author: Maros Zatko <hacxman at gmail.com>
Date:   Mon Mar 23 19:46:33 2015 +0100

    customize: add --copy (RHBZ#1203817).
    
    This adds --copy SOURCE:DEST, equivalent of calling g#cp_a src dst.
    
    RFE: RHBZ#1203817
---
 builder/cmdline.ml         |  2 +-
 customize/customize_run.ml |  4 ++++
 generator/customize.ml     | 10 ++++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index debc789..c863ad2 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -315,7 +315,7 @@ read the man page virt-builder(1).
           | `Password _ | `RootPassword _ | `Scrub _ | `SSHInject _
           | `Timezone _ | `Truncate _ | `TruncateRecursive _
           | `Upload _ | `Write _ | `Chmod _
-          | `CommandsFromFile _ | `CopyIn _ -> false
+          | `CommandsFromFile _ | `CopyIn _ | `Copy _ -> false
         ) ops.ops in
         if requires_execute_on_guest then
           error (f_"sorry, cannot run commands on a guest with a different architecture");
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index 73b4d8a..47dda72 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -171,6 +171,10 @@ exec >>%s 2>&1
        * read when their arguments are met. *)
       ()
 
+    | `Copy (src, dest) ->
+      msg (f_"Copying (in image): %s to %s") src dest;
+      g#cp_a src dest
+
     | `CopyIn (localpath, remotedir) ->
       msg (f_"Copying: %s to %s") localpath remotedir;
       g#copy_in localpath remotedir
diff --git a/generator/customize.ml b/generator/customize.ml
index bfb37f7..96c4c48 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -85,6 +85,16 @@ as if they were specified as I<--delete /some/file> on the command
 line.";
   };
 
+  { op_name = "copy";
+    op_type = StringPair "SOURCE:DEST";
+    op_discrim = "`Copy";
+    op_shortdesc = "Copy files in disk image";
+    op_pod_longdesc = "\
+Copy files or directories recursively inside the guest.
+
+Wildcards cannot be used.";
+  };
+
   { op_name = "copy-in";
     op_type = StringPair "LOCALPATH:REMOTEDIR";
     op_discrim = "`CopyIn";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list