Rename script back to virt-p2v.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 25 Mar 2008 16:37:24 +0000 (16:37 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 25 Mar 2008 16:37:24 +0000 (16:37 +0000)
Workaround problems with po generation in an alternate way.

.hgignore
Makefile.in
po/Makefile.in
po/POTFILES
po/virt-p2v.pot
virt-p2v [moved from virt-p2v.ml with 99% similarity, mode: 0755]
virt-p2v.spec.in

index ecf8145..1dab2a2 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -18,7 +18,8 @@
 ^localrepo/
 ^rpmbuild/
 ^p2vrepo/
-^virt-p2v.spec$
-^virt-p2v$
+^virt-p2v\.spec$
+^\.tmp\.virt-p2v\.ml$
 ^po/Makefile$
-^po/.*\.mo$
\ No newline at end of file
+^po/.*\.mo$
+^po/.*\.po\.bak$
\ No newline at end of file
index bf1e66c..8d29f45 100644 (file)
@@ -83,13 +83,6 @@ p2vrepo/$(VIRTP2V_RPM): \
        cp rpmbuild/RPMS/noarch/$(VIRTP2V_RPM) p2vrepo
        createrepo p2vrepo
 
-# Make the final script.
-
-virt-p2v: virt-p2v.ml0 virt-p2v.ml
-       rm -f $@
-       cat $^ > $@
-       chmod 0555 $@
-
 # Run live CD under qemu.
 
 ifeq ($(HAVE_QEMU_KVM),qemu-kvm)
@@ -161,7 +154,7 @@ checkrpm:
 # Clean.
 
 clean:
-       rm -f *~ core virt-p2v pod2htm*
+       rm -f core *~ pod2htm*
 
 distclean: clean
        rm -rf autom4te.cache config.log config.status configure \
index 46f1a13..25b2609 100644 (file)
@@ -34,7 +34,13 @@ POFILES              = $(addsuffix .po,$(LINGUAS))
 MOFILES                = $(addsuffix .mo,$(LINGUAS))
 POTFILE                = $(OCAML_GETTEXT_PACKAGE).pot
 
-all: $(MOFILES) $(POTFILE)
+all: ../.tmp.virt-p2v.ml $(MOFILES) $(POTFILE)
+
+# This is just a hack because ocaml-gettext doesn't know what to
+# do with a file that doesn't end in a *.ml extension, and even
+# if renamed it doesn't work because of the toplevel directives.
+../.tmp.virt-p2v.ml: ../virt-p2v
+       grep -v '^#' < $< > $@
 
 install: install-po
 
index 051324f..e77c12f 100644 (file)
@@ -1 +1 @@
-../virt-p2v.ml
\ No newline at end of file
+../.tmp.virt-p2v.ml
\ No newline at end of file
index 62a0188..d62e069 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-22 15:53+0000\n"
+"POT-Creation-Date: 2008-03-25 16:34+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,327 +17,331 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
 
-#: ../virt-p2v.ml:1876
+#: ../.tmp.virt-p2v.ml:1899
 msgid " (about %.0f minutes remaining)"
 msgstr ""
 
-#: ../virt-p2v.ml:1879
+#: ../.tmp.virt-p2v.ml:1902
 msgid " (about %.0f seconds remaining)"
 msgstr ""
 
-#: ../virt-p2v.ml:1902
+#: ../.tmp.virt-p2v.ml:1925
 msgid "%s has finished"
 msgstr ""
 
-#: ../virt-p2v.ml:813
+#: ../.tmp.virt-p2v.ml:836
 msgid "%s starting up ...\\n%!"
 msgstr ""
 
-#: ../virt-p2v.ml:1424
+#: ../.tmp.virt-p2v.ml:1447
 msgid "(leave MAC blank for random)"
 msgstr ""
 
-#: ../virt-p2v.ml:1391
+#: ../.tmp.virt-p2v.ml:1414
 msgid "Architecture:"
 msgstr ""
 
-#: ../virt-p2v.ml:1120
+#: ../.tmp.virt-p2v.ml:1143
 msgid "Automatic from:"
 msgstr ""
 
-#: ../virt-p2v.ml:1356
+#: ../.tmp.virt-p2v.ml:1379
 msgid "Block devices"
 msgstr ""
 
-#: ../virt-p2v.ml:1418
+#: ../.tmp.virt-p2v.ml:1441
 msgid "CPUs:"
 msgstr ""
 
-#: ../virt-p2v.ml:428
+#: ../.tmp.virt-p2v.ml:431
 msgid "Command failed:\\n\\n%s"
 msgstr ""
 
-#: ../virt-p2v.ml:1090
+#: ../.tmp.virt-p2v.ml:1113
 msgid "Configure network"
 msgstr ""
 
-#: ../virt-p2v.ml:1382
+#: ../.tmp.virt-p2v.ml:1405
 msgid "Configure target system"
 msgstr ""
 
-#: ../virt-p2v.ml:825
+#: ../.tmp.virt-p2v.ml:848
 msgid "Detecting hard drives (this may take some time) ..."
 msgstr ""
 
-#: ../virt-p2v.ml:571
+#: ../.tmp.virt-p2v.ml:574
 msgid "Disk snapshot failed: unable to read the size in sectors of block device %s"
 msgstr ""
 
-#: ../virt-p2v.ml:1136
+#: ../.tmp.virt-p2v.ml:1159
 msgid "Don't configure the network"
 msgstr ""
 
-#: ../virt-p2v.ml:323
+#: ../.tmp.virt-p2v.ml:326
 msgid "Error"
 msgstr ""
 
-#: ../virt-p2v.ml:295
+#: ../.tmp.virt-p2v.ml:298
 msgid "F12 for next screen | [ALT] [F2] root / no password for shell"
 msgstr ""
 
-#: ../virt-p2v.ml:1021
+#: ../.tmp.virt-p2v.ml:1044
 msgid "Finished detecting hard drives."
 msgstr ""
 
-#: ../virt-p2v.ml:1147
+#: ../.tmp.virt-p2v.ml:1170
 msgid "Gateway"
 msgstr ""
 
-#: ../virt-p2v.ml:1384
+#: ../.tmp.virt-p2v.ml:1407
 msgid "Hypervisor:"
 msgstr ""
 
-#: ../virt-p2v.ml:1143
+#: ../.tmp.virt-p2v.ml:1166
 msgid "IP"
 msgstr ""
 
-#: ../virt-p2v.ml:1141
+#: ../.tmp.virt-p2v.ml:1164
 msgid "Interface"
 msgstr ""
 
-#: ../virt-p2v.ml:212
+#: ../.tmp.virt-p2v.ml:215
 msgid "Linux /boot"
 msgstr ""
 
-#: ../virt-p2v.ml:208
+#: ../.tmp.virt-p2v.ml:211
 msgid "Linux swap"
 msgstr ""
 
-#: ../virt-p2v.ml:1421
+#: ../.tmp.virt-p2v.ml:1444
 msgid "MAC addr:"
 msgstr ""
 
-#: ../virt-p2v.ml:1415
+#: ../.tmp.virt-p2v.ml:1438
 msgid "Memory (MB):"
 msgstr ""
 
-#: ../virt-p2v.ml:213
+#: ../.tmp.virt-p2v.ml:216
 msgid "Mountable non-root"
 msgstr ""
 
-#: ../virt-p2v.ml:1149
+#: ../.tmp.virt-p2v.ml:1172
 msgid "Nameserver"
 msgstr ""
 
-#: ../virt-p2v.ml:1145
+#: ../.tmp.virt-p2v.ml:1168
 msgid "Netmask"
 msgstr ""
 
-#: ../virt-p2v.ml:1089
+#: ../.tmp.virt-p2v.ml:1112
 msgid "Network"
 msgstr ""
 
-#: ../virt-p2v.ml:1237
+#: ../.tmp.virt-p2v.ml:1260
 msgid "Network configuration.\\n\\nPlease configure the network from this shell.\\n\\nWhen you have finished, exit the shell with ^D or exit.\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:853
+#: ../.tmp.virt-p2v.ml:876
 msgid "No non-removable block devices (hard disks, etc.) could be found on this machine."
 msgstr ""
 
-#: ../virt-p2v.ml:1557
+#: ../.tmp.virt-p2v.ml:1580
 msgid "Note"
 msgstr ""
 
-#: ../virt-p2v.ml:1599
+#: ../.tmp.virt-p2v.ml:1622
 msgid "Performing LVM snapshots ...\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1076
+#: ../.tmp.virt-p2v.ml:1099
 msgid "Physical to Virtual (P2V)"
 msgstr ""
 
-#: ../virt-p2v.ml:1133
+#: ../.tmp.virt-p2v.ml:1156
 msgid "QEMU user network"
 msgstr ""
 
-#: ../virt-p2v.ml:1287
+#: ../.tmp.virt-p2v.ml:1310
 msgid "Remote directory"
 msgstr ""
 
-#: ../virt-p2v.ml:1283
+#: ../.tmp.virt-p2v.ml:1306
 msgid "Remote host"
 msgstr ""
 
-#: ../virt-p2v.ml:1552
+#: ../.tmp.virt-p2v.ml:1575
 msgid "Remote hypervisor claims not to support fully virtualized %s guests.\\n\\nContinuing anyway.\\n\\n%!"
 msgstr ""
 
-#: ../virt-p2v.ml:1558
+#: ../.tmp.virt-p2v.ml:1581
 msgid "Remote hypervisor supports multiple types of fully virtualized %s guests.\\n\\nPlease help further development of libvirt and virt-p2v by sending the file /tmp/virt-p2v.log back to the developers.  See the main virt-p2v website for contact details."
 msgstr ""
 
-#: ../virt-p2v.ml:1285
+#: ../.tmp.virt-p2v.ml:1308
 msgid "Remote port"
 msgstr ""
 
-#: ../virt-p2v.ml:1373
+#: ../.tmp.virt-p2v.ml:1396
 msgid "Root filesystem"
 msgstr ""
 
-#: ../virt-p2v.ml:1281 ../virt-p2v.ml:1280
+#: ../.tmp.virt-p2v.ml:1304 ../.tmp.virt-p2v.ml:1303
 msgid "SSH configuration"
 msgstr ""
 
-#: ../virt-p2v.ml:1338
+#: ../.tmp.virt-p2v.ml:1361
 msgid "SSH configuration failed"
 msgstr ""
 
-#: ../virt-p2v.ml:1289
+#: ../.tmp.virt-p2v.ml:1312
 msgid "SSH username"
 msgstr ""
 
-#: ../virt-p2v.ml:1358
+#: ../.tmp.virt-p2v.ml:1381
 msgid "Select block devices to send"
 msgstr ""
 
-#: ../virt-p2v.ml:1374
+#: ../.tmp.virt-p2v.ml:828 ../.tmp.virt-p2v.ml:827
+msgid "Select language"
+msgstr ""
+
+#: ../.tmp.virt-p2v.ml:1397
 msgid "Select root filesystem"
 msgstr ""
 
-#: ../virt-p2v.ml:1123
+#: ../.tmp.virt-p2v.ml:1146
 msgid "Start a shell"
 msgstr ""
 
-#: ../virt-p2v.ml:1139
+#: ../.tmp.virt-p2v.ml:1162
 msgid "Static configuration:"
 msgstr ""
 
-#: ../virt-p2v.ml:1381
+#: ../.tmp.virt-p2v.ml:1404
 msgid "Target system"
 msgstr ""
 
-#: ../virt-p2v.ml:1302
+#: ../.tmp.virt-p2v.ml:1325
 msgid "Test SSH connection"
 msgstr ""
 
-#: ../virt-p2v.ml:676
+#: ../.tmp.virt-p2v.ml:679
 msgid "Testing SSH connection by listing files in remote directory ...\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1081 ../virt-p2v.ml:1080
+#: ../.tmp.virt-p2v.ml:1104 ../.tmp.virt-p2v.ml:1103
 msgid "Transfer type"
 msgstr ""
 
-#: ../virt-p2v.ml:1505
+#: ../.tmp.virt-p2v.ml:1528
 msgid "Try to fetch remote hypervisor capabilities ...\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1266
+#: ../.tmp.virt-p2v.ml:1289
 msgid "Trying QEMU network configuration.\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1250
+#: ../.tmp.virt-p2v.ml:1273
 msgid "Trying network auto-configuration from root filesystem ...\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1241
+#: ../.tmp.virt-p2v.ml:1264
 msgid "Trying static network configuration.\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:214
+#: ../.tmp.virt-p2v.ml:217
 msgid "Unknown partition type"
 msgstr ""
 
-#: ../virt-p2v.ml:1298
+#: ../.tmp.virt-p2v.ml:1321
 msgid "Use SSH compression (not good for LANs)"
 msgstr ""
 
-#: ../virt-p2v.ml:1427
+#: ../.tmp.virt-p2v.ml:1450
 msgid "Use remote libvirtd"
 msgstr ""
 
-#: ../virt-p2v.ml:1077
+#: ../.tmp.virt-p2v.ml:1100
 msgid "Virtual to Virtual (V2V)"
 msgstr ""
 
-#: ../virt-p2v.ml:1551
+#: ../.tmp.virt-p2v.ml:1574
 msgid "Warning"
 msgstr ""
 
-#: ../virt-p2v.ml:1068
+#: ../.tmp.virt-p2v.ml:1091
 msgid "Welcome to %s, a live CD for migrating a physical machine to a virtualized host.\\n\\nTo continue press the Return key.\\n\\nTo get a shell you can use [ALT] [F2] and log in as root with no password.\\n\\nExtra information is logged in /tmp/virt-p2v.log but this file disappears when the machine reboots."
 msgstr ""
 
-#: ../virt-p2v.ml:211
+#: ../.tmp.virt-p2v.ml:214
 msgid "Windows root"
 msgstr ""
 
-#: ../virt-p2v.ml:821
+#: ../.tmp.virt-p2v.ml:844
 msgid "You should only run this script from the live CD or a USB key."
 msgstr ""
 
-#: ../virt-p2v.ml:1801
+#: ../.tmp.virt-p2v.ml:1824
 msgid "\\\n<!--\n  This is an automatically generated libvirt configuration file.\n  It was written by the %s program.\n\n  Please check the values in this configuration file carefully,\n  particularly maxmem, memory, vcpu and any paths.\n\n  To start the domain, do:\n    virsh%s define %s\n    virsh%s start %s\n-->\\n\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1256 ../virt-p2v.ml:1244
+#: ../.tmp.virt-p2v.ml:1279 ../.tmp.virt-p2v.ml:1267
 msgid "\\nAuto-configuration failed.  Starting a shell.\\n\\nPlease configure the network from this shell.\\n\\nWhen you have finished, exit the shell with ^D or exit.\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:1840
+#: ../.tmp.virt-p2v.ml:1863
 msgid "\\nSending /dev/%s (%.3f GB) to remote machine\\n\\n%!"
 msgstr ""
 
-#: ../virt-p2v.ml:1903
+#: ../.tmp.virt-p2v.ml:1926
 msgid "\\nThe physical to virtual migration is complete.\\n\\nPlease verify the disk image(s) and configuration file on the remote host, and then start up the virtual machine by doing:\\n\\ncd %s\\nvirsh define %s\\n\\nWhen you press [OK] this machine will reboot."
 msgstr ""
 
-#: ../virt-p2v.ml:1819
+#: ../.tmp.virt-p2v.ml:1842
 msgid "\\nWriting configuration file ...\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:683
+#: ../.tmp.virt-p2v.ml:686
 msgid "\\n\\nDid SSH work?\\nHint: If not sure, there is a shell on console [ALT] [F2]\\n"
 msgstr ""
 
-#: ../virt-p2v.ml:599
+#: ../.tmp.virt-p2v.ml:602
 msgid "\\n\\nDid automatic network configuration work?\\nHint: If not sure, there is a shell on console [ALT] [F2]"
 msgstr ""
 
-#: ../virt-p2v.ml:322
+#: ../.tmp.virt-p2v.ml:325
 msgid "\\n\\nIf you want to report this error, there is a shell on [ALT] [F2], log in as root with no password.\\n\\nPlease provide the contents of /tmp/virt-p2v.log and output of the 'dmesg' command."
 msgstr ""
 
-#: ../virt-p2v.ml:286
+#: ../.tmp.virt-p2v.ml:289
 msgid "open_centered_window: not in newt mode"
 msgstr ""
 
-#: ../virt-p2v.ml:447
+#: ../.tmp.virt-p2v.ml:450
 msgid "shget: command killed by signal %d"
 msgstr ""
 
-#: ../virt-p2v.ml:449
+#: ../.tmp.virt-p2v.ml:452
 msgid "shget: command stopped by signal %d"
 msgstr ""
 
-#: ../virt-p2v.ml:661
+#: ../.tmp.virt-p2v.ml:664
 msgid "ssh: exited with error code %d"
 msgstr ""
 
-#: ../virt-p2v.ml:662
+#: ../.tmp.virt-p2v.ml:665
 msgid "ssh: killed by signal %d"
 msgstr ""
 
-#: ../virt-p2v.ml:663
+#: ../.tmp.virt-p2v.ml:666
 msgid "ssh: stopped by signal %d"
 msgstr ""
 
-#: ../virt-p2v.ml:528
+#: ../.tmp.virt-p2v.ml:531
 msgid "unexpected output: "
 msgstr ""
 
-#: ../virt-p2v.ml:1915
+#: ../.tmp.virt-p2v.ml:1938
 msgid "usage: virt-p2v [--test] [ttyname]\\n%!"
 msgstr ""
 
old mode 100644 (file)
new mode 100755 (executable)
similarity index 99%
rename from virt-p2v.ml
rename to virt-p2v
index 811c8f6..4e2d9dd
+++ b/virt-p2v
@@ -1,3 +1,4 @@
+#!/usr/bin/ocamlrun /usr/bin/ocaml
 (* -*- tuareg -*- *)
 (* virt-p2v is a script which performs a physical to
  * virtual conversion of local disks.
@@ -107,6 +108,16 @@ let test_dialog_stages = false
 (* END OF CUSTOM virt-p2v SCRIPT SECTION.                               *)
 (*----------------------------------------------------------------------*)
 
+(* Load external libraries. *)
+;;
+#use "topfind";;
+#require "extlib";;
+#require "pcre";;
+#require "newt";;
+#require "xml-light";;
+#require "gettext-stub";;
+#require "libvirt";;
+
 open Unix
 open Printf
 open ExtList
index a4a6f1a..bf99e18 100644 (file)
@@ -43,7 +43,6 @@ P2V, V2V and V2P virtual machine migration.
 
 %build
 %configure
-make virt-p2v
 make -C po