gnome-lirc-properties r39 - in trunk: . gnome_lirc_properties



Author: hadess
Date: Mon Jun 30 14:14:34 2008
New Revision: 39
URL: http://svn.gnome.org/viewvc/gnome-lirc-properties?rev=39&view=rev

Log:
2008-06-30  Bastien Nocera  <hadess hadess net>

	* configure.ac: Check for lirc 0.8.4 and require it
	* gnome_lirc_properties/backend.py: Fix include statement's
	syntax, it's enclosed in "<>" now
	* gnome_lirc_properties/lirc.py: Remove can_include check,
	all the lircs past 0.8.4 can support it

	* gnome_lirc_properties/Makefile.am:
	* gnome_lirc_properties/config.py.in:
	* gnome_lirc_properties/lsb.py: Remove use of lsb version checks,
	as we now require include support with a new enough lirc

	(Closes: #532606)



Removed:
   trunk/gnome_lirc_properties/lsb.py
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/gnome_lirc_properties/Makefile.am
   trunk/gnome_lirc_properties/backend.py
   trunk/gnome_lirc_properties/config.py.in
   trunk/gnome_lirc_properties/lirc.py

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Jun 30 14:14:34 2008
@@ -42,6 +42,38 @@
 POLICY_KIT_ACTION="org.gnome.lirc-properties.mechanism.configure"
 AC_SUBST([POLICY_KIT_ACTION])
 
+dnl check for new enough lirc ===
+
+AC_PATH_PROG([LIRCD], [lircd])
+
+HAVE_LIRCD="yes"
+if test -z $LIRCD ; then
+  HAVE_LIRCD="no"
+else
+  LIRCD_VERSION=`lircd --version|head -n 1|sed 's/^lircd //'|sed 's/ (.*)//'`
+  LIRCD_MAJOR=`echo $LIRCD_VERSION | cut -d. -f1 | sed 's/[[a-zA-Z\-]].*//g'`
+  LIRCD_MINOR=`echo $LIRCD_VERSION | cut -d. -f2 | sed 's/[[a-zA-Z\-]].*//g'`
+  LIRCD_MICRO=`echo $LIRCD_VERSION | cut -d. -f3 | sed 's/[[a-zA-Z\-]].*//g'`
+  if [[ "$LIRCD_MAJOR" -eq "0" ]] && \
+	  [[ "$LIRCD_MINOR" -lt "8" ]]; then
+	  AC_MSG_WARN([lircd >= 0.8.4 is required, you have $LIRCD_VERSION])
+	  HAVE_LIRCD="no"
+  elif [[ "$LIRCD_MAJOR" -eq "0" ]] && \
+	  [[ "$LIRCD_MINOR" -eq "8" ]] && \
+	  [[ "$LIRCD_MICRO" -lt "4" ]]; then
+	  AC_MSG_WARN([lircd >= 0.8.4 is required, you have $LIRCD_VERSION])
+	  HAVE_LIRCD="no"
+  fi
+fi
+
+AC_MSG_CHECKING([new enough lircd daemon])
+if test x"$HAVE_LIRCD" != xyes ;
+then
+  AC_MSG_ERROR([no])
+else
+  AC_MSG_RESULT([yes])
+fi
+
 dnl support custom LIRC folders ===
 
 expand_vars() {

Modified: trunk/gnome_lirc_properties/Makefile.am
==============================================================================
--- trunk/gnome_lirc_properties/Makefile.am	(original)
+++ trunk/gnome_lirc_properties/Makefile.am	Mon Jun 30 14:14:34 2008
@@ -8,7 +8,6 @@
 	config.py \
 	hardware.py \
 	lirc.py \
-	lsb.py \
 	model.py \
 	policykit.py
 

Modified: trunk/gnome_lirc_properties/backend.py
==============================================================================
--- trunk/gnome_lirc_properties/backend.py	(original)
+++ trunk/gnome_lirc_properties/backend.py	Mon Jun 30 14:14:34 2008
@@ -740,7 +740,7 @@
             contents = ''
 
         # find existing include statement:
-        include_statement = 'include %s\n' % redirect
+        include_statement = 'include <%s>\n' % redirect
         pattern = r'^\s*(#.*)?include\s+%s\s*$' % re.escape(redirect)
         pattern = re.compile(pattern, re.MULTILINE)
         match   = pattern.search(contents)
@@ -754,7 +754,7 @@
                 contents += '#\n'
                 contents += '# Feel free to add any custom remotes to the configuration\n'
                 contents += '# via additional include directives or below the existing\n'
-                contents += '# Ubuntu include directives from your selected remote and/or\n'
+                contents += '# include directives from your selected remote and/or\n'
                 contents += '# transmitter.\n'
                 contents += '#\n'
 

Modified: trunk/gnome_lirc_properties/config.py.in
==============================================================================
--- trunk/gnome_lirc_properties/config.py.in	(original)
+++ trunk/gnome_lirc_properties/config.py.in	Mon Jun 30 14:14:34 2008
@@ -3,11 +3,8 @@
 Generated by config.status from config.py.in.
 """
 
-from gnome_lirc_properties.lsb import ReleaseInfo
 from os                        import path
 
-LSB_RELEASE           = ReleaseInfo()
-
 ENABLE_POLICY_KIT     = @ENABLE_POLICY_KIT@
 POLICY_KIT_ACTION     = 'org.gnome.lirc-properties.mechanism.configure'
 
@@ -29,4 +26,4 @@
 URI_UPDATES           = '@with_download_uri@'
 
 # remove temporary objects from namespace
-del path, ReleaseInfo
+del path

Modified: trunk/gnome_lirc_properties/lirc.py
==============================================================================
--- trunk/gnome_lirc_properties/lirc.py	(original)
+++ trunk/gnome_lirc_properties/lirc.py	Mon Jun 30 14:14:34 2008
@@ -1038,26 +1038,17 @@
         except KeyError:
             return default
 
-def has_include_keyword():
-    '''Checks if include statements are supported in lircd.conf.'''
-
-    return (config.LSB_RELEASE.check(name='Ubuntu', codename='hardy') or
-            config.LSB_RELEASE.check(name='Ubuntu', release='8.04'))
-
 def find_remote_config():
     '''Finds the location our customized lircd.conf file.'''
 
-    if has_include_keyword():
-        return config.LIRC_REMOTE_CONF, True
-
-    return config.LIRC_DAEMON_CONF, False
+    return config.LIRC_REMOTE_CONF
 
 def check_hardware_settings(selected_remote):
     '''Check if the hardware settings are sane.'''
 
-    remote_config, can_include = find_remote_config()
+    remote_config = find_remote_config()
 
-    if can_include and not re.search(
+    if not re.search(
         r'^\s*include\s+%s\s*$' % re.escape(config.LIRC_REMOTE_CONF),
         open(config.LIRC_DAEMON_CONF).read(), re.MULTILINE):
         return False



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