mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
contrib/pre-commit: add svn id checks by Markus (Forum #47155)
git-svn-id: https://svn.fhem.de/fhem/trunk@10473 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3a1f6cb762
commit
4e69667ad8
@ -46,10 +46,32 @@ foreach my $row (split("\n", $fList)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(FILE);
|
close(FILE);
|
||||||
err $fName, "$fName: file has over 80 chars/line in line $cLineNo"
|
err $fName, "file has over 80 chars/line in line $cLineNo"
|
||||||
if($cCount > 80);
|
if($cCount > 80);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
next unless($fName =~ /\.pm$/);
|
||||||
|
|
||||||
|
# check for SVN Id
|
||||||
|
if($fName =~ m,trunk/fhem/FHEM/[^/]+\.pm$,) {
|
||||||
|
my $hasId = 0;
|
||||||
|
open(FILE, "$svnlook $arg cat $repos $fName|") ||
|
||||||
|
die("Cant svnlook cat $fName:$!\n");
|
||||||
|
|
||||||
|
while(my $l = <FILE>) {
|
||||||
|
$hasId = ($l =~ /#.*?\$Id(?:\:.+)?\$/);
|
||||||
|
last if($hasId);
|
||||||
|
}
|
||||||
|
close(FILE);
|
||||||
|
err $fName, "file has no SVN Id as comment" unless($hasId);
|
||||||
|
|
||||||
|
# check for activated Id property in svn:keywords
|
||||||
|
my $props = `$svnlook $arg propget $repos svn:keywords $fName`;
|
||||||
|
|
||||||
|
err $fName, "Id property not set in svn:keywords"
|
||||||
|
unless($props =~ /Id/);
|
||||||
|
}
|
||||||
|
|
||||||
next if($fName !~ m+FHEM/\d\d_(.*).pm$+);
|
next if($fName !~ m+FHEM/\d\d_(.*).pm$+);
|
||||||
my $modName = $1;
|
my $modName = $1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user