]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: follow gnulib-tool changes, part 11
authorBruno Haible <bruno@clisp.org>
Sat, 9 Sep 2017 08:21:00 +0000 (10:21 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 9 Sep 2017 14:29:00 +0000 (16:29 +0200)
Follow gnulib-tool change
2014-12-02  KO Myung-Hun  <komh78@gmail.com>
gnulib-tool: recognize x:* as an absolute path

pygnulib/constants.py

index 6cb1ec97bb94332ad0f80182427a17b99f31c51a..9e0f19460a25a28f9ff9cecfdab6de2850b7e4b4 100644 (file)
@@ -344,16 +344,16 @@ def link_relative(src, dest):
     else:  # if dest has not bytes or string type
         raise(TypeError(
             'dest must be a string, not %s' % (type(dest).__name__)))
-    if src.startswith('/'):
+    if src.startswith('/') or (len(src) >= 2 and src[1] == ':'):
         os.symlink(src, dest)
-    else:  # if not src.startswith('/')
-        if dest.startswith('/'):
+    else:  # if src is not absolute
+        if dest.startswith('/') or (len(dest) >= 2 and dest[1] == ':'):
             if not constants.PYTHON3:
                 cwd = os.getcwdu()
             else:  # if constants.PYTHON3
                 cwd = os.getcwd()
             os.symlink(joinpath(cwd, src), dest)
-        else:  # if not dest.startswith('/')
+        else:  # if dest is not absolute
             destdir = os.path.dirname(dest)
             if not destdir:
                 destdir = '.'