On 2012-06-08 23:49, P. J. McDermott wrote:
> Then could you (or anyone else) suggest a way to handle "Build-Depends-
> StageN" and "Build-Depends-Indep-StageN" fields for any values of "N"?
> Any clues in this direction would be appreciated. I'll look further
> through the code tomorrow to see if I can come up with anything.
Looking through the uses of %FIELDS in Dpkg::Control::Fields, I've come
up with the following idea of a generic implementation to recognize
fields for any numbered build stage.
I propose supporting the use of regular expressions in %FIELDS keys.
Staged build dependency fields can then be defined generally as follows:
'Build-Depends-Stage\d' => {
allowed => ALL_SRC,
dependency => 'normal',
dep_order => 3,
},
'Build-Depends-Indep-Stage\d' => {
allowed => ALL_SRC,
dependency => 'normal',
dep_order => 4,
},
And the subroutines in Dpkg::Control::Fields that get values from
%FIELDS can call the following new subroutine to do so:
sub field_get($) {
my ($field) = @_;
foreach my $key (keys %FIELDS) {
return $FIELDS{$key} if $field =~ m/^$key$/;
}
return undef;
}
This should be fairly unintrusive. I'll test this further and check to
see if I've overlooked any complications before adding this to Wookey's
patch. Does this solution look obviously wrong in any way?
Thanks,
--
P. J. McDermott (_/@\_) ,--.
http://www.pehjota.net/ o < o o > / oo \
http://www.pehjota.net/contact.html o \ `-/ | <> |.
o o o "~v /_\--/_/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]