def run(self):
if not self.skip_build:
self.run_command("build_scripts")
for script in self.distribution.scripts:
if isinstance(script, str):
fn = os.path.join(self.build_dir, os.path.basename(convert_path(script)))
out, _ = self.copy_file(fn, self.install_dir)
self.outfiles.append(out)
else:
dn = convert_path(script[0])
if not os.path.isabs(dn):
dn = os.path.join(self.install_dir, dn)
elif self.root:
dn = change_root(self.root, dn)
self.mkpath(dn)
if not script[1]:
self.outfiles.append(dn)
else:
for s in script[1]:
fn = os.path.join(self.build_dir, os.path.basename(convert_path(s)))
out, _ = self.copy_file(fn, dn)
self.outfiles.append(out)
if os.name == "posix":
for fn in self.get_outputs():
mode = S_IMODE(os.stat(fn).st_mode) | 0555
log.info("changing mode of %s to %o", fn, mode)
if not self.dry_run:
os.chmod(fn, mode)
评论列表
文章目录