# HG changeset patch # User Nikolaj Sjujskij # Date 1316521287 -10800 # Node ID 0d4f6e843b05a7d8aee0086863469dc59b8b7197 # Parent 91dc8878f88857f01b86a99ad047400704b5fd7e building: build inotify for sys.platform='linux*' If Python interpreter was built under Linux 3.x kernel, it reports sys.platform to be 'linux3' (it is fixed for Python 3, but not for 2.x). This cancels building inotify extension, which was built only for 'linux2' platform. Improved test checks if sys.platform begins with 'linux', and together with test for kernel version to be greater than 2.6 it seems to cover all known cases. diff -r 91dc8878f888 -r 0d4f6e843b05 contrib/setup3k.py --- a/contrib/setup3k.py Thu Sep 22 15:15:18 2011 +0200 +++ b/contrib/setup3k.py Tue Sep 20 15:21:27 2011 +0300 @@ -309,7 +309,7 @@ else: extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) -if sys.platform == 'linux2' and os.uname()[2] > '2.6': +if sys.platform.startswith('linux') and os.uname()[2] > '2.6': # The inotify extension is only usable with Linux 2.6 kernels. # You also need a reasonably recent C library. # In any case, if it fails to build the error will be skipped ('optional'). diff -r 91dc8878f888 -r 0d4f6e843b05 hgext/inotify/server.py --- a/hgext/inotify/server.py Thu Sep 22 15:15:18 2011 +0200 +++ b/hgext/inotify/server.py Tue Sep 20 15:21:27 2011 +0300 @@ -443,7 +443,7 @@ if err.args[0] != errno.EPIPE: raise -if sys.platform == 'linux2': +if sys.platform.startswith('linux'): import linuxserver as _server else: raise ImportError diff -r 91dc8878f888 -r 0d4f6e843b05 setup.py --- a/setup.py Thu Sep 22 15:15:18 2011 +0200 +++ b/setup.py Tue Sep 20 15:21:27 2011 +0300 @@ -366,7 +366,7 @@ extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'], extra_link_args=osutil_ldflags)) -if sys.platform == 'linux2' and os.uname()[2] > '2.6': +if sys.platform.startswith('linux') and os.uname()[2] > '2.6': # The inotify extension is only usable with Linux 2.6 kernels. # You also need a reasonably recent C library. # In any case, if it fails to build the error will be skipped ('optional').