aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/archive.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sos/archive.py b/sos/archive.py
index 9e19426c..dcd6908d 100644
--- a/sos/archive.py
+++ b/sos/archive.py
@@ -232,6 +232,11 @@ class FileCacheArchive(Archive):
dest = self._make_leading_paths(target_src, mode=mode)
dest = os.path.normpath(dest)
+ # In case symlink target is an absolute path, make it
+ # relative to the directory with symlink source
+ if os.path.isabs(target):
+ target = os.path.relpath(target, target_dir)
+
self.log_debug("Making symlink '%s' -> '%s'" %
(abs_path, target))
os.symlink(target, abs_path)