| |
@@ -6,6 +6,7 @@
|
| |
import sys
|
| |
import os
|
| |
import stat
|
| |
+ import errno
|
| |
|
| |
from productmd.composeinfo import ComposeInfo
|
| |
from productmd.rpms import Rpms
|
| |
@@ -116,11 +117,6 @@
|
| |
err_msg = "Symlink cannot be resolved: %s: %s." % (path, e)
|
| |
raise ComposeCheckError(err_msg)
|
| |
|
| |
- if target_stat.st_dev != abspath_stat.st_dev:
|
| |
- err_msg = ("Symlink's target is on different device than Compose "
|
| |
- "target: %s" % abspath)
|
| |
- raise ComposeCheckError(err_msg)
|
| |
-
|
| |
def run(self):
|
| |
"""
|
| |
Runs the compose checks. Raises ComposeCheckError in case of failed check.
|
| |
@@ -176,7 +172,13 @@
|
| |
for symlink, hardlink_path in self.symlinks:
|
| |
real_path = os.readlink(symlink)
|
| |
abspath = os.path.normpath(os.path.join(os.path.dirname(symlink), real_path))
|
| |
- os.link(abspath, hardlink_path)
|
| |
+ try:
|
| |
+ os.link(abspath, hardlink_path)
|
| |
+ except OSError as ex:
|
| |
+ if ex.errno == errno.EXDEV:
|
| |
+ shutil.copy2(abspath, hardlink_path)
|
| |
+ else:
|
| |
+ raise
|
| |
|
| |
def promote(self):
|
| |
"""
|
| |
Signed-off-by: Jan Kaluza jkaluza@redhat.com