|
|
0cd6dc |
From 9fb39f8a211cf3d4f528aa7875eeb599096ecf24 Mon Sep 17 00:00:00 2001
|
|
|
0cd6dc |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
0cd6dc |
Date: Thu, 29 Jan 2015 20:30:31 +0000
|
|
|
0cd6dc |
Subject: [PATCH] [plugins] do not strip SYSROOT when copying link targets
|
|
|
0cd6dc |
|
|
|
0cd6dc |
The abspath() call in _copy_symlink returns a host-relative path
|
|
|
0cd6dc |
(when SYSROOT is not '/'). Pass this directly to _do_copy_path()
|
|
|
0cd6dc |
without stripping the SYSROOT path component.
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
0cd6dc |
---
|
|
|
0cd6dc |
sos/plugins/__init__.py | 6 ++++--
|
|
|
0cd6dc |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
0cd6dc |
|
|
|
0cd6dc |
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
|
|
|
0cd6dc |
index 29ce3b8..d8c6b69 100644
|
|
|
0cd6dc |
--- a/sos/plugins/__init__.py
|
|
|
0cd6dc |
+++ b/sos/plugins/__init__.py
|
|
|
0cd6dc |
@@ -265,7 +265,8 @@ class Plugin(object):
|
|
|
0cd6dc |
# the target stored in the original symlink
|
|
|
0cd6dc |
linkdest = os.readlink(srcpath)
|
|
|
0cd6dc |
dest = os.path.join(os.path.dirname(srcpath), linkdest)
|
|
|
0cd6dc |
- # absolute path to the link target
|
|
|
0cd6dc |
+ # Absolute path to the link target. If SYSROOT != '/' this path
|
|
|
0cd6dc |
+ # is relative to the host root file system.
|
|
|
0cd6dc |
absdest = os.path.normpath(dest)
|
|
|
0cd6dc |
# adjust the target used inside the report to always be relative
|
|
|
0cd6dc |
if os.path.isabs(linkdest):
|
|
|
0cd6dc |
@@ -290,7 +291,8 @@ class Plugin(object):
|
|
|
0cd6dc |
# to absolute paths to pass to _do_copy_path.
|
|
|
0cd6dc |
self._log_debug("normalized link target '%s' as '%s'"
|
|
|
0cd6dc |
% (linkdest, absdest))
|
|
|
0cd6dc |
- self._do_copy_path(self.strip_sysroot(absdest))
|
|
|
0cd6dc |
+
|
|
|
0cd6dc |
+ self._do_copy_path(absdest)
|
|
|
0cd6dc |
|
|
|
0cd6dc |
self.copied_files.append({'srcpath': srcpath,
|
|
|
0cd6dc |
'dstpath': dstpath,
|
|
|
0cd6dc |
--
|
|
|
0cd6dc |
1.9.3
|
|
|
0cd6dc |
|