]> arthur.barton.de Git - bup.git/commitdiff
helpers.py: Cygwin doesn't support `hostname -f`, use `hostname`.
authorLukasz Kosewski <lkosewsk@gmail.com>
Sun, 10 Jan 2010 08:59:20 +0000 (03:59 -0500)
committerLukasz Kosewski <lkosewsk@gmail.com>
Sun, 10 Jan 2010 08:59:20 +0000 (03:59 -0500)
helpers.py

index b0b054d8735c3d152c64bff999c3e7491f9db756..344d001a53ece358f1b845b53a9a4eaad8fe9be6 100644 (file)
@@ -51,7 +51,11 @@ def hostname():
     global _hostname
     if not _hostname:
         try:
-            _hostname = readpipe(['hostname', '-f']).strip()
+            if sys.platform == 'cygwin':
+                hostcmd = ['hostname']
+            else:
+                hostcmd = ['hostname', '-f']
+            _hostname = readpipe(hostcmd).strip()
         except OSError:
             pass
     return _hostname or 'localhost'