Exemple #1
0
	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())
Exemple #2
0
 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())
Exemple #3
0
	def run (self):
		install.run(self)

		if not self.dry_run:
			for names in ( names for section,names in files() if section == 'etc/exaproxy/redirector'):
				for name in names:
					location = os.path.join(self.install_data,name)
					chmod(location, 0755) # the 0 make the value octal
			self.install_data
Exemple #4
0
def fix_permissions(dist):
    """ Buildout doesn't fix the package permissions like easy_install, here
        we replicate distributes's method at easy_install.unpack_and_compile
    """
    for root, _, files in os.walk(dist.location):
        for f in [os.path.join(root, i) for i in files]:
            if f.endswith('.py') or f.endswith('.dll') or \
               f.endswith('.so') and not 'EGG-INFO' in f:
                mode = ((os.stat(f)[stat.ST_MODE]) | 0o555) & 0o7755
                chmod(os.path.join(f), mode)
Exemple #5
0
def fix_permissions(dist):
    """ Buildout doesn't fix the package permissions like easy_install, here
        we replicate distributes's method at easy_install.unpack_and_compile
    """
    for root, _, files in os.walk(dist.location):
        for f in [os.path.join(root, i) for i in files]:
            if f.endswith('.py') or f.endswith('.dll') or \
               f.endswith('.so') and not 'EGG-INFO' in f:
                mode = ((os.stat(f)[stat.ST_MODE]) | 0555) & 07755
                chmod(os.path.join(f), mode)
    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
        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)

        if not self.dry_run:
            ensure_directory(target)
            f = open(target, "w" + mode)
            f.write(contents)
            f.close()
            chmod(target, 0o755)
Exemple #7
0
    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
        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)

        if not self.dry_run:
            ensure_directory(target)
            f = open(target,"w"+mode)
            f.write(contents)
            f.close()
            chmod(target,0755)
Exemple #8
0
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)
Exemple #10
0
    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)