Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F20138279
ports/vulnxml-unique
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
mat
Apr 15 2021, 3:53 PM
2021-04-15 15:53:59 (UTC+0)
Size
1013 B
Referenced Files
None
Subscribers
None
ports/vulnxml-unique
View Options
#!/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
Details
Attached
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)
Attached To
Mode
P494 ports/vulnxml-unique
Attached
Detach File
Event Timeline
Log In to Comment