summaryrefslogtreecommitdiffstats
path: root/sysprep
diff options
context:
space:
mode:
Diffstat (limited to 'sysprep')
-rw-r--r--sysprep/Makefile.am5
-rw-r--r--sysprep/main.ml79
-rw-r--r--sysprep/sysprep_operation.ml18
-rw-r--r--sysprep/sysprep_operation_bash_history.ml7
-rw-r--r--sysprep/sysprep_operation_cron_spool.ml3
-rw-r--r--sysprep/sysprep_operation_dhcp_client_state.ml3
-rw-r--r--sysprep/sysprep_operation_dhcp_server_state.ml3
-rw-r--r--sysprep/sysprep_operation_dovecot_data.ml3
-rw-r--r--sysprep/sysprep_operation_flag_reconfiguration.ml7
-rw-r--r--sysprep/sysprep_operation_hostname.ml11
-rw-r--r--sysprep/sysprep_operation_logfiles.ml7
-rw-r--r--sysprep/sysprep_operation_mail_spool.ml3
-rw-r--r--sysprep/sysprep_operation_net_hwaddr.ml7
-rw-r--r--sysprep/sysprep_operation_package_manager_cache.ml3
-rw-r--r--sysprep/sysprep_operation_random_seed.ml7
-rw-r--r--sysprep/sysprep_operation_rhn_systemid.ml3
-rw-r--r--sysprep/sysprep_operation_samba_db_log.ml3
-rw-r--r--sysprep/sysprep_operation_script.ml23
-rw-r--r--sysprep/sysprep_operation_smolt_uuid.ml3
-rw-r--r--sysprep/sysprep_operation_ssh_hostkeys.ml7
-rw-r--r--sysprep/sysprep_operation_ssh_userdir.ml7
-rw-r--r--sysprep/sysprep_operation_sssd_db_log.ml3
-rw-r--r--sysprep/sysprep_operation_udev_persistent_net.ml7
-rw-r--r--sysprep/sysprep_operation_user_account.ml10
-rw-r--r--sysprep/sysprep_operation_utmp.ml7
-rw-r--r--sysprep/sysprep_operation_yum_uuid.ml7
26 files changed, 141 insertions, 105 deletions
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index 2424071e..38acfd2c 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -31,6 +31,7 @@ CLEANFILES = \
# Alphabetical order.
SOURCES = \
main.ml \
+ sysprep_gettext.ml \
sysprep_operation.ml \
sysprep_operation.mli \
sysprep_operation_bash_history.ml \
@@ -62,6 +63,7 @@ if HAVE_OCAML
# Note this list must be in dependency order.
OBJECTS = \
+ sysprep_gettext.cmx \
utils.cmx \
sysprep_operation.cmx \
sysprep_operation_bash_history.cmx \
@@ -95,6 +97,9 @@ bin_SCRIPTS = virt-sysprep
# option to be passed to gcc, so we don't try linking against an
# installed copy of libguestfs.
OCAMLPACKAGES = -package unix -I $(top_builddir)/src/.libs -I $(top_builddir)/ocaml
+if HAVE_OCAML_PKG_GETTEXT
+OCAMLPACKAGES += -package gettext-stub
+endif
OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
diff --git a/sysprep/main.ml b/sysprep/main.ml
index 12238162..ca5664de 100644
--- a/sysprep/main.ml
+++ b/sysprep/main.ml
@@ -19,6 +19,8 @@
open Unix
open Printf
+open Sysprep_gettext.Gettext
+
open Utils
module G = Guestfs
@@ -53,7 +55,7 @@ let debug_gc, operations, g, selinux_relabel, quiet =
files := (file, format) :: !files
and set_domain dom =
if !domain <> None then (
- eprintf "%s: --domain option can only be given once\n" prog;
+ eprintf (f_"%s: --domain option can only be given once\n") prog;
exit 1
);
domain := Some dom
@@ -65,11 +67,11 @@ let debug_gc, operations, g, selinux_relabel, quiet =
exit 0
and set_enable ops =
if !operations <> None then (
- eprintf "%s: --enable option can only be given once\n" prog;
+ eprintf (f_"%s: --enable option can only be given once\n") prog;
exit 1
);
if ops = "" then (
- eprintf "%s: you cannot pass an empty argument to --enable\n" prog;
+ eprintf (f_"%s: you cannot pass an empty argument to --enable\n") prog;
exit 1
);
let ops = string_split "," ops in
@@ -77,7 +79,8 @@ let debug_gc, operations, g, selinux_relabel, quiet =
fun opset op_name ->
try Sysprep_operation.add_to_set op_name opset
with Not_found ->
- eprintf "%s: --enable: '%s' is not a known operation\n" prog op_name;
+ eprintf (f_"%s: --enable: '%s' is not a known operation\n")
+ prog op_name;
exit 1
) Sysprep_operation.empty_set ops in
operations := Some opset
@@ -91,38 +94,38 @@ let debug_gc, operations, g, selinux_relabel, quiet =
in
let basic_args = [
- "-a", Arg.String add_file, "file Add disk image file";
- "--add", Arg.String add_file, "file Add disk image file";
- "-c", Arg.Set_string libvirturi, "uri Set libvirt URI";
- "--connect", Arg.Set_string libvirturi, "uri Set libvirt URI";
- "--debug-gc", Arg.Set debug_gc, " Debug GC and memory allocations (internal)";
- "-d", Arg.String set_domain, "domain Set libvirt guest name";
- "--domain", Arg.String set_domain, "domain Set libvirt guest name";
- "-n", Arg.Set dryrun, " Perform a dry run";
- "--dryrun", Arg.Set dryrun, " Perform a dry run";
- "--dry-run", Arg.Set dryrun, " Perform a dry run";
- "--dump-pod", Arg.Unit dump_pod, " Dump POD (internal)";
- "--dump-pod-options", Arg.Unit dump_pod_options, " Dump POD for options (internal)";
- "--enable", Arg.String set_enable, "operations Enable specific operations";
- "--format", Arg.Set_string format, "format Set format (default: auto)";
- "--list-operations", Arg.Unit list_operations, " List supported operations";
- "-q", Arg.Set quiet, " Don't print log messages";
- "--quiet", Arg.Set quiet, " Don't print log messages";
- "--selinux-relabel", Arg.Unit force_selinux_relabel, " Force SELinux relabel";
- "--no-selinux-relabel", Arg.Unit no_force_selinux_relabel, " Never do SELinux relabel";
- "-v", Arg.Set verbose, " Enable debugging messages";
- "--verbose", Arg.Set verbose, " Enable debugging messages";
- "-V", Arg.Unit display_version, " Display version and exit";
- "--version", Arg.Unit display_version, " Display version and exit";
- "-x", Arg.Set trace, " Enable tracing of libguestfs calls";
+ "-a", Arg.String add_file, s_"file" ^ " " ^ s_"Add disk image file";
+ "--add", Arg.String add_file, s_"file" ^ " " ^ s_"Add disk image file";
+ "-c", Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
+ "--connect", Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
+ "--debug-gc", Arg.Set debug_gc, " " ^ s_"Debug GC and memory allocations (internal)";
+ "-d", Arg.String set_domain, s_"domain" ^ " " ^ s_"Set libvirt guest name";
+ "--domain", Arg.String set_domain, s_"domain" ^ " " ^ s_"Set libvirt guest name";
+ "-n", Arg.Set dryrun, " " ^ s_"Perform a dry run";
+ "--dryrun", Arg.Set dryrun, " " ^ s_"Perform a dry run";
+ "--dry-run", Arg.Set dryrun, " " ^ s_"Perform a dry run";
+ "--dump-pod", Arg.Unit dump_pod, " " ^ s_"Dump POD (internal)";
+ "--dump-pod-options", Arg.Unit dump_pod_options, " " ^ s_"Dump POD for options (internal)";
+ "--enable", Arg.String set_enable, s_"operations" ^ " " ^ s_"Enable specific operations";
+ "--format", Arg.Set_string format, s_"format" ^ " " ^ s_"Set format (default: auto)";
+ "--list-operations", Arg.Unit list_operations, " " ^ s_"List supported operations";
+ "-q", Arg.Set quiet, " " ^ s_"Don't print log messages";
+ "--quiet", Arg.Set quiet, " " ^ s_"Don't print log messages";
+ "--selinux-relabel", Arg.Unit force_selinux_relabel, " " ^ s_"Force SELinux relabel";
+ "--no-selinux-relabel", Arg.Unit no_force_selinux_relabel, " " ^ s_"Never do SELinux relabel";
+ "-v", Arg.Set verbose, " " ^ s_"Enable debugging messages";
+ "--verbose", Arg.Set verbose, " " ^ s_"Enable debugging messages";
+ "-V", Arg.Unit display_version, " " ^ s_"Display version and exit";
+ "--version", Arg.Unit display_version, " " ^ s_"Display version and exit";
+ "-x", Arg.Set trace, " " ^ s_"Enable tracing of libguestfs calls";
] in
let args = basic_args @ Sysprep_operation.extra_args () in
let args =
List.sort (fun (a,_,_) (b,_,_) -> compare_command_line_args a b) args in
let argspec = Arg.align args in
- let anon_fun _ = raise (Arg.Bad "extra parameter on the command line") in
+ let anon_fun _ = raise (Arg.Bad (s_"extra parameter on the command line")) in
let usage_msg =
- sprintf "\
+ sprintf (f_"\
%s: reset or unconfigure a virtual machine so clones can be made
virt-sysprep [--options] -d domname
@@ -131,7 +134,7 @@ let debug_gc, operations, g, selinux_relabel, quiet =
A short summary of the options is given below. For detailed help please
read the man page virt-sysprep(1).
-"
+")
prog in
Arg.parse argspec anon_fun usage_msg;
@@ -142,8 +145,8 @@ read the man page virt-sysprep(1).
let add =
match files, domain with
| [], None ->
- eprintf "%s: you must give either -a or -d options\n" prog;
- eprintf "Read virt-sysprep(1) man page for further information.\n";
+ eprintf (f_"%s: you must give either -a or -d options\n") prog;
+ eprintf (f_"Read virt-sysprep(1) man page for further information.\n");
exit 1
| [], Some dom ->
fun (g : Guestfs.guestfs) readonly ->
@@ -151,8 +154,8 @@ read the man page virt-sysprep(1).
let readonlydisk = "ignore" (* ignore CDs, data drives *) in
ignore (g#add_domain ~readonly ?libvirturi ~allowuuid ~readonlydisk dom)
| _, Some _ ->
- eprintf "%s: you cannot give -a and -d options together\n" prog;
- eprintf "Read virt-sysprep(1) man page for further information.\n";
+ eprintf (f_"%s: you cannot give -a and -d options together\n") prog;
+ eprintf (f_"Read virt-sysprep(1) man page for further information.\n");
exit 1
| files, None ->
fun g readonly ->
@@ -172,7 +175,7 @@ read the man page virt-sysprep(1).
let verbose = !verbose in
if not quiet then
- printf "Examining the guest ...\n%!";
+ printf (f_"Examining the guest ...\n%!");
(* Connect to libguestfs. *)
let g = new G.guestfs () in
@@ -187,7 +190,7 @@ let () =
(* Inspection. *)
match Array.to_list (g#inspect_os ()) with
| [] ->
- eprintf "%s: no operating systems were found in the guest image\n" prog;
+ eprintf (f_"%s: no operating systems were found in the guest image\n") prog;
exit 1
| roots ->
List.iter (
@@ -201,7 +204,7 @@ let () =
List.iter (
fun (mp, dev) ->
try g#mount dev mp
- with Guestfs.Error msg -> eprintf "%s (ignored)\n" msg
+ with Guestfs.Error msg -> eprintf (f_"%s (ignored)\n") msg
) mps;
(* Perform the operations. *)
diff --git a/sysprep/sysprep_operation.ml b/sysprep/sysprep_operation.ml
index d3a12fef..e22d3a2b 100644
--- a/sysprep/sysprep_operation.ml
+++ b/sysprep/sysprep_operation.ml
@@ -20,6 +20,8 @@ open Utils
open Printf
+open Sysprep_gettext.Gettext
+
type flag = [ `Created_files ]
type operation = {
@@ -66,7 +68,7 @@ and check_no_dupes ops =
List.fold_left (
fun opset op ->
if OperationSet.mem op opset then (
- eprintf "virt-sysprep: duplicate operation name (%s)\n" op.name;
+ eprintf (f_"virt-sysprep: duplicate operation name (%s)\n") op.name;
exit 1
);
add_to_set op.name opset
@@ -75,23 +77,24 @@ and check_no_dupes ops =
and check op =
let n = String.length op.name in
if n = 0 then (
- eprintf "virt-sysprep: operation name is an empty string\n";
+ eprintf (f_"virt-sysprep: operation name is an empty string\n");
exit 1;
);
for i = 0 to n-1 do
match String.unsafe_get op.name i with
| 'a'..'z' | 'A'..'Z' | '0'..'9' | '-' -> ()
| c ->
- eprintf "virt-sysprep: disallowed character (%c) in operation name\n" c;
+ eprintf (f_"virt-sysprep: disallowed character (%c) in operation name\n")
+ c;
exit 1
done;
let n = String.length op.heading in
if n = 0 then (
- eprintf "virt-sysprep: operation %s has no heading\n" op.name;
+ eprintf (f_"virt-sysprep: operation %s has no heading\n") op.name;
exit 1
);
if op.heading.[n-1] = '\n' || op.heading.[n-1] = '.' then (
- eprintf "virt-sysprep: heading for %s must not end with newline or period\n"
+ eprintf (f_"virt-sysprep: heading for %s must not end with newline or period\n")
op.name;
exit 1
);
@@ -100,11 +103,12 @@ and check op =
| Some description ->
let n = String.length description in
if n = 0 then (
- eprintf "virt-sysprep: operation %s has no POD\n" op.name;
+ eprintf (f_"virt-sysprep: operation %s has no POD\n") op.name;
exit 1
);
if description.[n-1] = '\n' then (
- eprintf "virt-sysprep: POD for %s must not end with newline\n" op.name;
+ eprintf (f_"virt-sysprep: POD for %s must not end with newline\n")
+ op.name;
exit 1
)
)
diff --git a/sysprep/sysprep_operation_bash_history.ml b/sysprep/sysprep_operation_bash_history.ml
index dbd6c500..56fd9f3b 100644
--- a/sysprep/sysprep_operation_bash_history.ml
+++ b/sysprep/sysprep_operation_bash_history.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -35,10 +36,10 @@ let bash_history_perform g root =
let bash_history_op = {
name = "bash-history";
enabled_by_default = true;
- heading = "Remove the bash history in the guest";
- pod_description = Some "\
+ heading = s_"Remove the bash history in the guest";
+ pod_description = Some (s_"\
Remove the bash history of user \"root\" and any other users
-who have a C<.bash_history> file in their home directory.";
+who have a C<.bash_history> file in their home directory.");
extra_args = [];
perform = bash_history_perform;
}
diff --git a/sysprep/sysprep_operation_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml
index daa3c683..20f1b205 100644
--- a/sysprep/sysprep_operation_cron_spool.ml
+++ b/sysprep/sysprep_operation_cron_spool.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -27,7 +28,7 @@ let cron_spool_perform g root =
let cron_spool_op = {
name = "cron-spool";
enabled_by_default = true;
- heading = "Remove user at-jobs and cron-jobs";
+ heading = s_"Remove user at-jobs and cron-jobs";
pod_description = None;
extra_args = [];
perform = cron_spool_perform;
diff --git a/sysprep/sysprep_operation_dhcp_client_state.ml b/sysprep/sysprep_operation_dhcp_client_state.ml
index 279893d8..585424cd 100644
--- a/sysprep/sysprep_operation_dhcp_client_state.ml
+++ b/sysprep/sysprep_operation_dhcp_client_state.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -32,7 +33,7 @@ let dhcp_client_state_perform g root =
let dhcp_client_state_op = {
name = "dhcp-client-state";
enabled_by_default = true;
- heading = "Remove DHCP client leases";
+ heading = s_"Remove DHCP client leases";
pod_description = None;
extra_args = [];
perform = dhcp_client_state_perform;
diff --git a/sysprep/sysprep_operation_dhcp_server_state.ml b/sysprep/sysprep_operation_dhcp_server_state.ml
index b28aa69f..7629dee3 100644
--- a/sysprep/sysprep_operation_dhcp_server_state.ml
+++ b/sysprep/sysprep_operation_dhcp_server_state.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -27,7 +28,7 @@ let dhcp_server_state_perform g root =
let dhcp_server_state_op = {
name = "dhcp-server-state";
enabled_by_default = true;
- heading = "Remove DHCP server leases";
+ heading = s_"Remove DHCP server leases";
pod_description = None;
extra_args = [];
perform = dhcp_server_state_perform;
diff --git a/sysprep/sysprep_operation_dovecot_data.ml b/sysprep/sysprep_operation_dovecot_data.ml
index 65825ba3..14cbe8d9 100644
--- a/sysprep/sysprep_operation_dovecot_data.ml
+++ b/sysprep/sysprep_operation_dovecot_data.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -34,7 +35,7 @@ let dovecot_data_perform g root =
let dovecot_data_op = {
name = "dovecot-data";
enabled_by_default = true;
- heading = "Remove Dovecot (mail server) data";
+ heading = s_"Remove Dovecot (mail server) data";
pod_description = None;
extra_args = [];
perform = dovecot_data_perform;
diff --git a/sysprep/sysprep_operation_flag_reconfiguration.ml b/sysprep/sysprep_operation_flag_reconfiguration.ml
index 755b1d01..0efee02e 100644
--- a/sysprep/sysprep_operation_flag_reconfiguration.ml
+++ b/sysprep/sysprep_operation_flag_reconfiguration.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -31,10 +32,10 @@ let flag_reconfiguration g root =
let flag_reconfiguration_op = {
name = "flag-reconfiguration";
enabled_by_default = false;
- heading = "Flag the system for reconfiguration";
- pod_description = Some "\
+ heading = s_"Flag the system for reconfiguration";
+ pod_description = Some (s_"\
Note that this may require user intervention when the
-guest is booted.";
+guest is booted.");
extra_args = [];
perform = flag_reconfiguration;
}
diff --git a/sysprep/sysprep_operation_hostname.ml b/sysprep/sysprep_operation_hostname.ml
index 395691c5..f832a18a 100644
--- a/sysprep/sysprep_operation_hostname.ml
+++ b/sysprep/sysprep_operation_hostname.ml
@@ -20,6 +20,7 @@ open Printf
open Utils
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -53,16 +54,16 @@ let hostname_perform g root =
let hostname_op = {
name = "hostname";
enabled_by_default = true;
- heading = "Change the hostname of the guest";
- pod_description = Some "\
+ heading = s_"Change the hostname of the guest";
+ pod_description = Some (s_"\
This operation changes the hostname of the guest to the value
given in the I<--hostname> parameter.
If the I<--hostname> parameter is not given, then the hostname is changed
-to C<localhost.localdomain>.";
+to C<localhost.localdomain>.");
extra_args = [
- ("--hostname", Arg.Set_string hostname, "hostname New hostname"),
- "\
+ ("--hostname", Arg.Set_string hostname, s_"hostname" ^ " " ^ s_"New hostname"),
+ s_"\
Change the hostname. If not given, defaults to C<localhost.localdomain>."
];
perform = hostname_perform;
diff --git a/sysprep/sysprep_operation_logfiles.ml b/sysprep/sysprep_operation_logfiles.ml
index cf728037..aa3c986c 100644
--- a/sysprep/sysprep_operation_logfiles.ml
+++ b/sysprep/sysprep_operation_logfiles.ml
@@ -19,6 +19,7 @@
open Printf
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -81,12 +82,12 @@ let logfiles_perform g root =
let logfiles_op = {
name = "logfiles";
enabled_by_default = true;
- heading = "Remove many log files from the guest";
+ heading = s_"Remove many log files from the guest";
pod_description = Some (
- sprintf "\
+ sprintf (f_"\
On Linux the following files are removed:
-%s" globs_as_pod);
+%s") globs_as_pod);
extra_args = [];
perform = logfiles_perform;
}
diff --git a/sysprep/sysprep_operation_mail_spool.ml b/sysprep/sysprep_operation_mail_spool.ml
index 25f42727..11dd292c 100644
--- a/sysprep/sysprep_operation_mail_spool.ml
+++ b/sysprep/sysprep_operation_mail_spool.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -32,7 +33,7 @@ let mail_spool_perform g root =
let mail_spool_op = {
name = "mail-spool";
enabled_by_default = true;
- heading = "Remove email from the local mail spool directory";
+ heading = s_"Remove email from the local mail spool directory";
pod_description = None;
extra_args = [];
perform = mail_spool_perform;
diff --git a/sysprep/sysprep_operation_net_hwaddr.ml b/sysprep/sysprep_operation_net_hwaddr.ml
index 57ca2b98..52770174 100644
--- a/sysprep/sysprep_operation_net_hwaddr.ml
+++ b/sysprep/sysprep_operation_net_hwaddr.ml
@@ -18,6 +18,7 @@
open Utils
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -45,10 +46,10 @@ let net_hwaddr_perform g root =
let net_hwaddr_op = {
name = "net-hwaddr";
enabled_by_default = true;
- heading = "Remove HWADDR (hard-coded MAC address) configuration";
- pod_description = Some "\
+ heading = s_"Remove HWADDR (hard-coded MAC address) configuration";
+ pod_description = Some (s_"\
For Fedora and Red Hat Enterprise Linux,
-this is removed from C<ifcfg-*> files.";
+this is removed from C<ifcfg-*> files.");
extra_args = [];
perform = net_hwaddr_perform;
}
diff --git a/sysprep/sysprep_operation_package_manager_cache.ml b/sysprep/sysprep_operation_package_manager_cache.ml
index 80eefa31..957b10d2 100644
--- a/sysprep/sysprep_operation_package_manager_cache.ml
+++ b/sysprep/sysprep_operation_package_manager_cache.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -36,7 +37,7 @@ let package_manager_cache_perform g root =
let package_manager_cache_op = {
name = "package-manager-cache";
enabled_by_default = true;
- heading = "Remove package manager cache";
+ heading = s_"Remove package manager cache";
pod_description = None;
extra_args = [];
perform = package_manager_cache_perform;
diff --git a/sysprep/sysprep_operation_random_seed.ml b/sysprep/sysprep_operation_random_seed.ml
index c6e8d858..5fbe9a41 100644
--- a/sysprep/sysprep_operation_random_seed.ml
+++ b/sysprep/sysprep_operation_random_seed.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -46,12 +47,12 @@ let random_seed_perform g root =
let random_seed_op = {
name = "random-seed";
enabled_by_default = true;
- heading = "Generate random seed for guest";
- pod_description = Some "\
+ heading = s_"Generate random seed for guest";
+ pod_description = Some (s_"\
Write some random bytes from the host into the random seed file of the
guest.
-See L</RANDOM SEED> below.";
+See L</RANDOM SEED> below.");
extra_args = [];
perform = random_seed_perform;
}
diff --git a/sysprep/sysprep_operation_rhn_systemid.ml b/sysprep/sysprep_operation_rhn_systemid.ml
index 9d9f2f8b..c86de7a3 100644
--- a/sysprep/sysprep_operation_rhn_systemid.ml
+++ b/sysprep/sysprep_operation_rhn_systemid.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -33,7 +34,7 @@ let rhn_systemid_perform g root =
let rhn_systemid_op = {
name = "rhn-systemid";
enabled_by_default = true;
- heading = "Remove the RHN system ID";
+ heading = s_"Remove the RHN system ID";
pod_description = None;
extra_args = [];
perform = rhn_systemid_perform;
diff --git a/sysprep/sysprep_operation_samba_db_log.ml b/sysprep/sysprep_operation_samba_db_log.ml
index a02ba9de..6bd67998 100644
--- a/sysprep/sysprep_operation_samba_db_log.ml
+++ b/sysprep/sysprep_operation_samba_db_log.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -43,7 +44,7 @@ let samba_db_log_perform g root =
let samba_db_log_op = {
name = "samba-db-log";
enabled_by_default = true;
- heading = "Remove the database and log files of Samba";
+ heading = s_"Remove the database and log files of Samba";
pod_description = None;
extra_args = [];
perform = samba_db_log_perform;
diff --git a/sysprep/sysprep_operation_script.ml b/sysprep/sysprep_operation_script.ml
index bcbba739..1f33c053 100644
--- a/sysprep/sysprep_operation_script.ml
+++ b/sysprep/sysprep_operation_script.ml
@@ -21,13 +21,14 @@ open Unix
open Utils
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
let scriptdir = ref None
let set_scriptdir dir =
if !scriptdir <> None then (
- eprintf "virt-sysprep: --scriptdir cannot be used more than once\n";
+ eprintf (f_"virt-sysprep: --scriptdir cannot be used more than once\n");
exit 1
);
scriptdir := Some dir
@@ -61,17 +62,17 @@ let rec script_perform (g : Guestfs.guestfs) root =
match snd (waitpid [] pid) with
| WEXITED 0 -> true
| WEXITED i ->
- eprintf "virt-sysprep: script: failed (code %d)\n" i;
+ eprintf (f_"virt-sysprep: script: failed (code %d)\n") i;
false
| WSIGNALED i
| WSTOPPED i ->
- eprintf "virt-sysprep: script: killed by signal (%d)\n" i;
+ eprintf (f_"virt-sysprep: script: killed by signal (%d)\n") i;
false in
(* Remote temporary directory / mountpoint. *)
if cleanup then rmdir scriptdir;
- if not ok then failwith "script failed"
+ if not ok then failwith (s_"script failed")
);
[]
@@ -114,8 +115,8 @@ trap cleanup INT TERM QUIT EXIT ERR\n"
let script_op = {
name = "script";
enabled_by_default = true;
- heading = "Run arbitrary scripts against the guest";
- pod_description = Some "\
+ heading = s_"Run arbitrary scripts against the guest";
+ pod_description = Some (s_"\
The C<script> module lets you run arbitrary shell scripts or programs
against the guest.
@@ -133,10 +134,10 @@ guest's DNS configuration file, but C<rm /etc/resolv.conf> would
(try to) remove the host's file.
Normally a temporary mount point for the guest is used, but you
-can choose a specific one by using the I<--scriptdir> parameter.";
+can choose a specific one by using the I<--scriptdir> parameter.");
extra_args = [
- ("--scriptdir", Arg.String set_scriptdir, "dir Mount point on host"),
- "\
+ ("--scriptdir", Arg.String set_scriptdir, s_"dir" ^ " " ^ s_"Mount point on host"),
+ s_"\
The mount point (an empty directory on the host) used when
the C<script> operation is enabled and one or more scripts
are specified using I<--script> parameter(s).
@@ -145,8 +146,8 @@ B<Note:> C<scriptdir> B<must> be an absolute path.
If I<--scriptdir> is not specified then a temporary mountpoint
will be created.";
- ("--script", Arg.String add_script, "script Script or program to run on guest"),
- "\
+ ("--script", Arg.String add_script, s_"script" ^ " " ^ s_"Script or program to run on guest"),
+ s_"\
Run the named C<script> (a shell script or program) against the
guest. The script can be any program on the host. The script's
current directory will be the guest's root directory.
diff --git a/sysprep/sysprep_operation_smolt_uuid.ml b/sysprep/sysprep_operation_smolt_uuid.ml
index 85e788ec..25f73725 100644
--- a/sysprep/sysprep_operation_smolt_uuid.ml
+++ b/sysprep/sysprep_operation_smolt_uuid.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -37,7 +38,7 @@ let smolt_uuid_perform g root =
let smolt_uuid_op = {
name = "smolt-uuid";
enabled_by_default = true;
- heading = "Remove the Smolt hardware UUID";
+ heading = s_"Remove the Smolt hardware UUID";
pod_description = None;
extra_args = [];
perform = smolt_uuid_perform;
diff --git a/sysprep/sysprep_operation_ssh_hostkeys.ml b/sysprep/sysprep_operation_ssh_hostkeys.ml
index db45b44c..62ea32e9 100644
--- a/sysprep/sysprep_operation_ssh_hostkeys.ml
+++ b/sysprep/sysprep_operation_ssh_hostkeys.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -32,8 +33,8 @@ let ssh_hostkeys_perform g root =
let ssh_hostkeys_op = {
name = "ssh-hostkeys";
enabled_by_default = true;
- heading = "Remove the SSH host keys in the guest";
- pod_description = Some "\
+ heading = s_"Remove the SSH host keys in the guest";
+ pod_description = Some (s_"\
The SSH host keys are regenerated (differently) next time the guest is
booted.
@@ -43,7 +44,7 @@ you a stark warning about the host key changing:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!";
+ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!");
extra_args = [];
perform = ssh_hostkeys_perform;
}
diff --git a/sysprep/sysprep_operation_ssh_userdir.ml b/sysprep/sysprep_operation_ssh_userdir.ml
index 9ea10171..3141c9e2 100644
--- a/sysprep/sysprep_operation_ssh_userdir.ml
+++ b/sysprep/sysprep_operation_ssh_userdir.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -35,10 +36,10 @@ let ssh_userdir_perform g root =
let ssh_userdir_op = {
name = "ssh-userdir";
enabled_by_default = true;
- heading = "Remove \".ssh\" directories in the guest";
- pod_description = Some "\
+ heading = s_"Remove \".ssh\" directories in the guest";
+ pod_description = Some (s_"\
Remove the C<.ssh> directory of user \"root\" and any other
-users who have a C<.ssh> directory in their home directory.";
+users who have a C<.ssh> directory in their home directory.");
extra_args = [];
perform = ssh_userdir_perform;
}
diff --git a/sysprep/sysprep_operation_sssd_db_log.ml b/sysprep/sysprep_operation_sssd_db_log.ml
index 79e69508..8b1923a7 100644
--- a/sysprep/sysprep_operation_sssd_db_log.ml
+++ b/sysprep/sysprep_operation_sssd_db_log.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -41,7 +42,7 @@ let sssd_db_log_perform g root =
let sssd_db_log_op = {
name = "sssd-db-log";
enabled_by_default = true;
- heading = "Remove the database and log files of sssd";
+ heading = s_"Remove the database and log files of sssd";
pod_description = None;
extra_args = [];
perform = sssd_db_log_perform;
diff --git a/sysprep/sysprep_operation_udev_persistent_net.ml b/sysprep/sysprep_operation_udev_persistent_net.ml
index 95133d1f..6de2589e 100644
--- a/sysprep/sysprep_operation_udev_persistent_net.ml
+++ b/sysprep/sysprep_operation_udev_persistent_net.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -32,15 +33,15 @@ let udev_persistent_net_perform g root =
let udev_persistent_net_op = {
name = "udev-persistent-net";
enabled_by_default = true;
- heading = "Remove udev persistent net rules";
- pod_description = Some "\
+ heading = s_"Remove udev persistent net rules";
+ pod_description = Some (s_"\
Remove udev persistent net rules which map the guest's existing MAC
address to a fixed ethernet device (eg. eth0).
After a guest is cloned, the MAC address usually changes. Since the
old MAC address occupies the old name (eg. eth0), this means the fresh
MAC address is assigned to a new name (eg. eth1) and this is usually
-undesirable. Erasing the udev persistent net rules avoids this.";
+undesirable. Erasing the udev persistent net rules avoids this.");
extra_args = [];
perform = udev_persistent_net_perform;
}
diff --git a/sysprep/sysprep_operation_user_account.ml b/sysprep/sysprep_operation_user_account.ml
index 63757051..02201eb3 100644
--- a/sysprep/sysprep_operation_user_account.ml
+++ b/sysprep/sysprep_operation_user_account.ml
@@ -18,9 +18,11 @@
open Printf
-open Sysprep_operation
open Utils
+open Sysprep_operation
+open Sysprep_gettext.Gettext
+
module G = Guestfs
let user_account_perform g root =
@@ -59,10 +61,10 @@ let user_account_perform g root =
let user_account_op = {
name = "user-account";
enabled_by_default = false;
- heading = "Remove the user accounts in the guest";
- pod_description = Some "\
+ heading = s_"Remove the user accounts in the guest";
+ pod_description = Some (s_"\
Remove all the user accounts and their home directories.
-The \"root\" account is not removed.";
+The \"root\" account is not removed.");
extra_args = [];
perform = user_account_perform;
}
diff --git a/sysprep/sysprep_operation_utmp.ml b/sysprep/sysprep_operation_utmp.ml
index cdcf01f8..c4a548d5 100644
--- a/sysprep/sysprep_operation_utmp.ml
+++ b/sysprep/sysprep_operation_utmp.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -31,11 +32,11 @@ let utmp_perform g root =
let utmp_op = {
name = "utmp";
enabled_by_default = true;
- heading = "Remove the utmp file";
- pod_description = Some "\
+ heading = s_"Remove the utmp file";
+ pod_description = Some (s_"\
This file records who is currently logged in on a machine. In modern
Linux distros it is stored in a ramdisk and hence not part of the
-virtual machine's disk, but it was stored on disk in older distros.";
+virtual machine's disk, but it was stored on disk in older distros.");
extra_args = [];
perform = utmp_perform;
}
diff --git a/sysprep/sysprep_operation_yum_uuid.ml b/sysprep/sysprep_operation_yum_uuid.ml
index cc5fec1e..ec69ca50 100644
--- a/sysprep/sysprep_operation_yum_uuid.ml
+++ b/sysprep/sysprep_operation_yum_uuid.ml
@@ -17,6 +17,7 @@
*)
open Sysprep_operation
+open Sysprep_gettext.Gettext
module G = Guestfs
@@ -31,10 +32,10 @@ let yum_uuid_perform g root =
let yum_uuid_op = {
name = "yum-uuid";
enabled_by_default = true;
- heading = "Remove the yum UUID";
- pod_description = Some "\
+ heading = s_"Remove the yum UUID";
+ pod_description = Some (s_"\
Yum creates a fresh UUID the next time it runs when it notices that the
-original UUID has been erased.";
+original UUID has been erased.");
extra_args = [];
perform = yum_uuid_perform;
}