aboutsummaryrefslogtreecommitdiff
path: root/contrib/scripts
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-12-02 17:34:07 +0000
committerng0 <ng0@n0.is>2019-12-02 17:34:07 +0000
commit339d7a7d8ca789f9777501c3092e5c7ea0c4850a (patch)
tree5110bf9188f3c0c6d102cd4bf45d2325a5ff4136 /contrib/scripts
parent79ff68acae7e4774881d6bc53fc5c639da4a2e7b (diff)
parentfdf8c95a33fe6c81c93cd17ed7a38b8b55df7d54 (diff)
downloadgnunet-netbsd-support.tar.gz
gnunet-netbsd-support.zip
Merge branch 'master' into netbsd-supportnetbsd-support
Diffstat (limited to 'contrib/scripts')
-rw-r--r--contrib/scripts/.gitignore1
-rw-r--r--contrib/scripts/Makefile.am24
-rwxr-xr-xcontrib/scripts/check-texinfo.awk.in59
-rw-r--r--contrib/scripts/gnunet-logread/Makefile.am14
-rwxr-xr-xcontrib/scripts/gnunet-logread/gnunet-logread.in2
5 files changed, 91 insertions, 9 deletions
diff --git a/contrib/scripts/.gitignore b/contrib/scripts/.gitignore
index 547c89185..3b34b9b69 100644
--- a/contrib/scripts/.gitignore
+++ b/contrib/scripts/.gitignore
@@ -1,2 +1,3 @@
1gnunet-chk.py 1gnunet-chk.py
2removetrailingwhitespace.py 2removetrailingwhitespace.py
3check-texinfo.awk
diff --git a/contrib/scripts/Makefile.am b/contrib/scripts/Makefile.am
index 367e5c4c9..f8b7ec3d1 100644
--- a/contrib/scripts/Makefile.am
+++ b/contrib/scripts/Makefile.am
@@ -9,7 +9,16 @@ noinst_SCRIPTS = \
9 removetrailingwhitespace.py \ 9 removetrailingwhitespace.py \
10 gnunet_pyexpect.py \ 10 gnunet_pyexpect.py \
11 gnunet_janitor.py \ 11 gnunet_janitor.py \
12 gnunet-chk.py 12 gnunet-chk.py \
13 $(awkSCRIPTS)
14
15# FIXME: read into AWK_SCRIPTS autotools builtin.
16if HAVE_AWK
17awkSCRIPTS = \
18 check-texinfo.awk
19else
20awkSCRIPTS =
21endif
13 22
14bin_SCRIPTS = \ 23bin_SCRIPTS = \
15 gnunet-bugreport \ 24 gnunet-bugreport \
@@ -24,13 +33,12 @@ EXTRA_DIST = \
24 $(SCRIPTS) \ 33 $(SCRIPTS) \
25 removetrailingwhitespace.py.in \ 34 removetrailingwhitespace.py.in \
26 pydiffer.py.in \ 35 pydiffer.py.in \
27 gnunet-suidfix 36 gnunet-suidfix \
37 check-texinfo.awk.in
28 38
29CLEANFILES = \ 39CLEANFILES = \
30 $(noinst_SCRIPTS) 40 $(noinst_SCRIPTS)
31 41
32do_subst = $(AWK) -v py="$(PYTHON)" '{gsub("@PYTHONEXE@",py); print $$0}'
33
34# Use SUFFIX Extension rules, they are more portable for every 42# Use SUFFIX Extension rules, they are more portable for every
35# implementation of 'make'. 43# implementation of 'make'.
36# You'll also run into the "'%' is a GNU make extension warning" 44# You'll also run into the "'%' is a GNU make extension warning"
@@ -44,5 +52,11 @@ do_subst = $(AWK) -v py="$(PYTHON)" '{gsub("@PYTHONEXE@",py); print $$0}'
44SUFFIXES = .py.in .py 52SUFFIXES = .py.in .py
45 53
46.py.in.py: 54.py.in.py:
47 $(do_subst) < $< > $@ 55 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $< > $@
48 chmod +x $@ 56 chmod +x $@
57
58if HAVE_AWK
59check-texinfo.awk: check-texinfo.awk.in Makefile
60 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk
61 chmod +x check-texinfo.awk
62endif
diff --git a/contrib/scripts/check-texinfo.awk.in b/contrib/scripts/check-texinfo.awk.in
new file mode 100755
index 000000000..37e2c9f20
--- /dev/null
+++ b/contrib/scripts/check-texinfo.awk.in
@@ -0,0 +1,59 @@
1#!@AWKEXE@ -f
2#
3# Dedicated to the Public Domain.
4# SPDX-License-Identifier: 0BSD
5#
6# exception to add: ignore license files.
7# exception to add: uref's can go above 79 chars.
8
9
10BEGIN {
11 printf "Running basic texinfo linters\n" ;
12}
13
14{
15 if(/\t/) {
16 printf "...lines containing tabstops?\n" ;
17 print FILENAME":"NR":"$0 ;
18 }
19}
20
21{
22 if(length>79) {
23 printf "...line length over 79 chars?\n" ;
24 print FILENAME":"NR":"$0 ;
25 }
26}
27
28{
29 if(/@geq\{\}/) {
30 printf "...lines containing macros incompatible with old makeinfo?\n" ;
31 print FILENAME":"NR":"$0 ;
32 }
33}
34
35{
36 if (/@footnote\{/) {
37 printf "...lines containing macros incompatible with texi2mdoc?\n" ;
38 print FILENAME":"NR":"$0 ;
39 }
40}
41
42{
43 if (/TODO/) {
44 printf "...lines telling us what is left TODO?\n" ;
45 print FILENAME":"NR":"$0 ;
46 }
47
48 if (/XXX/) {
49 printf "...lines telling us what is left to fix?\n" ;
50 print FILENAME":"NR":"$0 ;
51 }
52}
53
54{
55 if (/wether/) {
56 printf "...lines containing a popular typo\n" ;
57 print FILENAME":"NR":"$0 ;
58 }
59}
diff --git a/contrib/scripts/gnunet-logread/Makefile.am b/contrib/scripts/gnunet-logread/Makefile.am
index 790b58fea..aa92dfe16 100644
--- a/contrib/scripts/gnunet-logread/Makefile.am
+++ b/contrib/scripts/gnunet-logread/Makefile.am
@@ -1,7 +1,7 @@
1# This Makefile.am is in the public domain 1# This Makefile.am is in the public domain
2AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include 2AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
3 3
4do_subst = $(AWK) -v py="$(PERL)" '{gsub("@PERLEXE@",py); print $$0}' 4do_subst = $(AWK) -v prl="$(PERL)" -v pfx="$(prefix)" '{if (/@SUBSTPREFIX@/) { gsub("@SUBSTPREFIX@",pfx)}; gsub("@PERLEXE@",prl); print $$0}'
5 5
6SUFFIXES = .in 6SUFFIXES = .in
7 7
@@ -17,9 +17,17 @@ CLEANFILES= \
17 gnunet-logread \ 17 gnunet-logread \
18 gnunet-logread-ipc-sdedit 18 gnunet-logread-ipc-sdedit
19 19
20if GNUNET_LOGREAD
21if HAVE_PERL
22bin_SCRIPTS = \
23 gnunet-logread-ipc \
24 $(CLEANFILES)
25else
20noinst_SCRIPTS = \ 26noinst_SCRIPTS = \
21 $(CLEANFILES) \ 27 gnunet-logread-ipc \
22 gnunet-logread-ipc 28 $(CLEANFILES)
29endif
30endif
23 31
24EXTRA_DIST = \ 32EXTRA_DIST = \
25 gnunet-logread.in \ 33 gnunet-logread.in \
diff --git a/contrib/scripts/gnunet-logread/gnunet-logread.in b/contrib/scripts/gnunet-logread/gnunet-logread.in
index e27c1d3fc..ce588b8e6 100755
--- a/contrib/scripts/gnunet-logread/gnunet-logread.in
+++ b/contrib/scripts/gnunet-logread/gnunet-logread.in
@@ -29,7 +29,7 @@ my %levels = ( NONE => 0, ERROR => 1, WARNING => 2, INFO => 4, DEBUG => 8 );
29 29
30# Message type numbers to names 30# Message type numbers to names
31my %msgtypes; 31my %msgtypes;
32my $prefix = $ENV{GNUNET_PREFIX} || '/usr'; 32my $prefix = $ENV{GNUNET_PREFIX} || '@SUBSTPREFIX@';
33my $filename = "$prefix/include/gnunet/gnunet_protocols.h"; 33my $filename = "$prefix/include/gnunet/gnunet_protocols.h";
34$ipc = $opts{s} || $DEFAULT_SOCKET; 34$ipc = $opts{s} || $DEFAULT_SOCKET;
35 35