[jhbuild] sanitycheck: better way to know if xmlcatalog is installed



commit a7cf9594bb4b0688c0d69ce36af2fa9ddf2d4f19
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sat Feb 1 23:06:22 2014 +0100

    sanitycheck: better way to know if xmlcatalog is installed
    
    It could happen that /etc/xml/catalog file exists but not the
    xmlcatalog executable, so it's rather better to check for the
    latter than the former.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723436

 jhbuild/commands/sanitycheck.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/jhbuild/commands/sanitycheck.py b/jhbuild/commands/sanitycheck.py
index 3c6bd0e..c7b0da3 100644
--- a/jhbuild/commands/sanitycheck.py
+++ b/jhbuild/commands/sanitycheck.py
@@ -91,9 +91,14 @@ class cmd_sanitycheck(Command):
             self.check_m4()
 
         # XML catalog sanity checks
-        if not os.access('/etc/xml/catalog', os.R_OK):
-            uprint(_('Could not find XML catalog'))
-        else:
+        xmlcatalog = True
+        try:
+            get_output(['which', 'xmlcatalog'])
+        except:
+            xmlcatalog = False
+            uprint(_('Could not find XML catalog (usually part of the package \'libxml2-utils\')'))
+
+        if (xmlcatalog):
             for (item, name) in [('-//OASIS//DTD DocBook XML V4.1.2//EN',
                                   'DocBook XML DTD V4.1.2'),
                                  ('http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]