[Pkg-libvirt-commits] [libguestfs] 39/59: customize: add a "touch" operation (RHBZ#1212808)

Hilko Bengen bengen at moszumanska.debian.org
Sun May 3 21:26:37 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 22686d2cfd1793a4f2baa477650445fe2b5b4524
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Tue Apr 28 15:22:45 2015 +0200

    customize: add a "touch" operation (RHBZ#1212808)
---
 builder/cmdline.ml         | 3 ++-
 customize/customize_run.ml | 4 ++++
 generator/customize.ml     | 8 ++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index 7b119d5..ec189ad 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -312,7 +312,8 @@ read the man page virt-builder(1).
           | `Password _ | `RootPassword _ | `Scrub _ | `SSHInject _
           | `Timezone _ | `Truncate _ | `TruncateRecursive _
           | `Upload _ | `Write _ | `Chmod _
-          | `CommandsFromFile _ | `CopyIn _ | `Copy _ | `Move _ -> false
+          | `CommandsFromFile _ | `CopyIn _ | `Copy _ | `Move _
+          | `Touch _ -> 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 f2dbaa2..08cff0b 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -268,6 +268,10 @@ exec >>%s 2>&1
       if not (Timezone.set_timezone g root tz) then
         warning (f_"timezone could not be set for this type of guest")
 
+    | `Touch path ->
+      msg (f_"Running touch: %s") path;
+      g#touch path
+
     | `Update ->
       msg (f_"Updating core packages");
       let cmd = guest_update_command () in
diff --git a/generator/customize.ml b/generator/customize.ml
index 99ff4b9..2980d39 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -363,6 +363,14 @@ Set the default timezone of the guest to C<TIMEZONE>.  Use a location
 string like C<Europe/London>";
   };
 
+  { op_name = "touch";
+    op_type = String "FILE";
+    op_discrim = "`Touch";
+    op_shortdesc = "Run touch on a file";
+    op_pod_longdesc = "\
+This command performs a L<touch(1)>-like operation on C<FILE>.";
+  };
+
   { op_name = "update";
     op_type = Unit;
     op_discrim = "`Update";

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