Page MenuHomeFreeBSD
Paste P494

ports/vulnxml-unique
ArchivedPublic

Authored by mat on Apr 15 2021, 3:53 PM.
Tags
None
Referenced Files
F20138279: ports/vulnxml-unique
Apr 15 2021, 3:53 PM
Subscribers
None
#!/usr/local/bin/perl
# vim:sts=4 sw=4
use strict;
use warnings;
use 5.024;
$" = ", ";
for (<STDIN>) {
chomp;
my ($old, $new, $ref) = split / /;
REV: for my $rev (qx{git log --format="%H" $new --not --all}) {
chomp $rev;
my ($seen,$other) = (0,0);
for my $line (qx{git diff --name-only $rev~1..$rev}) {
chomp ($line);
if ($line =~ m{\Asecurity/vuxml/vuln(?:-\d{4})?.xml\z}oms) {
$seen = 1;
} else {
$other = 1;
}
}
if ($seen && 'refs/heads/main' ne $ref) {
die "\n================================================================\n" .
"Commits to security/vuxml/vuln.xml are only allowed on main".
"\n================================================================\n";
}
if ($seen && $other) {
die "\n================================================================\n" .
"Commit to security/vuxml/vuln.xml first, and then other files".
"\n================================================================\n";
}
}
}
exit 0;

Event Timeline

mat created this object in space S1 Global.