customize: add --copy (RHBZ#1203817).

This adds --copy SOURCE:DEST, equivalent of calling g#cp_a src dst.

RFE: RHBZ#1203817
This commit is contained in:
Maros Zatko
2015-03-23 19:46:33 +01:00
committed by Richard W.M. Jones
parent c227cbcc14
commit 943fec0399
3 changed files with 15 additions and 1 deletions

View File

@@ -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");

View File

@@ -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

View File

@@ -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";