setup_extensions.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:RPKI-toolkit 作者: pavel-odintsov 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号