mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
Meta.pm: fix FHEM device type from pod as keyword
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18931 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9960570a89
commit
2afc08d0cf
54
FHEM/Meta.pm
54
FHEM/Meta.pm
@ -1451,17 +1451,15 @@ m/(^#\s+(?:\d{1,2}\.\d{1,2}\.(?:\d{2}|\d{4})\s+)?[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?
|
|||||||
|
|
||||||
# meta name
|
# meta name
|
||||||
unless ( defined( $modMeta->{name} ) ) {
|
unless ( defined( $modMeta->{name} ) ) {
|
||||||
if ( defined( $modMeta->{x_vcs} ) ) {
|
if ( $modMeta->{x_file}[4] eq 'Global' ) {
|
||||||
if ( $modMeta->{x_file}[4] eq 'Global' ) {
|
$modMeta->{name} = 'FHEM';
|
||||||
$modMeta->{name} = 'FHEM';
|
}
|
||||||
}
|
else {
|
||||||
else {
|
$modMeta->{name} = $modMeta->{x_file}[1];
|
||||||
$modMeta->{name} = $modMeta->{x_file}[1];
|
$modMeta->{name} =~ s/^\.\///;
|
||||||
$modMeta->{name} =~ s/^\.\///;
|
$modMeta->{name} =~ s/\/$//;
|
||||||
$modMeta->{name} =~ s/\/$//;
|
$modMeta->{name} =~ s/FHEM\/lib//;
|
||||||
$modMeta->{name} =~ s/FHEM\/lib//;
|
$modMeta->{name} =~ s/\//::/g;
|
||||||
$modMeta->{name} =~ s/\//::/g;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ( $modMeta->{x_file}[4] ne 'Global' ) {
|
if ( $modMeta->{x_file}[4] ne 'Global' ) {
|
||||||
$modMeta->{name} .= '::' if ( $modMeta->{name} );
|
$modMeta->{name} .= '::' if ( $modMeta->{name} );
|
||||||
@ -1699,16 +1697,20 @@ m/(^#\s+(?:\d{1,2}\.\d{1,2}\.(?:\d{2}|\d{4})\s+)?[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?
|
|||||||
unless ( lc($_) eq 'fhem-core'
|
unless ( lc($_) eq 'fhem-core'
|
||||||
|| lc($_) eq 'fhem-3rdparty'
|
|| lc($_) eq 'fhem-3rdparty'
|
||||||
|| lc($_) eq 'fhem-mod'
|
|| lc($_) eq 'fhem-mod'
|
||||||
|| lc($_) eq 'fhem-pkg' );
|
|| lc($_) eq 'fhem-pkg'
|
||||||
|
|| lc($_) eq 'fhem-mod-local'
|
||||||
|
|| lc($_) eq 'fhem-pkg-local'
|
||||||
|
|| lc($_) eq 'fhem-mod-commercial'
|
||||||
|
|| lc($_) eq 'fhem-pkg-commercial' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$modMeta->{keywords} = \@filtered;
|
$modMeta->{keywords} = \@filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate keywords, based on support data
|
# Generate keywords, based on support data
|
||||||
# add legacy POD info as Metadata
|
|
||||||
if ( defined( $modMeta->{resources} )
|
if ( defined( $modMeta->{resources} )
|
||||||
&& defined( $modMeta->{resources}{x_support_community} ) )
|
&& defined( $modMeta->{resources}{x_support_community} )
|
||||||
|
&& $modMeta->{x_file}[2] ne 'fhem.pl' )
|
||||||
{
|
{
|
||||||
if ( defined( $modMeta->{resources}{x_support_community}{board} )
|
if ( defined( $modMeta->{resources}{x_support_community}{board} )
|
||||||
&& $modMeta->{resources}{x_support_community}{board} ne '' )
|
&& $modMeta->{resources}{x_support_community}{board} ne '' )
|
||||||
@ -1725,9 +1727,13 @@ m/(^#\s+(?:\d{1,2}\.\d{1,2}\.(?:\d{2}|\d{4})\s+)?[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?
|
|||||||
{board} ne ''
|
{board} ne ''
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
my $parent =
|
||||||
|
lc( $modMeta->{resources}{x_support_community}{board} );
|
||||||
my $tag =
|
my $tag =
|
||||||
lc( $modMeta->{resources}{x_support_community}{subCommunity}
|
lc( $modMeta->{resources}{x_support_community}{subCommunity}
|
||||||
{board} );
|
{board} );
|
||||||
|
|
||||||
|
$tag =~ s/$parent\s+-\s+|$parent\s+»\s+//g;
|
||||||
$tag =~ s/ - |»/ /g;
|
$tag =~ s/ - |»/ /g;
|
||||||
$tag =~ s/ +/-/g;
|
$tag =~ s/ +/-/g;
|
||||||
$tag = 'fhem-' . $tag
|
$tag = 'fhem-' . $tag
|
||||||
@ -1770,14 +1776,20 @@ m/(^#\s+(?:\d{1,2}\.\d{1,2}\.(?:\d{2}|\d{4})\s+)?[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( defined( $modMeta->{resources} )
|
||||||
|
&& defined( $modMeta->{resources}{x_support_commercial} ) )
|
||||||
|
{
|
||||||
|
my $modType = $modMeta->{x_file}[3] ? 'mod' : 'pkg';
|
||||||
|
push @{ $modMeta->{keywords} }, "fhem-$modType-commercial";
|
||||||
|
}
|
||||||
|
|
||||||
# add legacy POD info as Metadata
|
# add legacy POD info as Metadata
|
||||||
push @{ $modMeta->{keywords} },
|
if ($item_modtype) {
|
||||||
"fhem-mod-$item_modtype"
|
$item_modtype = 'fhem-mod-' . $item_modtype;
|
||||||
if (
|
push @{ $modMeta->{keywords} }, $item_modtype
|
||||||
$item_modtype
|
if ( !defined( $modMeta->{keywords} )
|
||||||
&& ( !defined( $modMeta->{keywords} )
|
|| !grep ( /^$item_modtype$/i, @{ $modMeta->{keywords} } ) );
|
||||||
|| !grep ( "fhem-mod-$item_modtype", @{ $modMeta->{keywords} } ) )
|
}
|
||||||
);
|
|
||||||
|
|
||||||
# Add some keywords about the module origin
|
# Add some keywords about the module origin
|
||||||
if ( GetModuleSourceOrigin( $modMeta->{x_file}[4] ) eq 'fhem' ) {
|
if ( GetModuleSourceOrigin( $modMeta->{x_file}[4] ) eq 'fhem' ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user