Allura/allura/model/repository.py
def zipdir(source, zipfile, exclude=None):
    """Create zip archive using zip binary."""
    zipbin = tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')
    source = source.rstrip('/')
    # this is needed to get proper prefixes inside zip-file
    working_dir = os.path.dirname(source)
    source_fn = os.path.basename(source)
    command = [zipbin, '-y', '-q', '-r', zipfile, source_fn]
    if exclude:
        command += ['-x', exclude]
    p = Popen(command, cwd=working_dir, stdout=PIPE, stderr=PIPE)
    stdout, stderr = p.communicate()
    if p.returncode != 0:
        raise Exception(
            "Command: {0} returned non-zero exit code {1}\n"
            "STDOUT: {2}\n"
            "STDERR: {3}".format(command, p.returncode, stdout, stderr))
Create zip archive using zip binary.
Create zip archive using zip binary.
Create zip archive using zip binary .
def zipdir(source, zipfile, exclude=None):
    zipbin = tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')
    source = source.rstrip('/')
    working_dir = os.path.dirname(source)
    source_fn = os.path.basename(source)
    command = [zipbin, '-y', '-q', '-r', zipfile, source_fn]
    if exclude:
        command += ['-x', exclude]
    p = Popen(command, cwd=working_dir, stdout=PIPE, stderr=PIPE)
    stdout, stderr = p.communicate()
    if p.returncode != 0:
        raise Exception(
            "Command: {0} returned non-zero exit code {1}\n"
            "STDOUT: {2}\n"
            "STDERR: {3}".format(command, p.returncode, stdout, stderr))
def zipdir ( source , zipfile , exclude = None ) : zipbin = tg . config . get ( 'scm.repos.tarball.zip_binary' , '/usr/bin/zip' ) source = source . rstrip ( '/' ) working_dir = os . path . dirname ( source ) source_fn = os . path . basename ( source ) command = [ zipbin , '-y' , '-q' , '-r' , zipfile , source_fn ] if exclude : command += [ '-x' , exclude ] p = Popen ( command , cwd = working_dir , stdout = PIPE , stderr = PIPE ) stdout , stderr = p . communicate ( ) if p . returncode != 0 : raise Exception ( "Command: {0} returned non-zero exit code {1}\n" "STDOUT: {2}\n" "STDERR: {3}" . format ( command , p . returncode , stdout , stderr ) )
Create zip archive using zip binary.
Create zip archive using zip binary .
"""Create zip archive using zip binary.""" # this is needed to get proper prefixes inside zip-file
source
zipfile
exclude