Commit fb002362 authored by Fabiano Fidêncio's avatar Fabiano Fidêncio

examples: Remove non functional examples

libosinfo examples are not working for some time. Let's remove them and,
later on, we can come up with a new set of functional ones.
Signed-off-by: Fabiano Fidêncio's avatarFabiano Fidêncio <[email protected]>
Reviewed-by: Cole Robinson's avatarCole Robinson <[email protected]>
parent e707c331
SUBDIRS = osinfo tools docs po examples
SUBDIRS = osinfo tools docs po
if ENABLE_TESTS
SUBDIRS += tests
......
......@@ -282,7 +282,6 @@ AC_CONFIG_FILES([
tests/Makefile
docs/Makefile
docs/reference/Makefile
examples/Makefile
po/Makefile.in
])
AC_OUTPUT
EXTRA_DIST = demo.js demo.py libosinfo-dummy-data.xml
#!/usr/bin/seed
const osinfo = imports.gi.Libosinfo;
var loader = new osinfo.Loader()
loader.process_path("./")
var db = loader.get_db()
var devs = db.get_device_list()
print ("All device IDs")
for (idx in devs.get_elements()) {
var dev = devs.get_nth(idx)
print (" Device " + dev.get_id())
}
var names = db.unique_values_for_property_in_device("name")
print ("All device names")
for (idx in names) {
var name = names[idx]
print (" Name " + name)
}
var osnames = db.unique_values_for_property_in_os("short-id")
print ("All OS short ids")
for (idx in osnames) {
var name = osnames[idx]
print (" OS short id " + name)
}
var osid = "http://fedoraproject.org/fedora-11"
var hvid = "http://qemu.org/qemu-kvm-0.11.0"
var drvclass = "net"
//var drvclass = "audio"
var os = db.get_os(osid)
var hv = db.get_platform(hvid)
var dep = db.find_deployment(os, hv)
var filter = new osinfo.Filter()
filter.add_constraint("class", drvclass)
var link = dep.get_preferred_device_link(new osinfo.DeviceLinkFilter({target_filter: filter}))
var dev = link.get_target()
var drv = link.get_param_value("driver")
print ("For OS '" + os.get_name() + "' " +
"fruit '" + os.get_param_value("x-fruit") + "' " +
"zoo '" + os.get_param_values("x-animal") + "' " +
"with HV '" + hv.get_name() + "' " +
"for class '" + drvclass + "' " +
"use device '" + dev.get_name() + "' " +
"with HV driver '" + link.get_driver() + "'")
#!/usr/bin/python
import gi
gi.require_version('Libosinfo', '1.0')
from gi.repository import Libosinfo as osinfo;
loader = osinfo.Loader()
loader.process_path("./")
db = loader.get_db()
devs = db.get_device_list()
print "All device IDs"
for dev in devs.get_elements():
print (" Device " + dev.get_id())
names = db.unique_values_for_property_in_device("name")
print "All device names"
for name in names:
print (" Name " + name)
osnames = db.unique_values_for_property_in_os("short-id")
osnames.sort()
print "All OS short IDs"
for name in osnames:
print (" OS short id " + name)
hvnames = db.unique_values_for_property_in_platform("short-id")
hvnames.sort()
print "All HV short IDs"
for name in hvnames:
print (" HV short id " + name)
osid = "http://fedoraproject.org/fedora-11"
hvid = "http://qemu.org/qemu-kvm-0.11.0"
drvclass = "net"
#drvclass = "audio"
os = db.get_os(osid)
hv = db.get_platform(hvid)
dep = db.find_deployment(os, hv)
fltr = osinfo.Filter()
fltr.add_constraint("class", drvclass)
link = dep.get_preferred_device_link(osinfo.DeviceLinkFilter(target_filter = fltr))
dev = link.get_target()
animals = os.get_param_value_list("x-animal")
zoo = str.join(",", animals)
print ("For OS '" + os.get_name() + "' " +
"fruit '" + os.get_param_value("x-fruit") + "' " +
"zoo '" + zoo + "' " +
"with HV '" + hv.get_name() + "' " +
"for class '" + drvclass + "' " +
"use device '" + dev.get_name() + "' " +
"with HV driver '" + link.get_driver() + "'")
<libosinfo version="0.0.1">
<!-- Backing Data Follows -->
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000">
<!-- ES1370 -->
<class>audio</class>
<bus-type>pci</bus-type>
<vendor>0x1274</vendor>
<product>0x5000</product>
<name>ES1370</name>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1274/1371/80864541">
<!-- ES1371 -->
<class>audio</class>
<bus-type>pci</bus-type>
<vendor>0x1274</vendor>
<product>0x1371</product>
<subsystem>8086 4541</subsystem>
<name>D815EEA Motherboard</name>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382">
<!-- SB600 AC97 Audio -->
<class>audio</class>
<bus-type>pci</bus-type>
<vendor>0x1002</vendor>
<product>0x4382</product>
<name>SB600 AC97 Audio</name>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/a727/0013">
<!-- 3CRPAG175 Wireless PC Card -->
<class>net</class>
<bus-type>pci</bus-type>
<vendor>0xa727</vendor>
<product>0x0013</product>
<name>3CRPAG175 Wireless PC Card</name>
</device>
<platform id="http://qemu.org/qemu-kvm-0.11.0">
<upgrades id="http://qemu.org/qemu-kvm-0.10.0" />
<short-id>kvm-0.11.0</short-id>
<name>KVM 0.11.0</name>
<version>0.11.0</version>
<vendor>qemu</vendor>
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382" />
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000" />
<device id="http://pci-ids.ucw.cz/read/PC/1274/1371/80864541" />
<device id="http://pci-ids.ucw.cz/read/PC/a727/0013" />
</devices>
</platform>
<platform id="http://bits.xensource.com/oss-xen/release/3.4.1">
<short-id>xen-3.4.1</short-id>
<name>Xen 3.4.1</name>
<version>3.4.1</version>
<vendor>XenSource</vendor>
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382" />
<device id="http://pci-ids.ucw.cz/read/PC/1274/1371/80864541" />
<device id="http://pci-ids.ucw.cz/read/PC/a727/0013" />
</devices>
</platform>
<os id="http://fedoraproject.org/fedora-11">
<upgrades id="http://fedoraproject.org/fedora-10" />
<short-id>fedora11</short-id>
<name>Fedora 11</name>
<version>11</version>
<vendor>Fedora Project</vendor>
<x-fruit>apples</x-fruit>
<x-animal>marmot</x-animal>
<x-animal>aardvark</x-animal>
<!-- Device support for unspecified platform -->
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382">
<driver>es1391</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000">
<driver>ac97+</driver>
</device>
</devices>
</os>
<os id="http://fedoraproject.org/fedora-10">
<short-id>fedora10</short-id>
<name>Fedora 10</name>
<version>10</version>
<vendor>Fedora Project</vendor>
<!-- Device support for unspecified platform -->
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000">
<driver>ac97</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382">
<driver>es1391</driver>
</device>
</devices>
</os>
<os id="http://software.opensuse.org/112">
<short-id>opensuse11.2</short-id>
<name>OpenSuse 11.2</name>
<version>11.2</version>
<vendor>OpenSuse Project</vendor>
</os>
<deployment id="http://fedoraproject.org/fedora-10?kvm-0.11.0">
<platform id="http://qemu.org/qemu-kvm-0.11.0" />
<os id="http://fedoraproject.org/fedora-10" />
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382">
<driver>ac97</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000">
<driver>ES1370</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/a727/0013">
<driver>3com</driver>
</device>
</devices>
</deployment>
<deployment id="http://fedoraproject.org/fedora-11?kvm-0.11.0">
<platform id="http://qemu.org/qemu-kvm-0.11.0" />
<os id="http://fedoraproject.org/fedora-11" />
<devices>
<device id="http://pci-ids.ucw.cz/read/PC/1274/5000">
<driver>es1370</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1002/4382">
<driver>ac97</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/1274/1371/80864541">
<driver>es1371</driver>
</device>
<device id="http://pci-ids.ucw.cz/read/PC/a727/0013">
<driver>3com</driver>
</device>
</devices>
</deployment>
<!-- End of backing data -->
</libosinfo>
......@@ -51,8 +51,6 @@ Libraries, includes, etc. to compile with the libosinfo library
%configure --enable-introspection=yes --enable-vala=yes
%__make %{?_smp_mflags} V=1
chmod a-x examples/*.js examples/*.py
%install
rm -fr %{buildroot}
%__make install DESTDIR=%{buildroot}
......@@ -87,8 +85,6 @@ rm -fr %{buildroot}
%{_libdir}/girepository-1.0/Libosinfo-1.0.typelib
%files devel
%doc examples/demo.js
%doc examples/demo.py
%{_libdir}/%{name}-1.0.so
%dir %{_includedir}/%{name}-1.0/
%dir %{_includedir}/%{name}-1.0/osinfo/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment