def _make_zipfile(base_name, base_dir, verbose=<NUM_LIT:0>, dry_run=<NUM_LIT:0>, logger=None):
zip_filename = base_name + "<STR_LIT>"<EOL>archive_dir = os.path.dirname(base_name)<EOL>if not os.path.exists(archive_dir):<EOL><INDENT>if logger is not None:<EOL><INDENT>logger.info("<STR_LIT>", archive_dir)<EOL><DEDENT>if not dry_run:<EOL><INDENT>os.makedirs(archive_dir)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>import zipfile<EOL><DEDENT>except ImportError:<EOL><INDENT>zipfile = None<EOL><DEDENT>if zipfile is None:<EOL><INDENT>_call_external_zip(base_dir, zip_filename, verbose, dry_run)<EOL><DEDENT>else:<EOL><INDENT>if logger is not None:<EOL><INDENT>logger.info("<STR_LIT>",<EOL>zip_filename, base_dir)<EOL><DEDENT>if not dry_run:<EOL><INDENT>zip = zipfile.ZipFile(zip_filename, "<STR_LIT:w>",<EOL>compression=zipfile.ZIP_DEFLATED)<EOL>for dirpath, dirnames, filenames in os.walk(base_dir):<EOL><INDENT>for name in filenames:<EOL><INDENT>path = os.path.normpath(os.path.join(dirpath, name))<EOL>if os.path.isfile(path):<EOL><INDENT>zip.write(path, path)<EOL>if logger is not None:<EOL><INDENT>logger.info("<STR_LIT>", path)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>zip.close()<EOL><DEDENT><DEDENT>return zip_filename<EOL>
Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises ExecError.  Returns the name of the output zip
    file.