def run(self): _install.run(self) # set the execute bit on scripts that are NOT copied to a bin dir for in_place_script in in_place_scripts: if os.name == 'posix' and not self.dry_run: target = os.path.join(self.install_lib, name, in_place_script) log.info("Set execute bit on: "+ target) chmod(target, 0o777 - current_umask())
def run(self): _install.run(self) # set the execute bit on scripts that are NOT copied to a bin dir for in_place_script in in_place_scripts: if os.name == "posix" and not self.dry_run: target = os.path.join(self.install_lib, name, in_place_script) log.info("Set execute bit on: " + target) chmod(target, 0o777 - current_umask())
def write_script(self, script_name, contents, mode="t", *ignored): """Write an executable file to the scripts directory""" from setuptools.command.easy_install import chmod, current_umask log.info("Installing %s script to %s", script_name, self.install_dir) target = os.path.join(self.install_dir, script_name) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target, "w" + mode) f.write(contents) f.close() chmod(target, 0x1FF - mask) # 0777
def write_script(self, script_name, contents, mode="t", *ignored): """Write an executable file to the scripts directory""" from setuptools.command.easy_install import chmod, current_umask log.info("Installing %s script to %s", script_name, self.install_dir) target = os.path.join(self.install_dir, script_name) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target,"w"+mode) f.write(contents) f.close() chmod(target, 0o777-mask)
def write_script(script_dir, script_name, contents, mode): """ create a script with the specified text """ LOG.info("Installing %s script to %s", script_name, script_dir) target = os.path.join(script_dir, script_name) mask = current_umask() ensure_directory(target) if os.path.exists(target): os.unlink(target) _file = open(target, "w" + mode) _file.write(contents) _file.close() chmod(target, 0o777 - mask)
def write_script(self, script_name, contents, mode="t", *ignored): """Write an executable file to the scripts directory""" if "__PEX_UNVENDORED__" in __import__("os").environ: from setuptools.command.easy_install import chmod, current_umask # vendor:skip else: from pex.third_party.setuptools.command.easy_install import chmod, current_umask log.info("Installing %s script to %s", script_name, self.install_dir) target = os.path.join(self.install_dir, script_name) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target, "w" + mode) f.write(contents) f.close() chmod(target, 0o777 - mask)
def symlink_script(self, scriptname, ep): """Symlink script from scripts directory to entry point module""" from setuptools.command.easy_install import chmod, current_umask # build dest module path dest = os.path.join(self.dest_dir, *ep.module_name.split('.')) + '.py' if not os.path.exists(dest): raise ValueError("Module %s not found (entry_point: %s)" % (dest, ep)) # ep.attrs ignored! target = os.path.join(self.install_dir, scriptname) dest = os.path.relpath(dest, os.path.dirname(target)) log.info('symlink_script: %s -> %s', target, dest) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) if os.path.exists(target): log.info('symlink_script: target exists: %s: replace', target) os.unlink(target) os.symlink(dest, target) # make dest module executable through target chmod(target, 0o777 - mask)