On Thursday, July 9, 2020 2:17:06 PM CEST Sam Varshavchik wrote:
> Is there a better way to include local repos in mock builds than doing  
> something like this in my /etc/mock/default.cfg:
> 
> include('fedora-32-x86_64.cfg')
> 
> config_opts['dnf.conf'] = config_opts['dnf.conf'] + """
> 
> [my]
> name=My repository
> baseurl=http://jack/repos/$releasever/$basearch
> enabled=1
> gpgcheck=0
> metadata_expire=60
> 
> """

The default.cfg is ought to be just a symlink to the config which represents
the system you are running mock on.  E.g. `fedora-32-x86_64` on Feodra 32 x86_64
host.

Otherwise I think your approach is fairly "optimal".  I'd though encourage
you to also change the `root` config option -- to not mix-up various kinds
of mock caches for the default f32 and customized f32 configs:

  $ cat my_enhanced_mock.cfg
  include('fedora-32-x86_64.cfg')

  config_opts['root'] = "my-fedora-32-x86_64"
  config_opts['dnf.conf'] = config_opts['dnf.conf'] + """
  [my]
  name=My repository
  baseurl=http://jack/repos/$releasever/$basearch
  enabled=1
  gpgcheck=0
  metadata_expire=60
  """

The default set of repositories should basically match the default
/etc/yum.repos.d content.

> I might be misremembering something, but I'm pretty sure that at some
> point in the past mock would read /etc/yum/repos.d, and grab stuff from
> my local repos without doing anything like that.

I don't think that was ever the case.  Mock tries to mimic the default
distro buildsystem behavior (the same minimal buildroot, set of packages
available in repos, etc.), and including custom repos from /etc/yum.repos.d
would certainly break the packager's assumptions.  Also, that repos would only
be useful for the `default.cfg`, nothing else.

Pavel


_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to