Show a startup error if virtinst version isn't new enough.

This commit is contained in:
Cole Robinson
2009-11-11 16:32:24 -05:00
parent 291c6f629c
commit b6eb79dfdc
4 changed files with 26 additions and 1 deletions
+4
View File
@@ -9,6 +9,10 @@ IT_PROG_INTLTOOL([0.35.0], [no-xml])
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])
# Latest virtinst version required to run
VIRTINST_VERSION="0.400.3"
AC_SUBST([VIRTINST_VERSION])
dnl ====================================
dnl = Begin tests for scrollkeeper
dnl ====================================
+1
View File
@@ -5,6 +5,7 @@ Preparing the source tree:
1. Sync up latest translations - see po/README.txt
2. Change release number in configure.ac
3. Update virtinst version requirement in spec and configure.ac
3. Update NEWS file
4. Re-generate ChangeLog with 'hg log --style changelog > ChangeLog'
6. Update virt-manager.spec.in changelog & reset Release to '1'
+2 -1
View File
@@ -48,7 +48,8 @@ EXTRA_DIST = $(bin_SCRIPTS_IN) $(desktop_DATA_IN) $(dbus_DATA_IN) $(python_DATA_
-e "s,::PYLIBDIR::,$(pkgdatadir)," \
-e "s,::GETTEXTDIR::,$(datadir)/locale," \
-e "s,::DATADIR::,$(datadir)," \
-e "s,::PYARCHLIBDIR::,$(pkglibdir)," < $< > $@
-e "s,::PYARCHLIBDIR::,$(pkglibdir)," \
-e "s,::VIRTINST_VERSION::,$(VIRTINST_VERSION)," < $< > $@
$(PACKAGE): $(srcdir)/$(PACKAGE).in
sed -e "s,::PACKAGE::,$(PACKAGE)," -e "s,::PYTHONDIR::,$(pkgdatadir)," < $< > $@
+19
View File
@@ -39,6 +39,8 @@ appname = "::PACKAGE::"
appversion = "::VERSION::"
gettext_app = "virt-manager"
gettext_dir = "::GETTEXTDIR::"
virtinst_str = "::VIRTINST_VERSION::"
virtinst_version = tuple([ int(num) for num in virtinst_str.split('.')])
gconf_dir = "/apps/" + appname
asset_dir = "::ASSETDIR::"
@@ -289,6 +291,23 @@ def main():
raise RuntimeError(_("Unable to initialize GTK: %s") % str(e))
warnings.resetwarnings()
# Make sure we have a sufficiently new virtinst version, since we are
# very closely tied to the lib
msg = ("virt-manager requires the python-virtinst library version " +
virtinst_str + " or greater. This can be downloaded at:"
"\n\nhttp://virt-manager.org/download.html")
try:
import virtinst
ignore = virtinst.__version__
ignore = virtinst.__version_info__
except Exception, e:
raise RuntimeError(str(e) + "\n\n" + msg)
if virtinst.__version_info__ < virtinst_version:
raise RuntimeError("virtinst version %s is too old." %
(virtinst.__version__) +
"\n\n" + msg)
# Add our icon dir to icon theme
icon_theme = gtk.icon_theme_get_default()
icon_theme.prepend_search_path(icon_dir)