diff --git a/.gitignore b/.gitignore index c8b53cac9..27279396f 100644 --- a/.gitignore +++ b/.gitignore @@ -580,8 +580,7 @@ Makefile.in /test-data/phony-guests/fedora-luks.img /test-data/phony-guests/fedora-md1.img /test-data/phony-guests/fedora-md2.img -/test-data/phony-guests/fedora-name.db -/test-data/phony-guests/fedora-packages.db +/test-data/phony-guests/fedora.db /test-data/phony-guests/guests.xml /test-data/phony-guests/guests-all-good.xml /test-data/phony-guests/stamp-fedora-md.img diff --git a/m4/guestfs-progs.m4 b/m4/guestfs-progs.m4 index f90bda04e..4819df627 100644 --- a/m4/guestfs-progs.m4 +++ b/m4/guestfs-progs.m4 @@ -63,6 +63,9 @@ AC_CHECK_PROG([PO4A_GETTEXTIZE],[po4a-gettextize],[po4a-gettextize],[no]) AC_CHECK_PROG([PO4A_TRANSLATE],[po4a-translate],[po4a-translate],[no]) AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A_GETTEXTIZE" != "xno" && test "x$PO4A_TRANSLATE" != "xno"]) +dnl Check for sqlite3 (optional). +AC_CHECK_PROG([SQLITE3],[sqlite3],[sqlite3],[no]) + dnl Check for netpbm programs (optional). AC_PATH_PROGS([PBMTEXT],[pbmtext],[no]) AC_PATH_PROGS([PNMTOPNG],[pnmtopng],[no]) diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am index 0d74ab110..60313548a 100644 --- a/test-data/phony-guests/Makefile.am +++ b/test-data/phony-guests/Makefile.am @@ -23,10 +23,8 @@ EXTRA_DIST = \ debian-syslog \ make-fedora-img.pl \ fedora-journal.tar.xz \ - fedora-name.db.txt \ - fedora-name.db \ - fedora-packages.db.txt \ - fedora-packages.db \ + fedora-db.sql.xz \ + fedora.db \ make-ubuntu-img.sh \ make-archlinux-img.sh \ archlinux-package \ @@ -78,8 +76,7 @@ blank-%.img: # Make a (dummy) Fedora image. fedora.img: make-fedora-img.pl \ fedora-journal.tar.xz \ - fedora-name.db \ - fedora-packages.db + fedora.db SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test ./$< # Make a (dummy) Fedora image using md devices @@ -87,8 +84,7 @@ fedora-md1.img fedora-md2.img: stamp-fedora-md.img stamp-fedora-md.img: make-fedora-img.pl \ fedora-journal.tar.xz \ - fedora-name.db \ - fedora-packages.db + fedora.db rm -f $@ SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test ./$< touch $@ @@ -97,15 +93,13 @@ stamp-fedora-md.img: make-fedora-img.pl \ # for root and home. fedora-btrfs.img: make-fedora-img.pl \ fedora-journal.tar.xz \ - fedora-name.db \ - fedora-packages.db + fedora.db SRCDIR=$(srcdir) LAYOUT=btrfs $(top_builddir)/run --test ./$< # Make a (dummy) Fedora image with LVM encrypted with LUKS. fedora-luks.img: make-fedora-img.pl \ fedora-journal.tar.xz \ - fedora-name.db \ - fedora-packages.db + fedora.db SRCDIR=$(srcdir) LAYOUT=lvm-luks $(top_builddir)/run --test ./$< # Make a (dummy) Debian image. @@ -138,14 +132,9 @@ guests-all-good.xml: make-guests-all-good.pl $(disk_images) # Since users might not have the tools needed to create this, we also # distribute these files and they are only cleaned by 'make distclean' # not regular 'make clean'. -fedora-name.db: fedora-name.db.txt +fedora.db: fedora-db.sql.xz rm -f $@ $@-t - $(DB_LOAD) $@-t < $< - mv $@-t $@ - -fedora-packages.db: fedora-packages.db.txt - rm -f $@ $@-t - $(DB_LOAD) $@-t < $< + xzcat $< | $(SQLITE3) $@-t mv $@-t $@ windows-software: windows-software.reg @@ -161,8 +150,7 @@ windows-system: windows-system.reg mv $@-t $@ DISTCLEANFILES += \ - fedora-name.db \ - fedora-packages.db \ + fedora.db \ windows-software \ windows-system diff --git a/test-data/phony-guests/fedora-db.sql.xz b/test-data/phony-guests/fedora-db.sql.xz new file mode 100644 index 000000000..be3a4f3ef Binary files /dev/null and b/test-data/phony-guests/fedora-db.sql.xz differ diff --git a/test-data/phony-guests/fedora-name.db.txt b/test-data/phony-guests/fedora-name.db.txt deleted file mode 100644 index 8456097e4..000000000 --- a/test-data/phony-guests/fedora-name.db.txt +++ /dev/null @@ -1,13 +0,0 @@ -VERSION=3 -format=print -type=hash -h_nelem=3 -db_pagesize=4096 -HEADER=END - test1 - \01\00\00\00\00\00\00\00 - test2 - \02\00\00\00\00\00\00\00 - test3 - \03\00\00\00\00\00\00\00 -DATA=END diff --git a/test-data/phony-guests/fedora-packages.db.txt b/test-data/phony-guests/fedora-packages.db.txt deleted file mode 100644 index f16a5aa76..000000000 --- a/test-data/phony-guests/fedora-packages.db.txt +++ /dev/null @@ -1,13 +0,0 @@ -VERSION=3 -format=print -type=hash -h_nelem=3 -db_pagesize=4096 -HEADER=END - \01\00\00\00 - \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\001.0\001.fc14\00x86_64\00 - \02\00\00\00 - \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\002.0\002.fc14\00x86_64\00 - \03\00\00\00 - \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\003.0\003.fc14\00x86_64\00 -DATA=END diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl index 28b9c1db0..90492b814 100755 --- a/test-data/phony-guests/make-fedora-img.pl +++ b/test-data/phony-guests/make-fedora-img.pl @@ -246,6 +246,7 @@ $g->mkdir ('/usr/share/zoneinfo'); $g->mkdir ('/usr/share/zoneinfo/Europe'); $g->touch ('/usr/share/zoneinfo/Europe/London'); $g->mkdir_p ('/var/lib/rpm'); +$g->mkdir_p ('/usr/lib/rpm'); $g->mkdir_p ('/var/log/journal'); $g->write ('/etc/shadow', "root::15440:0:99999:7:::\n"); @@ -264,8 +265,12 @@ if (-f "fedora.mdadm") { unlink ("fedora.mdadm") or die; } -$g->upload ($ENV{SRCDIR}.'/fedora-name.db', '/var/lib/rpm/Name'); -$g->upload ($ENV{SRCDIR}.'/fedora-packages.db', '/var/lib/rpm/Packages'); +$g->upload ($ENV{SRCDIR}.'/fedora.db', '/var/lib/rpm/rpmdb.sqlite'); +$g->touch ('/usr/lib/rpm/rpmrc'); +$g->write ('/usr/lib/rpm/macros', <upload ($ENV{SRCDIR}.'/../binaries/bin-x86_64-dynamic', '/bin/ls');