Example #1
0
File: bosm.py Project: bosm/bos
def _print_pkg_info(name):

    from bomb.package import BosPackage

    Blog.debug('print package info: %s' % name)
    try:
        pkg = BosPackage.open(name)
        pkg.dump()
    except:
        Blog.fatal('invalid package name: %s' % name)

    sys.exit(0)
Example #2
0
File: bosm.py Project: bosm/bos
def _check_package_version():

    from bomb.package import BosPackage

    names = _all_pkgs()
    for name in names:
        pkg = BosPackage.open(name)

        dot_v = os.path.join(Bos.statesdir, name + '.v')
        dot_d = os.path.join(Bos.statesdir, name + '.d')
        if not os.path.exists(dot_v): Bos.touch(dot_v)

        if True == pkg.is_version_diff():
            if os.path.exists(dot_d):
                Blog.info("%s: rebuild required" % name)
                Bos.touch(dot_v)
        else:
            if not os.path.exists(dot_d):
               Bos.touch(os.path.join(Bos.statesdir, name + '.p'))
               Bos.touch(os.path.join(Bos.statesdir, name + '.f'))
               Bos.touch(os.path.join(Bos.statesdir, name + '.b'))
               Bos.touch(dot_d)