2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

98_Installer: add co-author and last editor support

git-svn-id: https://svn.fhem.de/fhem/trunk@18880 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2019-03-12 21:10:58 +00:00
parent 15f55dc539
commit e11e9cca11
2 changed files with 61 additions and 16 deletions

View File

@ -1593,12 +1593,17 @@ sub CreateMetadataList ($$$) {
next if ( $_ eq '' );
my $authorName;
my $authorEditorOnly;
my $authorEmail;
my $authorNameEmail;
if ( $_ =~ m/^([^<>\n\r]+)(?:\s+(?:<(.*)>))?$/ ) {
$authorName = $1;
$authorEmail = $2;
if ( $_ =~
m/^([^<>\n\r]+?)(?:\s+(\(last release only\)))?(?:\s+(?:<(.*)>))?$/
)
{
$authorName = $1;
$authorEditorOnly = $2 ? ' ' . $2 : '';
$authorEmail = $3;
}
if ( $authorName eq 'unknown' ) {
$l .= '-';
@ -1608,9 +1613,11 @@ sub CreateMetadataList ($$$) {
$authorNameEmail =
'<a href="mailto:'
. $authorEmail . '">'
. $authorName . '</a>'
. $authorName
. $authorEditorOnly . '</a>'
if ( $html && $authorEmail );
# add alias name if different
if ( defined( $modMeta->{x_fhem_maintainer} )
&& ref( $modMeta->{x_fhem_maintainer} ) eq 'ARRAY'
&& @{ $modMeta->{x_fhem_maintainer} } > 0
@ -1630,7 +1637,10 @@ sub CreateMetadataList ($$$) {
$l .= $lb if ($counter);
$l .= $lb . 'Co-' . $mAttrName . ':' . $lb
if ( $counter == 1 );
$l .= $authorNameEmail ? $authorNameEmail : $authorName;
$l .=
$authorNameEmail
? $authorNameEmail
: $authorName . $authorEditorOnly;
$counter++;
}

View File

@ -670,7 +670,8 @@ m/(\$Id\: ((?:([0-9]+)_)?([\w]+)\.([\w]+))\s([0-9]+)\s((([0-9]+)-([0-9]+)-([0-9]
$vcs[12] = $13; # commit hour
$vcs[13] = $14; # commit minute
$vcs[14] = $15; # commit second
$vcs[15] = $16; # svn username (COULD be maintainer)
$vcs[15] = $16; # svn username (COULD be maintainer
# if not in MAINTAINER.txt)
# These items are added later in the code:
# $vcs[16] - commit unix timestamp
@ -1138,16 +1139,41 @@ m/(^#\s+(?:\d{1,2}\.\d{1,2}\.(?:\d{2}|\d{4})\s+)?[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?
# mandatory
unless ( $modMeta->{author} ) {
if ( defined( $modMeta->{x_vcs} ) ) {
$modMeta->{author} = [ $modMeta->{x_vcs}[15] . ' <>' ];
if ( defined( $moduleMaintainers{ $modMeta->{x_file}[4] } ) ) {
foreach (
split( '/', $moduleMaintainers{ $modMeta->{x_file}[4] }[1] ) )
{
push @{ $modMeta->{author} }, $_;
}
# last update was not by one of the named authors
if ( defined( $modMeta->{x_vcs} ) ) {
my $lastEditor = $modMeta->{x_vcs}[15];
push @{ $modMeta->{author} },
$modMeta->{x_vcs}[15] . ' (last release only) <>'
unless ( grep( m/^$lastEditor$/i, @{ $modMeta->{author} } ) );
}
}
else {
$modMeta->{author} = ['unknown <>'];
}
}
unless ( $modMeta->{x_fhem_maintainer} ) {
if ( defined( $modMeta->{x_vcs} ) ) {
$modMeta->{x_fhem_maintainer} = [ $modMeta->{x_vcs}[15] ];
if ( defined( $moduleMaintainers{ $modMeta->{x_file}[4] } ) ) {
foreach (
split( '/', $moduleMaintainers{ $modMeta->{x_file}[4] }[1] ) )
{
push @{ $modMeta->{x_fhem_maintainer} }, $_;
}
# last update was not by one of the named authors
if ( defined( $modMeta->{x_vcs} ) ) {
my $lastEditor = $modMeta->{x_vcs}[15];
push @{ $modMeta->{x_fhem_maintainer} }, $modMeta->{x_vcs}[15]
unless (
grep( m/^$lastEditor$/i, @{ $modMeta->{x_fhem_maintainer} } )
);
}
}
}
@ -1262,6 +1288,7 @@ sub __GetMaintainerdata {
. join( ' ', @line );
}
else {
$moduleMaintainers{ $maintainer[0][4] } = \@maintainer;
}
}
@ -1350,6 +1377,13 @@ m/^((\S+) (((....)-(..)-(..))_((..):(..):(..))) (\d+) (?:\.\/)?((.+\/)?((?:(\d+)
$update[17] = $17; # FHEM module name
$update[18] = $18; # file extension
push @update,
fhemTimeGm(
$update[11], $update[10], $update[9], $update[7],
( $update[6] - 1 ),
( $update[5] - 1900 )
);
# this is a FHEM core update
if ( $15 eq 'fhem.pl' ) {
$coreUpdate = undef;
@ -1393,6 +1427,13 @@ m/^((\S+) (((....)-(..)-(..))_((..):(..):(..))) (\d+) (?:\.\/)?((.+\/)?((?:(\d+)
$update[17] = $17; # FHEM module name
$update[18] = $18; # file extension
push @update,
fhemTimeGm(
$update[11], $update[10], $update[9], $update[7],
( $update[6] - 1 ),
( $update[5] - 1900 )
);
# this is a FHEM module update
if ($16) {
if ( defined( $moduleUpdates{$17} ) ) {
@ -1736,12 +1777,6 @@ sub __SetXVersion {
"IO::Socket::INET6": 0,
"Socket6": 0,
"TimeSeries": 0
},
"suggests": {
"Compress::Zlib": 0,
"FHEM::WinService": 0,
"IO::Socket::INET6": 0,
"Socket6": 0
}
}
},