diff --git a/FHEM/98_Installer.pm b/FHEM/98_Installer.pm index 11215b8ff..a5ff6063e 100644 --- a/FHEM/98_Installer.pm +++ b/FHEM/98_Installer.pm @@ -2175,9 +2175,6 @@ sub CreateMetadataList ($$$) { && ( !defined( $modMeta->{release_status} ) || $modMeta->{release_status} eq 'stable' ) ); - next - if ( $mAttr eq 'copyright' - && !defined( $modMeta->{x_copyright} ) ); next if ( $mAttr eq 'abstract' @@ -2204,6 +2201,18 @@ sub CreateMetadataList ($$$) { && ( !defined( $modMeta->{resources} ) || !defined( $modMeta->{resources}{homepage} ) ) ); + next + if ( + $mAttr eq 'copyright' + && ( !defined( $modMeta->{resources} ) + || !defined( $modMeta->{resources}{x_copyright} ) ) + ); + next + if ( + $mAttr eq 'privacy' + && ( !defined( $modMeta->{resources} ) + || !defined( $modMeta->{resources}{x_privacy} ) ) + ); next if ( $mAttr eq 'wiki' @@ -2222,12 +2231,6 @@ sub CreateMetadataList ($$$) { && ( !defined( $modMeta->{resources} ) || !defined( $modMeta->{resources}{x_support_commercial} ) ) ); - next - if ( - $mAttr eq 'privacy' - && ( !defined( $modMeta->{resources} ) - || !defined( $modMeta->{resources}{x_privacy} ) ) - ); next if ( $mAttr eq 'keywords' @@ -2277,22 +2280,19 @@ sub CreateMetadataList ($$$) { } elsif ( $mAttr eq 'copyright' ) { - my $copyName; - my $copyEmail; + my $copyName = '© '; + my $copyEmail = + defined( $modMeta->{resources}{x_copyright}{mailto} ) + ? $modMeta->{resources}{x_copyright}{mailto} + : ''; my $copyWeb; my $copyNameContact; - if ( $modMeta->{x_copyright} =~ - m/^([^<>\n\r]+)(?:\s+(?:<(.*)>))?$/ ) - { - if ( defined( $modMeta->{x_vcs} ) ) { - $copyName = '© ' . $modMeta->{x_vcs}[8] . ' ' . $1; - } - else { - $copyName = '© ' . $1; - } - $copyEmail = $2; - } + $copyName .= $modMeta->{x_vcs}[8] . ' ' + if ( defined( $modMeta->{x_vcs} ) ); + $copyName .= + $modMeta->{resources}{x_copyright}{title}; + if ( defined( $modMeta->{resources} ) && defined( $modMeta->{resources}{x_copyright} ) && defined( $modMeta->{resources}{x_copyright}{web} ) ) @@ -2544,33 +2544,86 @@ sub CreateMetadataList ($$$) { ) { my $bName = $modMeta->{resources}{repository}{x_branch}; - $bName .= ' (prod)' + $bName = 'production' if ( $modMeta->{resources}{repository}{x_branch} eq $modMeta->{resources}{repository}{x_dev}{x_branch} ); - # master entry + # webview: master entry $l .= 'View online source code: ' . $bName . ''; - # dev link + # webview: dev link $bName = $modMeta->{resources}{repository}{x_dev}{x_branch}; - $bName .= ' (dev)' + $bName = 'development' if ( $modMeta->{resources}{repository}{x_branch} eq $modMeta->{resources}{repository}{x_dev}{x_branch} ); $url = $modMeta->{resources}{repository}{x_dev}{web}; - # dev entry + # webview: dev entry $l .= ' | ' . $bName . ''; + + # raw: master entry + if ( + defined( $modMeta->{resources}{repository}{x_raw} ) + ) + { + $bName = + $modMeta->{resources}{repository}{x_branch}; + $bName = 'production' + if ( + $modMeta->{resources}{repository}{x_branch} eq + $modMeta->{resources}{repository}{x_dev} + {x_branch} ); + + $url = $modMeta->{resources}{repository}{x_raw}; + $l .= + $lb + . 'Download raw file: ' + . $bName . ''; + + # raw: dev link + if ( + defined( + $modMeta->{resources}{repository}{x_dev} + {x_raw} + ) + ) + { + $bName = + $modMeta->{resources}{repository}{x_dev} + {x_branch}; + $bName = 'development' + if ( + $modMeta->{resources}{repository}{x_branch} + eq + $modMeta->{resources}{repository}{x_dev} + {x_branch} ); + $url = + $modMeta->{resources}{repository}{x_dev} + {x_raw}; + + # raw: dev entry + $l .= + ' | ' + . $bName . ''; + } + } } # master entry @@ -2579,46 +2632,108 @@ sub CreateMetadataList ($$$) { 'View online source code'; + + if ( + defined( $modMeta->{resources}{repository}{x_raw} ) + ) + { + $l .= + $lb + . 'Download raw file'; + } } $l .= $lb; } # VCS link - my $url = - $modMeta->{resources}{repository}{url}; + my $urlPrefix = ( + $modMeta->{resources}{repository}{url} =~ + /^$modMeta->{resources}{repository}{type}/i + ? '' + : lc( $modMeta->{resources}{repository}{type} ) . '+' + ); $l .= uc( $modMeta->{resources}{repository}{type} ) . ' repository: ' - . $modMeta->{resources}{repository}{url}; + . '' + . $urlPrefix + . $modMeta->{resources}{repository}{url} . ''; - if ( - defined( - $modMeta->{resources}{repository}{x_branch_master} - ) - ) - { - $l .= - $lb - . 'Main branch: ' - . $modMeta->{resources}{repository}{x_branch_master}; + if ( defined( $modMeta->{resources}{repository}{x_branch} ) ) { + if ( + lc( $modMeta->{resources}{repository}{type} ) eq 'svn' ) + { + $l .= + $lb + . 'Main branch: ' + . '' + . $modMeta->{resources}{repository}{x_branch} + . ''; + } + else { + $l .= + $lb + . 'Main branch: ' + . $modMeta->{resources}{repository}{x_branch}; + } } if ( - defined( - $modMeta->{resources}{repository}{x_branch_master} - ) + defined( $modMeta->{resources}{repository}{x_branch} ) + && defined( $modMeta->{resources}{repository}{x_dev} ) && defined( - $modMeta->{resources}{repository}{x_branch_dev} ) - && $modMeta->{resources}{repository}{x_branch_master} ne - $modMeta->{resources}{repository}{x_branch_dev} + $modMeta->{resources}{repository}{x_dev}{x_branch} + ) + && $modMeta->{resources}{repository}{x_branch} ne + $modMeta->{resources}{repository}{x_dev}{x_branch} ) { - $l .= - $lb - . 'Dev branch: ' - . $modMeta->{resources}{repository}{x_branch_dev}; + if ( + lc( $modMeta->{resources}{repository}{x_dev}{type} ) eq + 'svn' ) + { + $l .= + $lb + . 'Dev branch: ' + . '' + . $modMeta->{resources}{repository}{x_dev}{x_branch} + . ''; + } + else { + $l .= + $lb + . 'Dev branch: ' + . $modMeta->{resources}{repository}{x_dev}{x_branch}; + } } } else { @@ -3723,10 +3838,21 @@ sub LoadInstallStatusPerl(;$) { if ( $type eq 'module' ) { $modMeta->{prereqs} {runtime}{$mAttr}{$missing} = 0; + + push @{ $modMeta->{prereqs}{runtime} + {x_inherited}{$missing} }, + $pkg; + } else { $packages{$modName}{META}{prereqs} {runtime}{$mAttr}{$missing} = 0; + + push + @{ $packages{$modName}{META}{prereqs} + {runtime}{x_inherited}{$missing} + }, + $pkg; } } } @@ -4038,19 +4164,19 @@ sub __aUniq { Installer
+
+
Get
-
+
+
Attributes
Get @@ -77,32 +77,32 @@ myModule
Set
+
Get @@ -209,6 +209,7 @@ "x_web_title": "Github Issues for fhem/myModule" }, "homepage": "https://myModuleHasAhomepage.com", + "x_homepage_title": "myModuleHasAhomepage", "license": [ "https://github.com/fhem/myModule/blob/master/LICENSE" ], @@ -223,19 +224,29 @@ "web": "https://github.com/fhem/myModule/blob/dev/subdir/00_myModule.pm", "x_branch": "dev", "x_filepath": "subdir/", - "x_raw": "https://raw.githubusercontent.com/fhem/myModule/dev/subdir/00_myModule.pm" + "x_raw": "https://github.com/fhem/myModule/raw/dev/subdir/00_myModule.pm" }, "x_filepath": "subdir/", - "x_raw": "https://raw.githubusercontent.com/fhem/myModule/master/subdir/00_myModule.pm" + "x_raw": "https://github.com/fhem/myModule/raw/master/subdir/00_myModule.pm" }, "x_commandref" : { "title" : "I want to name it differently, not 'Online version'", "web" : "https://myModuleHasAhomepage.com/myModuleHasAnExternalOnlineCommandRef.html" }, + "x_copyright": { + "mailto": "contact@example.com", + "title": "My Company Inc.", + "web": "https://www.example.com/legal" + }, + "x_privacy": { + "mailto": "dataprivacy@example.com", + "title": "About data privacy", + "web": "https://www.example.com/privacy" + }, "x_support_commercial": { - "mailto": "support@mycompany.com", + "mailto": "support@example.com", "title": "My Company", - "web": "https://support.mycompany.com" + "web": "https://support.example.com" }, "x_support_community": { "rss": "https://forum.fhem.de/index.php?action=.xml;type=rss;board=19",