svn commit: r316453 - head/Tools/scripts
Bryan Drewery
bdrewery at FreeBSD.org
Wed Apr 24 16:56:48 UTC 2013
On 4/24/2013 11:54 AM, Emanuel Haupt wrote:
> Author: ehaupt
> Date: Wed Apr 24 16:54:22 2013
> New Revision: 316453
> URL: http://svnweb.freebsd.org/changeset/ports/316453
>
> Log:
> - Rework 'nice people' handling
> - Properly handle non-default $MCom RCS strings
Thanks!
>
> Modified:
> head/Tools/scripts/convert-makefile-header.pl
>
> Modified: head/Tools/scripts/convert-makefile-header.pl
> ==============================================================================
> --- head/Tools/scripts/convert-makefile-header.pl Wed Apr 24 16:53:54 2013 (r316452)
> +++ head/Tools/scripts/convert-makefile-header.pl Wed Apr 24 16:54:22 2013 (r316453)
> @@ -28,7 +28,51 @@ Usage: $bn [OPTION] PORT
> _ENOUSAGE
> }
>
> -my $nicepeople="((\\s|<|^)(araujo|az|avilla|bapt|bdrewery|beat|brooks|crees|eadler|flo|flz|garga|kuriyama|linimon|makc|rm|tabthorpe|wxs)\@freebsd.org|cvs-src\@yandex\.ru|makc\@issp\.ac\.ru|villa\.alberto@|pgollucci\@p6m7g8\.com|bsdkaffee@|baptiste\.daroussin\@gmail.com)";
> +# You may add yourself to the following list if you agree to waive on the
> +# "Created by" attribution
> +sub get_nice_people() {
> + my $committers=[
> + 'araujo',
> + 'az',
> + 'avilla',
> + 'bapt',
> + 'bdrewery',
> + 'beat',
> + 'brooks',
> + 'crees',
> + 'ehaupt',
> + 'eadler',
> + 'flo',
> + 'flz',
> + 'garga',
> + 'kuriyama',
> + 'linimon',
> + 'makc',
> + 'rm',
> + 'tabthorpe',
> + 'wxs'
> + ];
> +
> + # append FreeBSD.org domain to the list of committers
> + map ($_ .= '\@FreeBSD\.org', @$committers);
> +
> + my $maintainers=[
> + 'cvs-src\@yandex\.ru',
> + 'makc\@issp\.ac\.ru',
> + 'villa\.alberto\@',
> + 'pgollucci\@p6m7g8\.com',
> + 'bsdkaffee\@',
> + 'baptiste\.daroussin\@gmail\.com'
> + ];
> +
> + # merge committer and maintainer addresses
> + my @nice_people=(@$committers, @$maintainers);
> +
> + # prepend regex
> + map ($_ = '(\\s|<|^)' . $_, @nice_people);
> +
> + return \@nice_people;
> +}
>
> sub get_creator($) {
> my $header=shift;
> @@ -43,20 +87,10 @@ sub get_creator($) {
> return $creator;
> }
>
> -sub get_mcom($) {
> - my $header=shift;
> - my $mcom;
> - for my $line (@$header) {
> - if ($line=~m'\$MCom:'i) {
> - return $line;
> - }
> - }
> - return "";
> -}
> -
> MAIN: {
> # get options
> my $opt={};
> + my $nice_people=get_nice_people();
> GetOptions($opt, 'help|h', 'rcsonly|r', 'createdby|c', 'nowrite|n');
>
> if(defined($opt->{help})) {
> @@ -71,6 +105,7 @@ MAIN: {
> for my $arg (@ARGV) {
> my @header;
> my @makefile;
> + my @header_exception;
> my $in_header=1;
> if(-f "$arg/Makefile") {
> my $mf=$arg . "/Makefile";
> @@ -83,6 +118,11 @@ MAIN: {
> $in_header=0;
> push(@makefile, $line);
> }
> +
> + # tolerate $MCom RCS tags
> + if($line=~m'\$MCom') {
> + push(@header_exception, $line);
> + }
> }
> close(F);
>
> @@ -99,16 +139,24 @@ MAIN: {
> print $outh "# \$FreeBSD\$\n";
> } elsif(defined($opt->{createdby}) || !defined($opt->{rcsonly})) {
> my $creator=get_creator(\@header);
> - my $mcom=get_mcom(\@header);
> if(defined($creator)) {
> - if ($creator!~m"$nicepeople"i) {
> - print $outh "# Created by: $creator\n";
> + my $is_nice=0;
> + for my $c (@$nice_people) {
> + if($creator=~m"${c}") {
> + $is_nice=1;
> + last;
> + }
> }
> + print $outh "# Created by: $creator\n" if(!$is_nice);
> } else {
> print STDERR "$mf creator not found. Reverting to RCS string only.\n";
> }
> print $outh "# \$FreeBSD\$\n";
> - print $outh $mcom;
> +
> + # append header exceptions
> + for my $h (@header_exception) {
> + print $outh $h . "\n";
> + }
> }
>
> for my $line (@makefile) {
>
--
Regards,
Bryan Drewery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-ports-all/attachments/20130424/0664bd9d/attachment.sig>
More information about the svn-ports-all
mailing list