Updating python-debian support for build profiles

Johannes Schauer j.schauer at email.de
Sun Aug 31 14:14:25 UTC 2014


Hi Stuart,

Quoting Stuart Prescott (2014-08-31 15:40:14)
> I've been contemplating deb822's support for build profiles some more and in
> particular looked the recent changes to the build profiles / build
> restrictions specification. The attached patches are my current thinking on
> the matter.

oh wow thanks a lot! I actually was already prepared to prepare a patch myself
because it is us who pushed the first version even though it had some flaws.
Thanks a lot for working on this!

> The main changes are:
> 
> * there now can be multiple sets of < … > restrictions specified for each 
> package

This is implemented in a similar way of the dpkg patch for this: get everything
inside the <> brackets and then split by '>\s+<'. Though notice that there
should be a space between each <> block but you write '>\s*<' which also allows
no space at all.

> * as a result, we need to return a list of restrictions not a single
> restriction

Especially after the change we were unsure whether the "restriction lists"
should in fact be "build profile lists" but I guess we stick to the former.

> * I propose flattening the representation of each restriction from (enabled,
> (namespace, label)) to (enabled, namespace, label)

There are no namespaces anymore. This was discussed at the bootstrap sprint but
I did not yet update the spec with it because I wanted to wait whether there
were any objections against that either on the mailing list or after wookey's
talk at debconf where he mentioned this. Since there seemed to be no
resistance, there are no namespaces anymore and things become much simpler now.

I updated the spec accordingly now.

Sorry that this means that you did some unneeded extra work because of this
mess. If you are short on time, then I can fix your patch to reflect the latest
update.

> * Following John's suggestion, I'm looking to use namedtuples to provide
> backwards compatibility for the architecture restrictions while also
> providing a nicer syntax for accessors to both arch and build restrictions
> objects.
> 
> 
> As you will see in the patches, that means that 
> 
>       "texlive <!profile.cross>"   
> 
> becomes
> 
>                     [[(false, 'profile', 'cross')]]

Which would now be:

                      [[(false, 'cross')]]

> 
> and
> 
>     'debhelper (>> 5.0.0)  <!profile.stage1> <!profile.cross !profile.stage2>'
> 
> becomes
> 
>         [
>                         [(False, 'profile', 'stage1')],
>                         [(False, 'profile', 'stage2'),
>                          (False, 'profile', 'cross')]
>         ]

Which would now be:

          [
                          [(False, 'stage1')],
                          [(False, 'stage2'),
                           (False, 'cross')]
          ]


> The innermost tuple is also accessible as a namedtuple (enabled, namespace, 
> label).

Named tuples are a nifty idea. I guess they are still useful even though there
are no namespaces anymore.

> Comments and suggestions welcome!

Thanks again!

cheers, josch



More information about the pkg-python-debian-maint mailing list