2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Meta.pm: use featurelevel attr options as major+minor version for fhem.pl

git-svn-id: https://svn.fhem.de/fhem/trunk@18663 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2019-02-20 08:40:36 +00:00
parent 6733966e50
commit 6ff65e16b2

View File

@ -282,7 +282,7 @@ sub __GetMetadata {
# $searchComments = 0;
# }
# extract VCS info from $Id$
# extract VCS info from $Id:
if ( !@vcs
&& $l =~
m/(\$Id\: ((?:([0-9]+)_)?([\w]+)\.([\w]+))\s([0-9]+)\s((([0-9]+)-([0-9]+)-([0-9]+))\s(([0-9]+):([0-9]+):([0-9]+)))(?:[\w]+?)\s([\w.-]+)\s\$)/
@ -499,34 +499,11 @@ m/(^#\s+Version:?\s+[^v\d]*(v?(?:\d{1,3}\.\d{1,3}(?:\.\d{1,3})?)))/i
# Get some other info about fhem.pl
if ( $modMeta->{x_file}[2] eq 'fhem.pl' ) {
# grep Makefile
if ( open( $fh, '<' . $modMeta->{x_file}[1] . 'Makefile' ) ) {
while ( my $l = <$fh> ) {
if ( $l =~ /(^VERS\s*=\s*(\d{1,3}\.\d{1,3})\s*)/i ) {
my $extr = $2;
$versionFrom = 'Makefile+vcs';
$version =
( $extr =~ m/^v/i ? lc($extr) : lc( 'v' . $extr ) )
if ($extr);
if ($version) {
$version .= '.' . $vcs[5];
$modMeta->{version} = $version;
$modMeta->{x_version} =
$modMeta->{x_file}[2] . ':' . $version;
}
}
if ( $l =~ /(^DATE\s*=\s*(\d{4}-\d{2}-\d{2})\s*)/i ) {
$modMeta->{x_release_date} = $2 if ($2);
}
last if ( $version && $modMeta->{x_release_date} );
}
}
close($fh);
$versionFrom = 'attr/featurelevel+vcs';
$version = 'v' . $1 . '.' . $vcs[5]
if ( $modules{'Global'}{AttrList} =~ m/\W*featurelevel:([^,]+)/ );
$modMeta->{version} = $version;
$modMeta->{x_version} = 'fhem.pl:' . $version;
}
########