mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
committed by
Richard W.M. Jones
parent
c227cbcc14
commit
943fec0399
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user