mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 09:58:01 +00:00
checkpatch: Fix checkpatch's check-authors-file option in CirrusCI.
This patch makes sure that if git is missing it's not showing any errors on the standard output. Secondly the OVS_SRC_DIR environment variable is used to locate the OVS source directory. Fixes: a6ccd111552d ("checkpatch: Add new check-authors-file option to checkpatch.py.") Acked-by: Kevin Traynor <ktraynor@redhat.com> Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
parent
54aa6e12a7
commit
d1430f3d89
@ -29,11 +29,13 @@ Subject: Patch this is.
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test -s expout; then
|
if test -s expout; then
|
||||||
AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py $3 -q test.patch],
|
AT_CHECK([OVS_SRC_DIR=$top_srcdir $PYTHON3 \
|
||||||
|
$top_srcdir/utilities/checkpatch.py $3 -q test.patch],
|
||||||
[1], [stdout])
|
[1], [stdout])
|
||||||
AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout])
|
AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout])
|
||||||
else
|
else
|
||||||
AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py $3 -q test.patch])
|
AT_CHECK([OVS_SRC_DIR=$top_srcdir $PYTHON3 \
|
||||||
|
$top_srcdir/utilities/checkpatch.py $3 -q test.patch])
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
OVS_END_SHELL_HELPERS
|
OVS_END_SHELL_HELPERS
|
||||||
|
@ -18,6 +18,7 @@ import email
|
|||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
RETURN_CHECK_INITIAL_STATE = 0
|
RETURN_CHECK_INITIAL_STATE = 0
|
||||||
@ -867,13 +868,14 @@ def run_subject_checks(subject, spellcheck=False):
|
|||||||
|
|
||||||
|
|
||||||
def get_top_directory():
|
def get_top_directory():
|
||||||
with os.popen('git rev-parse --show-toplevel') as pipe:
|
result = subprocess.run('git rev-parse --show-toplevel',
|
||||||
path = pipe.read()
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.DEVNULL, shell=True)
|
||||||
|
|
||||||
if path:
|
if result and result.returncode == 0:
|
||||||
return path.strip()
|
return result.stdout.decode('utf-8').strip()
|
||||||
|
|
||||||
return "."
|
return os.getenv('OVS_SRC_DIR', '.')
|
||||||
|
|
||||||
|
|
||||||
def update_missing_authors(diffed_line):
|
def update_missing_authors(diffed_line):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user