Re: [CentOS] Mock config error

2020-08-25 Thread me

On Tue, 25 Aug 2020, Peter wrote:


On 25/08/20 11:27 am, Jonathan Billings wrote:

 On Aug 24, 2020, at 16:48, m...@tdiehl.org wrote:


 Also, I am trying to add a dist tag to rpms that I build in mock.
 In the epel-7 configs I do something like the following:
 config_opts['macros']['%dist'] = '.el7.tnt' to get a dist tag on the
 rpms. In epel/centos 8 this does not work.

 Does anyone know how to apply a dist tag in the epel-8 mock configs?


config_opts['macros']['%dist'] = '.gf.el8'

...works for me without any further changes:
http://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/


 Is mock documented anywhere besides the src code? I cannot find any
 documentation that explains what actually needs to be in a mock
 configuration file or in this case how to specify my own dist tag.


/etc/mock/site-defaults.cfg documents all of the possible config settings, 
then there is:


https://github.com/rpm-software-management/mock/wiki


 It seems that the OpenSUSE mock configs[1] use the same syntax.  I wonder
 if you need to invoke mock in a specific way to not override the macro?


Not that I have been able to tell.  Setting the dist macro has always just 
worked for me.


In looking at the centos-release.spec I found the following:
%define dist .el%{dist_release_version}
Apparently this overrides the dist tag set in mock. At least that explains why
the dist tag macro was working for me in el7 but not el8. Commenting out that
line in the spec file fixed the problem.

Thanks for the help.

Regards,

--
Tom m...@tdiehl.org
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Mock config error

2020-08-24 Thread Peter

On 25/08/20 11:27 am, Jonathan Billings wrote:

On Aug 24, 2020, at 16:48, m...@tdiehl.org wrote:


Also, I am trying to add a dist tag to rpms that I build in mock.
In the epel-7 configs I do something like the following:
config_opts['macros']['%dist'] = '.el7.tnt' to get a dist tag on the
rpms. In epel/centos 8 this does not work.

Does anyone know how to apply a dist tag in the epel-8 mock configs?


config_opts['macros']['%dist'] = '.gf.el8'

...works for me without any further changes:
http://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/


Is mock documented anywhere besides the src code? I cannot find any
documentation that explains what actually needs to be in a mock
configuration file or in this case how to specify my own dist tag.


/etc/mock/site-defaults.cfg documents all of the possible config 
settings, then there is:


https://github.com/rpm-software-management/mock/wiki


It seems that the OpenSUSE mock configs[1] use the same syntax.  I wonder if 
you need to invoke mock in a specific way to not override the macro?


Not that I have been able to tell.  Setting the dist macro has always 
just worked for me.



Peter
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Mock config error

2020-08-24 Thread Jonathan Billings
On Aug 24, 2020, at 16:48, m...@tdiehl.org wrote:
> 
> Also, I am trying to add a dist tag to rpms that I build in mock.
> In the epel-7 configs I do something like the following:
> config_opts['macros']['%dist'] = '.el7.tnt' to get a dist tag on the
> rpms. In epel/centos 8 this does not work.
> 
> If I run "mock --debug-config epel-8-x86_64"
> I see '%dist': '.el8.tnt'} in the output but the rpm name does not have the 
> el8.tnt tag in the name.
> 
> Below is what I actually get:
> (vgeppetto3 pts19) $ ll 
> /var/lib/mock/epel-8-x86_64/result/centos-release-8.2-2.2004.0.1.el8.1.x86_64.rpm
>  -rw-r--r--. 1 mock mock 20404 Aug 24 13:32 
> /var/lib/mock/epel-8-x86_64/result/centos-release-8.2-2.2004.0.1.el8.1.x86_64.rpm
> (vgeppetto3 pts19)
> 
> I have the following in the spec file:
> Release:%{centos_rel}.0.1%{?dist}.1
> 
> Does anyone know how to apply a dist tag in the epel-8 mock configs?
> 
> Is mock documented anywhere besides the src code? I cannot find any
> documentation that explains what actually needs to be in a mock
> configuration file or in this case how to specify my own dist tag.


Hello,

It seems that the OpenSUSE mock configs[1] use the same syntax.  I wonder if 
you need to invoke mock in a specific way to not override the macro?


1. 
https://github.com/rpm-software-management/mock/blob/master/mock-core-configs/etc/mock/opensuse-leap-15.2-x86_64.cfg

--
Jonathan Billings 
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Mock config error

2020-08-24 Thread me

Hi Jonathan,

On Sun, 23 Aug 2020, Jonathan Billings wrote:


On Aug 23, 2020, at 12:07, m...@tdiehl.org wrote:


Hi,

I am trying to create a mock configuration file that points to my local dnf 
repo.
I have the following in the mock config template:

[local-repo]
name=my-Local
baseurl=http://yumrepo.example.com/yum-repository/local/centos/8/x86_64/ 
failovermethod=priority
skip_if_unavailable=False

When I try to run mock I get the following error:

(vgeppetto3 pts18) $ mock -v -r epel-8-x86_64 
/home/mock/rpmbuild/SRPMS/centos-release-8.2-2.2004.0.1.el8.1.src.rpm

 File "", line 238

   baseurl=http://yumrepo.example.com/yum-repository/local/centos/8/x86_64/

   ^
SyntaxError: invalid syntax

ERROR: Error in configuration
(vgeppetto3 pts18) $

I copied the url out of a yum repo file I am using that works with dnf on a 
centos 8 machine.

Can someone tell me what I am doing wrong?


I assume you added the yum repo after a line that looks like this:


That was what I was missing. Fixing that and changing the order of the template
lines in epel-8-x86_64.cfg resolved the issue. Thanks for that!!



config_opts['dnf.conf'] += """


And before a line that looks like this:


Also, I am trying to add a dist tag to rpms that I build in mock.
In the epel-7 configs I do something like the following:
config_opts['macros']['%dist'] = '.el7.tnt' to get a dist tag on the
rpms. In epel/centos 8 this does not work.

If I run "mock --debug-config epel-8-x86_64"
I see '%dist': '.el8.tnt'} in the output but the rpm name 
does not have the el8.tnt tag in the name.


Below is what I actually get:
(vgeppetto3 pts19) $ ll /var/lib/mock/epel-8-x86_64/result/centos-release-8.2-2.2004.0.1.el8.1.x86_64.rpm 
-rw-r--r--. 1 mock mock 20404 Aug 24 13:32 /var/lib/mock/epel-8-x86_64/result/centos-release-8.2-2.2004.0.1.el8.1.x86_64.rpm

(vgeppetto3 pts19)

I have the following in the spec file:
Release:%{centos_rel}.0.1%{?dist}.1

Does anyone know how to apply a dist tag in the epel-8 mock configs?

Is mock documented anywhere besides the src code? I cannot find any
documentation that explains what actually needs to be in a mock
configuration file or in this case how to specify my own dist tag.

Regards,

--
Tom m...@tdiehl.org
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Mock config error

2020-08-23 Thread Jonathan Billings
On Aug 23, 2020, at 12:07, m...@tdiehl.org wrote:
> 
> Hi,
> 
> I am trying to create a mock configuration file that points to my local dnf 
> repo.
> I have the following in the mock config template:
> 
> [local-repo]
> name=my-Local
> baseurl=http://yumrepo.example.com/yum-repository/local/centos/8/x86_64/ 
> failovermethod=priority
> skip_if_unavailable=False
> 
> When I try to run mock I get the following error:
> 
> (vgeppetto3 pts18) $ mock -v -r epel-8-x86_64 
> /home/mock/rpmbuild/SRPMS/centos-release-8.2-2.2004.0.1.el8.1.src.rpm
> 
>  File "", line 238
> 
>baseurl=http://yumrepo.example.com/yum-repository/local/centos/8/x86_64/
> 
>^
> SyntaxError: invalid syntax
> 
> ERROR: Error in configuration
> (vgeppetto3 pts18) $
> 
> I copied the url out of a yum repo file I am using that works with dnf on a 
> centos 8 machine.
> 
> Can someone tell me what I am doing wrong?

I assume you added the yum repo after a line that looks like this:

config_opts['dnf.conf'] += """


And before a line that looks like this:


“””

--
Jonathan Billings 
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos