Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P494
ports/vulnxml-unique
Archived
Public
Actions
Authored by
mat
on Apr 15 2021, 3:53 PM.
Edit Paste
Activate Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F20138279: ports/vulnxml-unique
Apr 15 2021, 3:53 PM
2021-04-15 15:53:59 (UTC+0)
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 paste.
Apr 15 2021, 3:53 PM
2021-04-15 15:53:59 (UTC+0)
mat
created this object in space
S1 Global
.
mat
archived this paste.
Apr 16 2021, 3:57 PM
2021-04-16 15:57:32 (UTC+0)
Log In to Comment