diff options
author | xrs <xrs@mail36.net> | 2019-10-26 15:04:35 +0200 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2019-10-26 15:04:35 +0200 |
commit | da87f37eb0766b7c0cf1664cfbfbaf6d15ef20bc (patch) | |
tree | 09912e95b697c4207a0026b34554e4fa7b22451f /contrib | |
parent | 99d9c81fc154e9196734be3c9f51f081859539ee (diff) | |
parent | 01f5a8120cc609782547fbcff27a0dc81d1129de (diff) | |
download | gnunet-da87f37eb0766b7c0cf1664cfbfbaf6d15ef20bc.tar.gz gnunet-da87f37eb0766b7c0cf1664cfbfbaf6d15ef20bc.zip |
obsolete due to alpine policy
Diffstat (limited to 'contrib')
22 files changed, 86 insertions, 25 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 61cb5b714..26d570101 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am | |||
@@ -17,8 +17,28 @@ INITD_FILES = \ | |||
17 | services/openrc/gnunet.initd \ | 17 | services/openrc/gnunet.initd \ |
18 | services/systemd/gnunet.service | 18 | services/systemd/gnunet.service |
19 | 19 | ||
20 | PACKAGES_FILES = \ | ||
21 | guix/guix-env-py2.scm \ | ||
22 | guix/guix-env-gillmann.scm \ | ||
23 | guix/notest-guix-env.scm \ | ||
24 | nix/gnunet-dev.nix \ | ||
25 | nix/default.nix \ | ||
26 | alpine/gnunet-gtk/APKBUILD \ | ||
27 | alpine/gnunet/APKBUILD \ | ||
28 | alpine/gnunet/gnunet-system-services.initd \ | ||
29 | alpine/gnunet/gnunet-system.conf \ | ||
30 | alpine/gnunet/gnunet-user-services.initd \ | ||
31 | alpine/gnunet/gnunet-user.conf \ | ||
32 | alpine/gnunet/gnunet.post-deinstall \ | ||
33 | alpine/gnunet/gnunet.post-install \ | ||
34 | alpine/gnunet/gnunet.pre-deinstall \ | ||
35 | alpine/gnunet/gnunet.pre-install \ | ||
36 | alpine/gnunet/gnunet.xsession \ | ||
37 | alpine/gnurl/APKBUILD | ||
38 | |||
20 | EXTRA_DIST = \ | 39 | EXTRA_DIST = \ |
21 | conf/colorit/colorit.conf \ | 40 | conf/colorit/colorit.conf \ |
41 | conf/.style.yapf \ | ||
22 | conf/editors/eclipse/gnunet_codingstyle.xml \ | 42 | conf/editors/eclipse/gnunet_codingstyle.xml \ |
23 | conf/gnunet/no_forcestart.conf \ | 43 | conf/gnunet/no_forcestart.conf \ |
24 | conf/gnunet/no_autostart_above_core.conf \ | 44 | conf/gnunet/no_autostart_above_core.conf \ |
@@ -26,8 +46,7 @@ EXTRA_DIST = \ | |||
26 | conf/gnunet/gnunet-user.conf \ | 46 | conf/gnunet/gnunet-user.conf \ |
27 | conf/nss/nssswitch.conf \ | 47 | conf/nss/nssswitch.conf \ |
28 | conf/wireshark/wireshark.lua \ | 48 | conf/wireshark/wireshark.lua \ |
29 | packages/nix/default.nix \ | 49 | $(PACKAGES_FILES) \ |
30 | packages/nix/gnunet-dev.nix \ | ||
31 | $(INITD_FILES) | 50 | $(INITD_FILES) |
32 | 51 | ||
33 | check_PROGRAMS = \ | 52 | check_PROGRAMS = \ |
diff --git a/contrib/conf/.style.yapf b/contrib/conf/.style.yapf new file mode 100644 index 000000000..3b39780ca --- /dev/null +++ b/contrib/conf/.style.yapf | |||
@@ -0,0 +1,5 @@ | |||
1 | [style] | ||
2 | based_on_style = pep8 | ||
3 | coalesce_brackets=True | ||
4 | column_limit=80 | ||
5 | dedent_closing_brackets=True | ||
diff --git a/contrib/indent_pre-commit b/contrib/indent_pre-commit new file mode 100755 index 000000000..c67fcaf0c --- /dev/null +++ b/contrib/indent_pre-commit | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/sh | ||
2 | # Run this script to indent the GNUnet code. When run without arguments, | ||
3 | # it indents the ENTIRE src/ tree. Run with 'src/XXX' to indent the | ||
4 | # src/XXX directory. | ||
5 | # | ||
6 | # This script is in the public domain. | ||
7 | if test $# = 0 | ||
8 | then | ||
9 | PATHS=src/ | ||
10 | else | ||
11 | PATHS="$@" | ||
12 | fi | ||
13 | find $PATHS -name "*.c" -exec indent {} \; | ||
14 | find $PATHS -name "*.h" -exec indent {} \; | ||
15 | find $PATHS -name "*.c" -exec indent {} \; | ||
16 | find $PATHS -name "*.h" -exec indent {} \; | ||
17 | find $PATHS -name "*.c" -exec contrib/scripts/removetrailingwhitespace.py {} \; | ||
18 | find $PATHS -name "*.h" -exec contrib/scripts/removetrailingwhitespace.py {} \; | ||
19 | if test -n "`dos2unix -V | head -n1 | awk '{print $1 $2}'`"; then | ||
20 | find $PATHS -name "*.c" -exec dos2unix {} \; | ||
21 | find $PATHS -name "*.h" -exec dos2unix {} \; | ||
22 | fi | ||
diff --git a/contrib/alpine/gnunet-gtk/APKBUILD b/contrib/packages/alpine/gnunet-gtk/APKBUILD index 8c72bdb6c..8c72bdb6c 100644 --- a/contrib/alpine/gnunet-gtk/APKBUILD +++ b/contrib/packages/alpine/gnunet-gtk/APKBUILD | |||
diff --git a/contrib/alpine/gnunet/APKBUILD b/contrib/packages/alpine/gnunet/APKBUILD index b21c6241e..b21c6241e 100644 --- a/contrib/alpine/gnunet/APKBUILD +++ b/contrib/packages/alpine/gnunet/APKBUILD | |||
diff --git a/contrib/alpine/gnunet/gnunet-system-services.initd b/contrib/packages/alpine/gnunet/gnunet-system-services.initd index 19248d23e..19248d23e 100644 --- a/contrib/alpine/gnunet/gnunet-system-services.initd +++ b/contrib/packages/alpine/gnunet/gnunet-system-services.initd | |||
diff --git a/contrib/alpine/gnunet/gnunet-system.conf b/contrib/packages/alpine/gnunet/gnunet-system.conf index 303cf5f16..303cf5f16 100644 --- a/contrib/alpine/gnunet/gnunet-system.conf +++ b/contrib/packages/alpine/gnunet/gnunet-system.conf | |||
diff --git a/contrib/alpine/gnunet/gnunet-user-services.initd b/contrib/packages/alpine/gnunet/gnunet-user-services.initd index 0d7a626e7..0d7a626e7 100644 --- a/contrib/alpine/gnunet/gnunet-user-services.initd +++ b/contrib/packages/alpine/gnunet/gnunet-user-services.initd | |||
diff --git a/contrib/alpine/gnunet/gnunet-user.conf b/contrib/packages/alpine/gnunet/gnunet-user.conf index 22f1fe37a..22f1fe37a 100644 --- a/contrib/alpine/gnunet/gnunet-user.conf +++ b/contrib/packages/alpine/gnunet/gnunet-user.conf | |||
diff --git a/contrib/alpine/gnunet/gnunet.post-install b/contrib/packages/alpine/gnunet/gnunet.post-install index f7c19b26f..f7c19b26f 100644 --- a/contrib/alpine/gnunet/gnunet.post-install +++ b/contrib/packages/alpine/gnunet/gnunet.post-install | |||
diff --git a/contrib/alpine/gnunet/gnunet.pre-deinstall b/contrib/packages/alpine/gnunet/gnunet.pre-deinstall index 3334c6d67..3334c6d67 100644 --- a/contrib/alpine/gnunet/gnunet.pre-deinstall +++ b/contrib/packages/alpine/gnunet/gnunet.pre-deinstall | |||
diff --git a/contrib/alpine/gnunet/gnunet.pre-install b/contrib/packages/alpine/gnunet/gnunet.pre-install index bbb629cb1..bbb629cb1 100644 --- a/contrib/alpine/gnunet/gnunet.pre-install +++ b/contrib/packages/alpine/gnunet/gnunet.pre-install | |||
diff --git a/contrib/alpine/gnunet/gnunet.xsession b/contrib/packages/alpine/gnunet/gnunet.xsession index 944d47a27..944d47a27 100644 --- a/contrib/alpine/gnunet/gnunet.xsession +++ b/contrib/packages/alpine/gnunet/gnunet.xsession | |||
diff --git a/contrib/alpine/gnurl/APKBUILD b/contrib/packages/alpine/gnurl/APKBUILD index 24a5ee866..24a5ee866 100644 --- a/contrib/alpine/gnurl/APKBUILD +++ b/contrib/packages/alpine/gnurl/APKBUILD | |||
diff --git a/contrib/scripts/find_typedefs.py b/contrib/scripts/find_typedefs.py index 804eae235..965be3c34 100644 --- a/contrib/scripts/find_typedefs.py +++ b/contrib/scripts/find_typedefs.py | |||
@@ -4,7 +4,6 @@ import os | |||
4 | import re | 4 | import re |
5 | import sys | 5 | import sys |
6 | 6 | ||
7 | |||
8 | debug = False | 7 | debug = False |
9 | 8 | ||
10 | 9 | ||
@@ -14,7 +13,8 @@ def get_td_from_function_signature(line, file, num): | |||
14 | left_paren += 1 | 13 | left_paren += 1 |
15 | li = line[left_paren:] | 14 | li = line[left_paren:] |
16 | right_paren = line.find(')') | 15 | right_paren = line.find(')') |
17 | if right_paren > 0 and right_paren > left_paren and line[right_paren:].find('(') >= 0: | 16 | if right_paren > 0 and right_paren > left_paren and line[ |
17 | right_paren:].find('(') >= 0: | ||
18 | fname = line[:right_paren] | 18 | fname = line[:right_paren] |
19 | fname = fname.lstrip(' ').lstrip('*').lstrip(' ').rstrip(' ') | 19 | fname = fname.lstrip(' ').lstrip('*').lstrip(' ').rstrip(' ') |
20 | if len(fname) > 0: | 20 | if len(fname) > 0: |
@@ -70,7 +70,7 @@ def find_typedefs(file): | |||
70 | td_line.append(l[rightcbrace + 1:]) | 70 | td_line.append(l[rightcbrace + 1:]) |
71 | else: | 71 | else: |
72 | td_line.append(l) | 72 | td_line.append(l) |
73 | if len(l) > 0 and l[-1] == ';' and(not td_struct or td_level == 0): | 73 | if len(l) > 0 and l[-1] == ';' and (not td_struct or td_level == 0): |
74 | td_line = ' '.join(td_line) | 74 | td_line = ' '.join(td_line) |
75 | td_line = td_line[:-1] | 75 | td_line = td_line[:-1] |
76 | if len(td_line) > 0: | 76 | if len(td_line) > 0: |
diff --git a/contrib/scripts/gdb-iterate-dll.py b/contrib/scripts/gdb-iterate-dll.py index 79d46aa96..28c435ccb 100644 --- a/contrib/scripts/gdb-iterate-dll.py +++ b/contrib/scripts/gdb-iterate-dll.py | |||
@@ -23,7 +23,8 @@ def search_dll(head, field, match, pfield): | |||
23 | if field_val.type.code == gdb.TYPE_CODE_INT: | 23 | if field_val.type.code == gdb.TYPE_CODE_INT: |
24 | val = int(field_val) | 24 | val = int(field_val) |
25 | res = (match == val) | 25 | res = (match == val) |
26 | elif (field_val.type.code == gdb.TYPE_CODE_STRING) or (field_val.type.code == gdb.TYPE_CODE_ARRAY): | 26 | elif (field_val.type.code == gdb.TYPE_CODE_STRING |
27 | ) or (field_val.type.code == gdb.TYPE_CODE_ARRAY): | ||
27 | val = str(field_val) | 28 | val = str(field_val) |
28 | res = (match == val) | 29 | res = (match == val) |
29 | elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): | 30 | elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): |
diff --git a/contrib/scripts/gnunet-chk.py.in b/contrib/scripts/gnunet-chk.py.in index 0fb591627..7d2cf73d3 100755 --- a/contrib/scripts/gnunet-chk.py.in +++ b/contrib/scripts/gnunet-chk.py.in | |||
@@ -29,9 +29,8 @@ import sys | |||
29 | from Crypto.Cipher import AES | 29 | from Crypto.Cipher import AES |
30 | from functools import reduce | 30 | from functools import reduce |
31 | 31 | ||
32 | |||
33 | # Defaults | 32 | # Defaults |
34 | DBLOCK_SIZE = (32 * 1024) # Data block size | 33 | DBLOCK_SIZE = (32 * 1024) # Data block size |
35 | 34 | ||
36 | # Pick a multiple of 2 here to achive 8-byte alignment! We also | 35 | # Pick a multiple of 2 here to achive 8-byte alignment! We also |
37 | # probably want DBlocks to have (roughly) the same size as IBlocks. | 36 | # probably want DBlocks to have (roughly) the same size as IBlocks. |
@@ -39,7 +38,7 @@ DBLOCK_SIZE = (32 * 1024) # Data block size | |||
39 | # byte = 2 * 512 bits). DO NOT CHANGE! | 38 | # byte = 2 * 512 bits). DO NOT CHANGE! |
40 | CHK_PER_INODE = 256 | 39 | CHK_PER_INODE = 256 |
41 | 40 | ||
42 | CHK_HASH_SIZE = 64 # SHA-512 hash = 512 bits = 64 bytes | 41 | CHK_HASH_SIZE = 64 # SHA-512 hash = 512 bits = 64 bytes |
43 | 42 | ||
44 | CHK_QUERY_SIZE = CHK_HASH_SIZE # Again a SHA-512 hash | 43 | CHK_QUERY_SIZE = CHK_HASH_SIZE # Again a SHA-512 hash |
45 | 44 | ||
@@ -94,11 +93,11 @@ class AESKey(object): | |||
94 | """Class for AES Keys. Contains the main key and the initialization | 93 | """Class for AES Keys. Contains the main key and the initialization |
95 | vector. """ | 94 | vector. """ |
96 | 95 | ||
97 | key = None # The actual AES key | 96 | key = None # The actual AES key |
98 | iv = None # The initialization vector | 97 | iv = None # The initialization vector |
99 | cipher = None # The cipher object | 98 | cipher = None # The cipher object |
100 | KEY_SIZE = 32 # AES 256-bit key = 32 bytes | 99 | KEY_SIZE = 32 # AES 256-bit key = 32 bytes |
101 | IV_SIZE = AES.block_size # Initialization vector size (= AES block size) | 100 | IV_SIZE = AES.block_size # Initialization vector size (= AES block size) |
102 | 101 | ||
103 | def __init__(self, passphrase): | 102 | def __init__(self, passphrase): |
104 | """Creates a new AES key. | 103 | """Creates a new AES key. |
@@ -355,13 +354,15 @@ def chkuri_from_path(path): | |||
355 | 354 | ||
356 | def usage(): | 355 | def usage(): |
357 | """Prints help about using this script.""" | 356 | """Prints help about using this script.""" |
358 | print(""" | 357 | print( |
358 | """ | ||
359 | Usage: gnunet-chk.py [options] file | 359 | Usage: gnunet-chk.py [options] file |
360 | Prints the Content Hash Key of given file in GNUNET-style URI. | 360 | Prints the Content Hash Key of given file in GNUNET-style URI. |
361 | 361 | ||
362 | Options: | 362 | Options: |
363 | -h, --help : prints this message | 363 | -h, --help : prints this message |
364 | """) | 364 | """ |
365 | ) | ||
365 | 366 | ||
366 | 367 | ||
367 | if '__main__' == __name__: | 368 | if '__main__' == __name__: |
@@ -373,7 +374,7 @@ if '__main__' == __name__: | |||
373 | usage() | 374 | usage() |
374 | sys.exit(2) | 375 | sys.exit(2) |
375 | for option, value in opts: | 376 | for option, value in opts: |
376 | if option in("-h", "--help"): | 377 | if option in ("-h", "--help"): |
377 | usage() | 378 | usage() |
378 | sys.exit(0) | 379 | sys.exit(0) |
379 | if len(args) != 1: | 380 | if len(args) != 1: |
diff --git a/contrib/scripts/gnunet_janitor.py.in b/contrib/scripts/gnunet_janitor.py.in index b0b50ca76..d6834bfb4 100644 --- a/contrib/scripts/gnunet_janitor.py.in +++ b/contrib/scripts/gnunet_janitor.py.in | |||
@@ -31,6 +31,7 @@ import time | |||
31 | import signal | 31 | import signal |
32 | import terminate | 32 | import terminate |
33 | 33 | ||
34 | |||
34 | def get_process_list(): | 35 | def get_process_list(): |
35 | result = [] | 36 | result = [] |
36 | pids = [pid for pid in os.listdir('/proc') if pid.isdigit()] | 37 | pids = [pid for pid in os.listdir('/proc') if pid.isdigit()] |
diff --git a/contrib/scripts/gnunet_pyexpect.py.in b/contrib/scripts/gnunet_pyexpect.py.in index 188436f51..48f8acdc1 100644 --- a/contrib/scripts/gnunet_pyexpect.py.in +++ b/contrib/scripts/gnunet_pyexpect.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -27,7 +27,7 @@ import shutil | |||
27 | import time | 27 | import time |
28 | 28 | ||
29 | 29 | ||
30 | class pexpect (object): | 30 | class pexpect(object): |
31 | def __init__(self): | 31 | def __init__(self): |
32 | super(pexpect, self).__init__() | 32 | super(pexpect, self).__init__() |
33 | 33 | ||
@@ -54,12 +54,22 @@ class pexpect (object): | |||
54 | if len(stream) == 0: | 54 | if len(stream) == 0: |
55 | return True | 55 | return True |
56 | else: | 56 | else: |
57 | print("Failed to find `{1}' in {0}, which is `{2}' ({3})".format(s, r, stream, len(stream))) | 57 | print( |
58 | "Failed to find `{1}' in {0}, which is `{2}' ({3})". | ||
59 | format(s, r, stream, len(stream)) | ||
60 | ) | ||
58 | sys.exit(2) | 61 | sys.exit(2) |
59 | raise ValueError("Argument `r' should be an instance of re.RegexObject or a special string, but is `{0}'".format(r)) | 62 | raise ValueError( |
63 | "Argument `r' should be an instance of re.RegexObject or a special string, but is `{0}'" | ||
64 | .format(r) | ||
65 | ) | ||
60 | m = r.search(stream.decode(), flags) | 66 | m = r.search(stream.decode(), flags) |
61 | if not m: | 67 | if not m: |
62 | print("Failed to find `{1}' in {0}, which is is `{2}'".format(s, r.pattern, stream)) | 68 | print( |
69 | "Failed to find `{1}' in {0}, which is is `{2}'".format( | ||
70 | s, r.pattern, stream | ||
71 | ) | ||
72 | ) | ||
63 | sys.exit(2) | 73 | sys.exit(2) |
64 | stream = stream[m.end():] | 74 | stream = stream[m.end():] |
65 | if s == 'stdout': | 75 | if s == 'stdout': |
diff --git a/contrib/scripts/pydiffer.py.in b/contrib/scripts/pydiffer.py.in index 35d9ffa35..08f0f4ae6 100644 --- a/contrib/scripts/pydiffer.py.in +++ b/contrib/scripts/pydiffer.py.in | |||
@@ -10,7 +10,10 @@ def getdiff(old, new): | |||
10 | diff = [] | 10 | diff = [] |
11 | with open(old) as a: | 11 | with open(old) as a: |
12 | with open(new) as b: | 12 | with open(new) as b: |
13 | for l in difflib.unified_diff(a.read().splitlines(), b.read().splitlines()): | 13 | for l in difflib.unified_diff( |
14 | a.read().splitlines(), | ||
15 | b.read().splitlines() | ||
16 | ): | ||
14 | diff.append(l) | 17 | diff.append(l) |
15 | return diff | 18 | return diff |
16 | 19 | ||
diff --git a/contrib/scripts/removetrailingwhitespace.py.in b/contrib/scripts/removetrailingwhitespace.py.in index 5824fb591..e6c2d9014 100755 --- a/contrib/scripts/removetrailingwhitespace.py.in +++ b/contrib/scripts/removetrailingwhitespace.py.in | |||
@@ -3,7 +3,6 @@ | |||
3 | import sys | 3 | import sys |
4 | import re | 4 | import re |
5 | 5 | ||
6 | |||
7 | for fileName in sys.argv[1:]: | 6 | for fileName in sys.argv[1:]: |
8 | f = open(fileName, 'r+') | 7 | f = open(fileName, 'r+') |
9 | fileString = f.read() | 8 | fileString = f.read() |
diff --git a/contrib/scripts/terminate.py.in b/contrib/scripts/terminate.py.in index f57ac6167..2cb4a13c4 100644 --- a/contrib/scripts/terminate.py.in +++ b/contrib/scripts/terminate.py.in | |||
@@ -26,7 +26,7 @@ import subprocess | |||
26 | import os | 26 | import os |
27 | 27 | ||
28 | 28 | ||
29 | class dummyobj (object): | 29 | class dummyobj(object): |
30 | pass | 30 | pass |
31 | 31 | ||
32 | 32 | ||