summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 0c637e966e..4ebfc4fb92 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -84,17 +84,17 @@ def copy_license_files(lic_files_paths, destdir):
84 os.link(src, dst) 84 os.link(src, dst)
85 except OSError as err: 85 except OSError as err:
86 if err.errno == errno.EXDEV: 86 if err.errno == errno.EXDEV:
87 # Copy license files if hard-link is not possible even if st_dev is the 87 # Copy license files if hardlink is not possible even if st_dev is the
88 # same on source and destination (docker container with device-mapper?) 88 # same on source and destination (docker container with device-mapper?)
89 canlink = False 89 canlink = False
90 else: 90 else:
91 raise 91 raise
92 # Only chown if we did hardling, and, we're running under pseudo 92 # Only chown if we did hardlink and we're running under pseudo
93 if canlink and os.environ.get('PSEUDO_DISABLED') == '0': 93 if canlink and os.environ.get('PSEUDO_DISABLED') == '0':
94 os.chown(dst,0,0) 94 os.chown(dst,0,0)
95 if not canlink: 95 if not canlink:
96 begin_idx = int(beginline)-1 if beginline is not None else None 96 begin_idx = max(0, int(beginline) - 1) if beginline is not None else None
97 end_idx = int(endline) if endline is not None else None 97 end_idx = max(0, int(endline)) if endline is not None else None
98 if begin_idx is None and end_idx is None: 98 if begin_idx is None and end_idx is None:
99 shutil.copyfile(src, dst) 99 shutil.copyfile(src, dst)
100 else: 100 else: