summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-06-24 23:54:06 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-02-10 21:36:13 +0100
commitb966a1f128c1376f9dfeca10c05447c8dab73874 (patch)
treeda5c52c0ed7b0e968bafddd13d6ac2fe66725b41
parent432db0ceb1b817bdda84fb25bd06ce8d9ada1b0b (diff)
checkpatch: Use directory variables from the Makefile
- Build checkpatch with variable data from the Makefile: - Version - datadir_ - docdir_ - Provide some sane defaults (default version is 0.0.0) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rwxr-xr-xbin/checkpatch11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/checkpatch b/bin/checkpatch
index 677dbfa..730e041 100755
--- a/bin/checkpatch
+++ b/bin/checkpatch
@@ -16,9 +16,8 @@ use Term::ANSIColor qw(:constants);
use Encode qw(decode encode);
my $P = $0;
-my $D = dirname(abs_path($P));
-my $V = '0.32';
+my $V = '0.0.0';
use Getopt::Long qw(:config no_auto_abbrev);
@@ -60,12 +59,14 @@ my $max_line_length = 100;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
my $min_conf_desc_length = 4;
-my $spelling_file = "$D/spelling.txt";
+my $datadir_ = "/usr/local/share/checkpatch";
+my $spelling_file = "$datadir_/spelling.txt";
my $codespell = 0;
my $codespellfile = "/usr/share/codespell/dictionary.txt";
my $user_codespellfile = "";
-my $conststructsfile = "$D/const_structs.checkpatch";
-my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst";
+my $conststructsfile = "$datadir_/const_structs.checkpatch";
+my $docdir_ = "/usr/local/share/doc/checkpatch";
+my $docsfile = "$docdir_/checkpatch.rst";
my $typedefsfile;
my $color = "auto";
my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE