[git-buildpackage] buildpackage-rpm fails to expand macros in setup

Guido Günther agx at sigxcpu.org
Wed Sep 29 09:49:07 CEST 2021


Hi Quanah,
On Fri, Jul 16, 2021 at 03:58:20PM -0700, Quanah Gibson-Mount wrote:
> I'm building a package that has a subpackage (for an SELinux policy module),
> so I have to play around with the version since the submodule version
> doesn't track with the application version.

Do you have a git repo it could clone to reproduce?
 -- Guido

> 
> %global _pvers 2.1.4
> 
> Name:	mypackage
> Version: %{_pvers}
> Release: 1%{?dist}
> 
> ...
> 
> %package -n mypackage-selinux
> Version: 1.0.0
> 
> ...
> 
> 
> %setup -qn %{name}-%{_pvers}
> 
> This causes buildpackage-rpm to throw a warning because it fails to expand
> %{_pvers} from the global section from this section of __init__.py:
> 
>                elif opts.name:
>                    try:
>                        prefix = self.macro_expand(opts.name) + '/'
>                    except MacroExpandError as err:
>                        gbp.log.warn("Couldn't determine prefix from %%setup
> "
>                                     "macro (%s). Using filename base as a "
>                                     "fallback" % err)
>                        prefix = orig['filename_base'] + '/'
> 
> 
> So it seems that the macro expansion isn't working right.
> 
> --Quanah
> 
> 
> --
> 
> Quanah Gibson-Mount
> Product Architect
> Symas Corporation
> Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
> <http://www.symas.com>
> _______________________________________________
> git-buildpackage mailing list
> git-buildpackage at lists.sigxcpu.org
> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage


More information about the git-buildpackage mailing list