From 81b72059118d0f7e40652172925235b4c1786287 Mon Sep 17 00:00:00 2001 From: Sérgio M. Basto Date: Nov 22 2019 14:54:01 +0000 Subject: Remove _setup_default_config_opts not in use since previous commit --- diff --git a/src/FedoraReview/mock.py b/src/FedoraReview/mock.py index 7083214..7cb83be 100644 --- a/src/FedoraReview/mock.py +++ b/src/FedoraReview/mock.py @@ -119,221 +119,6 @@ def _add_buildarch_macros(macros, paths): return buildarch, macros -def _setup_default_config_opts(): - """ sets up default configuration. """ - config_opts = {} - config_opts['basedir'] = '/var/lib/mock' # root name is automatically added to this - config_opts['resultdir'] = '%(basedir)s/%(root)s/result' - config_opts['cache_topdir'] = '/var/cache/mock' - config_opts['clean'] = True - config_opts['check'] = True - config_opts['post_install'] = False - config_opts['chroothome'] = '/builddir' - config_opts['log_config_file'] = 'logging.ini' - config_opts['rpmbuild_timeout'] = 0 - - config_opts['chrootgroup'] = 'mock' - config_opts['chrootuser'] = 'mockbuild' - config_opts['build_log_fmt_name'] = "unadorned" - config_opts['root_log_fmt_name'] = "detailed" - config_opts['state_log_fmt_name'] = "state" - config_opts['online'] = True - config_opts['use_nspawn'] = True - config_opts['rpmbuild_networking'] = False - config_opts['nspawn_args'] = ['--capability=cap_ipc_lock'] - config_opts['use_container_host_hostname'] = True - config_opts['use_bootstrap_container'] = False - - config_opts['internal_dev_setup'] = True - - # cleanup_on_* only take effect for separate --resultdir - # config_opts provides fine-grained control. cmdline only has big hammer - config_opts['cleanup_on_success'] = True - config_opts['cleanup_on_failure'] = True - - config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES', '.bash_history', - '.bashrc'] - - config_opts['createrepo_on_rpms'] = False - config_opts['createrepo_command'] = '/usr/bin/createrepo_c -d -q -x *.src.rpm' # default command - - config_opts['tar'] = "gnutar" - - config_opts['backup_on_clean'] = False - config_opts['backup_base_dir'] = os.path.join(config_opts['basedir'], "backup") - - config_opts['redhat_subscription_required'] = False - - config_opts['plugin_conf'] = { - 'ccache_enable': False, - 'ccache_opts': { - 'max_cache_size': "4G", - 'compress': None, - 'dir': "%(cache_topdir)s/%(root)s/ccache/u%(chrootuid)s/"}, - 'yum_cache_enable': True, - 'yum_cache_opts': { - 'max_age_days': 30, - 'max_metadata_age_days': 30, - 'dir': "%(cache_topdir)s/%(root)s/%(package_manager)s_cache/", - 'target_dir': "/var/cache/%(package_manager)s/", - 'online': True}, - 'root_cache_enable': True, - 'root_cache_opts': { - 'age_check': True, - 'max_age_days': 15, - 'dir': "%(cache_topdir)s/%(root)s/root_cache/", - 'tar': "gnutar", - 'compress_program': 'pigz', - 'decompress_program': None, - 'exclude_dirs': ["./proc", "./sys", "./dev", "./tmp/ccache", "./var/cache/yum", "./var/cache/dnf"], - 'extension': '.gz'}, - 'bind_mount_enable': True, - 'bind_mount_opts': { - 'dirs': [ - # specify like this: - # ('/host/path', '/bind/mount/path/in/chroot/' ), - # ('/another/host/path', '/another/bind/mount/path/in/chroot/'), - ], - 'create_dirs': False}, - 'mount_enable': True, - 'mount_opts': {'dirs': [ - # specify like this: - # ("/dev/device", "/mount/path/in/chroot/", "vfstype", "mount_options"), - ]}, - 'tmpfs_enable': False, - 'tmpfs_opts': { - 'required_ram_mb': 900, - 'max_fs_size': None, - 'mode': '0755', - 'keep_mounted': False}, - 'selinux_enable': True, - 'selinux_opts': {}, - 'package_state_enable': True, - 'package_state_opts': { - 'available_pkgs': False, - 'installed_pkgs': True, - }, - 'pm_request_enable': False, - 'pm_request_opts': {}, - 'lvm_root_enable': False, - 'lvm_root_opts': { - 'pool_name': 'mockbuild', - }, - 'chroot_scan_enable': False, - 'chroot_scan_opts': { - 'regexes': [ - "^[^k]?core(\\.\\d+)?$", "\\.log$", - ], - 'only_failed': True}, - 'sign_enable': False, - 'sign_opts': { - 'cmd': 'rpmsign', - 'opts': '--addsign %(rpms)s', - }, - 'hw_info_enable': True, - 'hw_info_opts': { - }, - 'procenv_enable': False, - 'procenv_opts': { - }, - } - - config_opts['environment'] = { - 'TERM': 'vt100', - 'SHELL': '/bin/bash', - 'HOME': '/builddir', - 'HOSTNAME': 'mock', - 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', - 'PROMPT_COMMAND': r'printf "\033]0;\007"', - 'PS1': r' \s-\v\$ ', - 'LANG': os.environ.setdefault('LANG', 'C.UTF-8'), - } - - # SCM defaults - config_opts['scm'] = False - config_opts['scm_opts'] = { - 'method': 'git', - 'cvs_get': 'cvs -d /srv/cvs co SCM_BRN SCM_PKG', - 'git_get': 'git clone SCM_BRN git://localhost/SCM_PKG.git SCM_PKG', - 'svn_get': 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG', - 'distgit_get': 'rpkg clone -a --branch SCM_BRN SCM_PKG SCM_PKG', - 'distgit_src_get': 'rpkg sources', - 'spec': 'SCM_PKG.spec', - 'ext_src_dir': os.devnull, - 'write_tar': False, - 'git_timestamps': False, - 'exclude_vcs': True, - } - - # dependent on guest OS - config_opts['useradd'] = \ - '/usr/sbin/useradd -o -m -u %(uid)s -g %(gid)s -d %(home)s -n %(user)s' - config_opts['use_host_resolv'] = False - config_opts['chroot_setup_cmd'] = ('groupinstall', 'buildsys-build') - config_opts['target_arch'] = 'i386' - config_opts['releasever'] = None - config_opts['rpmbuild_arch'] = None # <-- None means set automatically from target_arch - config_opts['yum.conf'] = '' - config_opts['yum_builddep_opts'] = [] - config_opts['yum_common_opts'] = [] - config_opts['update_before_build'] = True - config_opts['priorities.conf'] = '\n[main]\nenabled=0' - config_opts['rhnplugin.conf'] = '\n[main]\nenabled=0' - config_opts['subscription-manager.conf'] = '' - config_opts['more_buildreqs'] = {} - config_opts['nosync'] = False - config_opts['nosync_force'] = False - config_opts['files'] = {} - config_opts['macros'] = { - '%_topdir': '%s/build' % config_opts['chroothome'], - '%_rpmfilename': '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm', - } - config_opts['hostname'] = None - config_opts['module_enable'] = [] - config_opts['module_install'] = [] - config_opts['forcearch'] = None - - config_opts['bootstrap_chroot_additional_packages'] = [] - config_opts['bootstrap_module_enable'] = [] - config_opts['bootstrap_module_install'] = [] - - # security config - config_opts['no_root_shells'] = False - config_opts['extra_chroot_dirs'] = [] - - config_opts['package_manager'] = 'yum' - - config_opts['dynamic_buildrequires'] = True - config_opts['dynamic_buildrequires_max_loops'] = 10 - - config_opts['dev_loop_count'] = 12 - - # configurable commands executables - config_opts['yum_command'] = '/usr/bin/yum' - config_opts['system_yum_command'] = '/usr/bin/yum' - config_opts['yum_install_command'] = 'install yum yum-utils shadow-utils distribution-gpg-keys' - config_opts['yum_builddep_command'] = '/usr/bin/yum-builddep' - config_opts['dnf_command'] = '/usr/bin/dnf' - config_opts['system_dnf_command'] = '/usr/bin/dnf' - config_opts['dnf_install_command'] = 'install dnf dnf-plugins-core shadow-utils distribution-gpg-keys' - config_opts['microdnf_command'] = '/usr/bin/microdnf' - # "dnf-install" is special keyword which tells mock to use install but with DNF - config_opts['microdnf_install_command'] = \ - 'dnf-install microdnf dnf dnf-plugins-core shadow-utils distribution-gpg-keys' - config_opts['microdnf_builddep_command'] = '/usr/bin/dnf' - config_opts['microdnf_builddep_opts'] = [] - config_opts['microdnf_common_opts'] = [] - config_opts['rpm_command'] = '/bin/rpm' - config_opts['rpmbuild_command'] = '/usr/bin/rpmbuild' - config_opts['dnf_disable_plugins'] = ['local', 'spacewalk'] - - config_opts['opstimeout'] = 0 - - config_opts['stderr_line_prefix'] = "" - - return config_opts - - class _Mock(HelpersMixin): """ Some basic operations on the mock chroot env, a singleton. """