mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
customize: add a "touch" operation (RHBZ#1212808)
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user