diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-11-03 13:09:54 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-11-03 13:09:54 +0000 |
commit | 22998927f91f123e7c35d3ebf49e5744f3d7eafe (patch) | |
tree | 8fc7fd9639476b1ec915f865d7fa2805f023831a | |
parent | d1ee71782ace98a11c5aabaf1f9fd5f601e08367 (diff) | |
download | libguestfs-22998927f91f123e7c35d3ebf49e5744f3d7eafe.tar.gz libguestfs-22998927f91f123e7c35d3ebf49e5744f3d7eafe.tar.xz libguestfs-22998927f91f123e7c35d3ebf49e5744f3d7eafe.zip |
virt-sysprep: Don't use xmlstarlet.
Use virt-inspector --xpath option instead.
-rw-r--r-- | README | 4 | ||||
-rwxr-xr-x | clone/test-virt-sysprep.sh | 5 | ||||
-rw-r--r-- | clone/virt-sysprep.in | 16 |
3 files changed, 9 insertions, 16 deletions
@@ -132,9 +132,7 @@ To build the Perl tools: To run virt-sysprep: -- xmlstarlet (optional) - -- virt-sysprep also requires FUSE support since it uses guestmount +- virt-sysprep requires FUSE support since it uses guestmount Building diff --git a/clone/test-virt-sysprep.sh b/clone/test-virt-sysprep.sh index 81e01f89..097f416b 100755 --- a/clone/test-virt-sysprep.sh +++ b/clone/test-virt-sysprep.sh @@ -24,11 +24,6 @@ if [ ! -w /dev/fuse ]; then exit 0 fi -if ! xmlstarlet --help >/dev/null 2>&1; then - echo "SKIPPING virt-sysprep test, because xmlstarlet is not installed." - exit 0 -fi - rm -f test.img guestfish qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img diff --git a/clone/virt-sysprep.in b/clone/virt-sysprep.in index 144bad42..91508724 100644 --- a/clone/virt-sysprep.in +++ b/clone/virt-sysprep.in @@ -222,18 +222,18 @@ trap cleanup EXIT ERR # Run virt-inspector and grab inspection information about this guest. virt-inspector "${params[@]}" > $tmpdir/xml -xmlstarlet sel -t -c \ +virt-inspector --xpath \ "string(/operatingsystems/operatingsystem[position()=1]/name)" \ - $tmpdir/xml > $tmpdir/type -xmlstarlet sel -t -c \ + < $tmpdir/xml > $tmpdir/type +virt-inspector --xpath \ "string(/operatingsystems/operatingsystem[position()=1]/distro)" \ - $tmpdir/xml > $tmpdir/distro ||: -xmlstarlet sel -t -c \ + < $tmpdir/xml > $tmpdir/distro ||: +virt-inspector --xpath \ "string(/operatingsystems/operatingsystem[position()=1]/package_format)" \ - $tmpdir/xml > $tmpdir/package_format ||: -xmlstarlet sel -t -c \ + < $tmpdir/xml > $tmpdir/package_format ||: +virt-inspector --xpath \ "string(/operatingsystems/operatingsystem[position()=1]/package_management)" \ - $tmpdir/xml > $tmpdir/package_management ||: + < $tmpdir/xml > $tmpdir/package_management ||: type="$(cat $tmpdir/type)" distro="$(cat $tmpdir/distro)" |