How to use the cget.util.mkfile 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 test_rm_with_symlink(d):
    p = d.get_path('usr')
    share = os.path.join(p, 'share')
    cget.util.mkfile(share, 'data.txt', 'data')
    if cget.util.USE_SYMLINKS:
        os.symlink(os.path.join(share, 'data.txt'), os.path.join(share, 'data.sym'))
    else:
        cget.util.mkfile(share, 'data.sym', 'data')
    os.remove(os.path.join(share, 'data.txt'))
    cg = CGetCmd(prefix=p)
    d.cmds([
        cg('install', '--verbose --test', 'simple,'+get_exists_path('libsimple')),
        cg('size', '1'),
        cg('rm', '--verbose -y', 'simple'),
        cg('size', '0')
    ])
    assert os.path.exists(os.path.join(share))
    assert not os.path.exists(os.path.join(share, 'data.txt'))
    assert os.path.lexists(os.path.join(share, 'data.sym'))
github pfultz2 / cget / test / test_cget.py View on Github external
def test_rm_with_symlink(d):
    p = d.get_path('usr')
    share = os.path.join(p, 'share')
    cget.util.mkfile(share, 'data.txt', 'data')
    if cget.util.USE_SYMLINKS:
        os.symlink(os.path.join(share, 'data.txt'), os.path.join(share, 'data.sym'))
    else:
        cget.util.mkfile(share, 'data.sym', 'data')
    os.remove(os.path.join(share, 'data.txt'))
    cg = CGetCmd(prefix=p)
    d.cmds([
        cg('install', '--verbose --test', 'simple,'+get_exists_path('libsimple')),
        cg('size', '1'),
        cg('rm', '--verbose -y', 'simple'),
        cg('size', '0')
    ])
    assert os.path.exists(os.path.join(share))
    assert not os.path.exists(os.path.join(share, 'data.txt'))
    assert os.path.lexists(os.path.join(share, 'data.sym'))
github pfultz2 / cget / cget / prefix.py View on Github external
def write_parent(self, pb, track=True):
        if track and pb.parent is not None: util.mkfile(self.get_deps_directory(pb.to_fname()), pb.parent, pb.parent)
github pfultz2 / cget / cget / prefix.py View on Github external
def write_cmake(self, always_write=False, **kwargs):
        return util.mkfile(self.get_private_path(), 'cget.cmake', self.generate_cmake_toolchain(**kwargs), always_write=always_write)