mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-04 10:23:08 -05:00
Show a startup error if virtinst version isn't new enough.
This commit is contained in:
@@ -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 ====================================
|
||||
|
||||
@@ -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
@@ -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)," < $< > $@
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user