[pacman-dev] [PATCH 1/2] makepkg-template: ignore duplicates per option

Florian Pritz bluewind at xinu.at
Mon Jun 8 19:20:57 UTC 2015


On 08.06.2015 11:28, Dominik Fischer wrote:
> When templates recursively include other templates, a diamond problem,
> similar to multiple inheritance, may occur. It is illustrated in the
> test case. As templates may consist of arbitrary code, it may be
> unwanted to execute a template twice. This patch provides a solution to
> some simple cases of this problem by completely ignoring every template
> occurrence but the first for each template name.

I'm not a fan of this being a command line option, but I'm also unsure
if I like the option at all. templates shouldn't change their meaning
(they shouldn't go from a simple variable definition to a package()
function) and if a PKGBUILD includes 2 templates that both provide
package() then that's a bug in the PKGBUILD and will be noticed when the
templates are used the first time.

Anyone else wants to weigh in?

> diff --git a/test/scripts/makepkg-template-tests/diamond-input/PKGBUILD.expanded b/test/scripts/makepkg-template-tests/diamond-input/PKGBUILD.expanded
> new file mode 100644
> index 0000000..8077581
> --- /dev/null
> +++ b/test/scripts/makepkg-template-tests/diamond-input/PKGBUILD.expanded

This file is not used anywhere?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20150608/7082c0ed/attachment.asc>


More information about the pacman-dev mailing list