mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
customize: add --move (RHBZ#1203817).
This adds --move SOURCE:DEST, equivalent of calling g#mv src dst. RFE: RHBZ#1203817
This commit is contained in:
committed by
Richard W.M. Jones
parent
943fec0399
commit
ea6d4e5535
@@ -315,7 +315,7 @@ read the man page virt-builder(1).
|
||||
| `Password _ | `RootPassword _ | `Scrub _ | `SSHInject _
|
||||
| `Timezone _ | `Truncate _ | `TruncateRecursive _
|
||||
| `Upload _ | `Write _ | `Chmod _
|
||||
| `CommandsFromFile _ | `CopyIn _ | `Copy _ -> false
|
||||
| `CommandsFromFile _ | `CopyIn _ | `Copy _ | `Move _ -> false
|
||||
) ops.ops in
|
||||
if requires_execute_on_guest then
|
||||
error (f_"sorry, cannot run commands on a guest with a different architecture");
|
||||
|
||||
@@ -228,6 +228,10 @@ exec >>%s 2>&1
|
||||
msg (f_"Making directory: %s") dir;
|
||||
g#mkdir_p dir
|
||||
|
||||
| `Move (src, dest) ->
|
||||
msg (f_"Moving: %s -> %s") src dest;
|
||||
g#mv src dest
|
||||
|
||||
| `Password (user, pw) ->
|
||||
set_password user pw
|
||||
|
||||
|
||||
@@ -222,6 +222,16 @@ This uses S<C<mkdir -p>> so any intermediate directories are created,
|
||||
and it also works if the directory already exists.";
|
||||
};
|
||||
|
||||
{ op_name = "move";
|
||||
op_type = StringPair "SOURCE:DEST";
|
||||
op_discrim = "`Move";
|
||||
op_shortdesc = "Move files in disk image";
|
||||
op_pod_longdesc = "\
|
||||
Move files or directories inside the guest.
|
||||
|
||||
Wildcards cannot be used.";
|
||||
};
|
||||
|
||||
{ op_name = "password";
|
||||
op_type = UserPasswordSelector "USER:SELECTOR";
|
||||
op_discrim = "`Password";
|
||||
|
||||
Reference in New Issue
Block a user