How to use the cget.util.mkdir function in cget

To help you get started, we’ve selected a few cget 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 pfultz2 / cget / test / test_cget.py View on Github external
def mkdir(self, *args):
        p = os.path.join(self.tmp_dir, *args)
        cget.util.mkdir(p)
        return DirForTests(p)
github pfultz2 / cget / test / test_cget.py View on Github external
def test_symlink_in_prefix(d):
    p = d.get_path('usr')
    if cget.util.USE_SYMLINKS:
        cget.util.mkdir(os.path.join(p, 'share', 'man'))
        os.symlink(os.path.join(p, 'share', 'man'), os.path.join(p, 'man'))
    d.cmds(install_cmds(url=get_exists_path('libsimple'), lib='simple', prefix=p))
github pfultz2 / cget / cget / prefix.py View on Github external
def create_builder(self, name, tmp=False):
        pre = ''
        if tmp: pre = 'tmp-'
        d = self.get_builder_path(pre + name)
        exists = os.path.exists(d)
        util.mkdir(d)
        yield Builder(self, d, exists)
        if tmp: shutil.rmtree(d, ignore_errors=True)
github pfultz2 / cget / cget / prefix.py View on Github external
def unlink(self, pkg, delete=False):
        pkg = self.parse_pkg_src(pkg)
        pkg_dir = self.get_package_directory(pkg.to_fname())
        unlink_dir = self.get_unlink_directory(pkg.to_fname())
        self.log("Unlink:", pkg_dir)
        if os.path.exists(pkg_dir):
            if util.USE_SYMLINKS:
                util.rm_symlink_from(os.path.join(pkg_dir, 'install'), self.prefix)
            else:
                util.rm_dup_dir(os.path.join(pkg_dir, 'install'), self.prefix, remove_both=False)
            util.rm_empty_dirs(self.prefix)
            if delete: shutil.rmtree(pkg_dir)
            else:
                util.mkdir(self.get_unlink_directory())
                os.rename(pkg_dir, unlink_dir)
github pfultz2 / cget / cget / builder.py View on Github external
def configure(self, src_dir, defines=None, generator=None, install_prefix=None, test=True, variant=None):
        self.prefix.log("configure")
        util.mkdir(self.build_dir)
        args = [
            src_dir, 
            '-DCGET_CMAKE_DIR={}'.format(util.cget_dir('cmake')), 
            '-DCGET_CMAKE_ORIGINAL_SOURCE_FILE={}'.format(os.path.join(src_dir, self.cmake_original_file))
        ]
        for d in defines or []:
            args.append('-D{0}'.format(d))
        if generator is not None: args = ['-G', generator] + args
        if self.prefix.verbose: args.extend(['-DCMAKE_VERBOSE_MAKEFILE=On'])
        if test: args.extend(['-DBUILD_TESTING=On'])
        else: args.extend(['-DBUILD_TESTING=Off'])
        args.extend(['-DCMAKE_BUILD_TYPE={}'.format(variant or 'Release')])
        if install_prefix is not None: args.extend(['-DCMAKE_INSTALL_PREFIX=' + install_prefix])
        try:
            self.cmake(args=args, cwd=self.build_dir, use_toolchain=True)
        except: