diff options
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r-- | meta/classes/license.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 6b03221c7f..806b5069fd 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -91,17 +91,17 @@ def copy_license_files(lic_files_paths, destdir): | |||
91 | os.link(src, dst) | 91 | os.link(src, dst) |
92 | except OSError as err: | 92 | except OSError as err: |
93 | if err.errno == errno.EXDEV: | 93 | if err.errno == errno.EXDEV: |
94 | # Copy license files if hard-link is not possible even if st_dev is the | 94 | # Copy license files if hardlink is not possible even if st_dev is the |
95 | # same on source and destination (docker container with device-mapper?) | 95 | # same on source and destination (docker container with device-mapper?) |
96 | canlink = False | 96 | canlink = False |
97 | else: | 97 | else: |
98 | raise | 98 | raise |
99 | # Only chown if we did hardling, and, we're running under pseudo | 99 | # Only chown if we did hardlink and we're running under pseudo |
100 | if canlink and os.environ.get('PSEUDO_DISABLED') == '0': | 100 | if canlink and os.environ.get('PSEUDO_DISABLED') == '0': |
101 | os.chown(dst,0,0) | 101 | os.chown(dst,0,0) |
102 | if not canlink: | 102 | if not canlink: |
103 | begin_idx = int(beginline)-1 if beginline is not None else None | 103 | begin_idx = max(0, int(beginline) - 1) if beginline is not None else None |
104 | end_idx = int(endline) if endline is not None else None | 104 | end_idx = max(0, int(endline)) if endline is not None else None |
105 | if begin_idx is None and end_idx is None: | 105 | if begin_idx is None and end_idx is None: |
106 | shutil.copyfile(src, dst) | 106 | shutil.copyfile(src, dst) |
107 | else: | 107 | else: |