[Pkg-libvirt-commits] [libguestfs] 368/384: customize: add --move (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 ea6d4e553598d7df5c54a0ebe8c7416286fa4ecb
Author: Maros Zatko <hacxman at gmail.com>
Date: Mon Mar 23 19:47:25 2015 +0100
customize: add --move (RHBZ#1203817).
This adds --move SOURCE:DEST, equivalent of calling g#mv 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 c863ad2..7adde02 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 _ | `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");
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index 47dda72..dbb77df 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -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
diff --git a/generator/customize.ml b/generator/customize.ml
index 96c4c48..99ff4b9 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -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";
--
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