How to use the rosdep.core.create_tempfile_from_string_and_execute function in rosdep

To help you get started, we’ve selected a few rosdep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ros / ros / tools / rosdep / src / rosdep / installers.py View on Github external
def check_presence(self):

        return rosdep.core.create_tempfile_from_string_and_execute(self.check_presence_command)
github ros / ros / tools / rosdep / src / rosdep / installers.py View on Github external
def generate_package_install_command(self, default_yes = False, execute = True, display = True):
        script = '!#/bin/bash\n#no script'
        packages_to_install = self.get_packages_to_install()
        if not packages_to_install:
            script =  "#!/bin/bash\n#No Packages to install"
        script = "#!/bin/bash\n#Packages %s\nsudo port install "%packages_to_install + ' '.join(packages_to_install)        

        if execute:
            return rosdep.core.create_tempfile_from_string_and_execute(script)
        elif display:
            print "To install packages: %s would have executed script\n{{{\n%s\n}}}"%(packages_to_install, script)
        return False
github ros / ros / tools / rosdep / src / rosdep / installers.py View on Github external
def generate_package_install_command(self, default_yes = False, execute = True, display = True):
        script = '!#/bin/bash\n#no script'
        packages_to_install = self.get_packages_to_install()
        if not packages_to_install:
            script = "#!/bin/bash\n#No Packages to install"
        elif default_yes:
            script = "#!/bin/bash\n#Packages %s\nsudo yum install -y "%packages_to_install + ' '.join(packages_to_install)        
        else:
            script = "#!/bin/bash\n#Packages %s\nsudo yum install "%packages_to_install + ' '.join(packages_to_install)

        if execute:
            return rosdep.core.create_tempfile_from_string_and_execute(script)
        elif display:
            print "To install packages: %s would have executed script\n{{{\n%s\n}}}"%(packages_to_install, script)
        return False
github ros / ros / tools / rosdep / src / rosdep / installers.py View on Github external
raise rosdep.core.RosdepException("md5sum check on %s and %s failed.  Expected %s got %s and %s"%(self.tarball, self.alternate_tarball, self.tarball_md5sum, hash1, hash2))
                else:
                    raise rosdep.core.RosdepException("md5sum check on %s failed.  Expected %s got %s "%(self.tarball, self.tarball_md5sum, hash1))
            
        else:
            if "ROSDEP_DEBUG" in os.environ:
                print "No md5sum defined for tarball, not checking."
            
        try:
            tarf = tarfile.open(filename)
            tarf.extractall(tempdir)

            if execute:
                if "ROSDEP_DEBUG" in os.environ:
                    print "Running installation script"
                success = rosdep.core.create_tempfile_from_string_and_execute(self.install_command, os.path.join(tempdir, self.exec_path))
            elif display:
                print "Would have executed\n{{{%s\n}}}"%self.install_command
            
        finally:
            shutil.rmtree(tempdir)
            os.remove(f[0])

        if success:
            if "ROSDEP_DEBUG" in os.environ:
                print "successfully executed script"
            return True
        return False