Page MenuHomeFreeBSD

ports/vulnxml-unique

Authored By
mat
Apr 15 2021, 3:53 PM
Size
1013 B
Referenced Files
None
Subscribers
None

ports/vulnxml-unique

#!/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;

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3597678
Default Alt Text
ports/vulnxml-unique (1013 B)

Event Timeline