aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorastokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8>2009-11-19 20:05:43 +0000
committerastokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8>2009-11-19 20:05:43 +0000
commita576ffb7147d25b81ba94f30190599abaa5e9847 (patch)
tree429dc45e3f2b47349b21e5a18a535204cd97c4b9
parent4ce0ddd4ca35595fe8e705c3a122110d3ba762df (diff)
downloadsos-a576ffb7147d25b81ba94f30190599abaa5e9847.tar.gz
more symlink work
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@665 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r--src/lib/sos/plugintools.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py
index 39f592d4..cd4864e8 100644
--- a/src/lib/sos/plugintools.py
+++ b/src/lib/sos/plugintools.py
@@ -119,7 +119,7 @@ class PluginBase:
return []
# Methods for copying files and shelling out
- def doCopyFileOrDir(self, srcpath):
+ def doCopyFileOrDir(self, srcpath, symlinks=True):
# pylint: disable-msg = R0912
# pylint: disable-msg = R0915
''' Copy file or directory to the destination tree. If a directory, then everything
@@ -147,7 +147,10 @@ class PluginBase:
if symlinks and os.path.islink(srcpath):
link = os.readlink(srcpath)
os.symlink(link, dstslname)
- rpth = sosRelPath(os.path.dirname(dstslname), os.path.join(self.cInfo['dstroot'], link.lstrip(os.path.sep)))
+ if os.path.isabs(srcpath):
+ rpth = sosRelPath(os.path.dirname(dstslname), os.path.join(self.cInfo['dstroot'], link.lstrip(os.path.sep)))
+ else:
+ rpth = link
self.copiedFiles.append({'srcpath':srcpath, 'dstpath':rpth, 'symlink':"yes", 'pointsto':link})
elif os.path.isdir(srcpath):
shutil.copytree(srcpath, dstslname, symlinks)