customize: add a "touch" operation (RHBZ#1212808)

This commit is contained in:
Pino Toscano
2015-04-28 15:22:45 +02:00
parent 63e0045926
commit 22686d2cfd
3 changed files with 14 additions and 1 deletions

View File

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

View File

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

View File

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