Example #1
0
def prepare_command():
    log.mark('preparing couchdb')
    log.info('removing unneeded erlang packages')
    with config['couchdb_dir'].as_working_dir():
        lib_dir = path('lib')
        for lib_name in rm_erl_libs:
            lib = lib_dir.dirs(lib_name)
            if lib:
                lib[0].rmtree()
            else:
                log.warn('could not find %s' % lib_name)

        for rm in [
                'erts-*/src',
                'erts-*/include',
                'erts-*/man',
                'erts-*/doc',
                'lib/*/src',
                'lib/*/examples',
                'lib/*/include',
                'share/info',
                'share/couchdb/www/docs/',
        ]:
            for p in path('.').glob(rm):
                p.rmtree(ignore_errors=True)
Example #2
0
def _log_function_call(func, *args, **kw):
    message = func.__name__
    if args:
        message += ' ' + ' '.join(map(str, args))
    if kw:
        kw_str = ' '.join(['%s %r' % (k, v) for k, v in iteritems(kw)])
        message += '(' + kw_str + ')'
    log.info(message)
Example #3
0
def _log_function_call(func, *args, **kw):
    message = func.__name__
    if args:
        message += ' ' + ' '.join(map(str, args))
    if kw:
        kw_str = ' '.join(['%s %r' % (k, v) for k, v in kw.items()])
        message += '(' + kw_str + ')'
    log.info(message)
Example #4
0
def _log_function_call(func, *args, **kw):
    message = func.__name__
    if args:
        message += ' ' + ' '.join(map(str, args))
    if kw:
        # for python2 iteritems would be better, however items() works everywhere and is reasonably well for python2
        kw_str = ' '.join(['%s %r' % (k, v) for k, v in kw.items()])
        message += '(' + kw_str + ')'
    log.info(message)
Example #5
0
    def tar(self, dest, archive_base=None):
        dest = path(dest)
        if archive_base is None:
            archive_base = path(self.dest.basename()).splitext()[0]
        tar = tarfile.open(dest, 'w:gz')

        for f in self:
            log.info('adding %s', f)
            tar.add(f, arcname=archive_base / f, recursive=False)
        tar.close()
Example #6
0
 def tar(self, dest, archive_base=None):
     dest = path(dest)
     if archive_base is None:
         archive_base = path(self.dest.basename()).splitext()[0]
     tar = tarfile.open(dest, 'w:gz')
 
     for f in self:
         log.info('adding %s', f)
         tar.add(f, arcname=archive_base/f, recursive=False)
     tar.close()
Example #7
0
def unpack_command():
    log.mark('unpacking packages')
    config['build_dir'].ensure_dir()
    with config['build_dir'].as_working_dir():
        for fname in [config['geocouch_pkg'], config['couchdb_pkg'],
            config['openssl_pkg'], config['gdal_pkg'], config['geos_pkg'],
            config['proj4_pkg'], config['mapproxy_templates_pkg']]:

            log.info('unpacking %s', fname)
            tar = tarfile.open(fname)
            tar.extractall(members=no_repo(tar))
            tar.close()
Example #8
0
def unpack_command():
    log.mark('unpacking packages')
    config['build_dir'].ensure_dir()
    with config['build_dir'].as_working_dir():
        for fname in [
                config['geocouch_pkg'], config['couchdb_pkg'],
                config['openssl_pkg'], config['gdal_pkg'], config['geos_pkg'],
                config['proj4_pkg'], config['mapproxy_templates_pkg']
        ]:

            log.info('unpacking %s', fname)
            tar = tarfile.open(fname)
            tar.extractall(members=no_repo(tar))
            tar.close()
Example #9
0
def prepare_command():
    log.mark('preparing couchdb')
    log.info('removing unneeded erlang packages')
    with config['couchdb_dir'].as_working_dir():
        lib_dir = path('lib')
        for lib_name in rm_erl_libs:
            lib = lib_dir.dirs(lib_name)
            if lib:
                lib[0].rmtree()
            else:
                log.warn('could not find %s' % lib_name)

        for rm in [
            'erts-*/src', 'erts-*/include', 'erts-*/man', 'erts-*/doc',
            'lib/*/src', 'lib/*/examples', 'lib/*/include',
            'share/info', 'share/couchdb/www/docs/',
        ]:
            for p in path('.').glob(rm):
                p.rmtree(ignore_errors=True)
Example #10
0
def dry(message, func, *args, **kw):
    log.info(message)

    if not options.dry:
        return func(*args, **kw)
Example #11
0
def dry(message, func, *args, **kw):
    log.info(message)
    
    if not options.dry:
        return func(*args, **kw)