Skip to content

Commit 641b573

Browse files
authored
Merge pull request #19 from quarkslab/refactor/restructure-scripts
Refactor/restructure scripts
2 parents bfbc206 + b537ad7 commit 641b573

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

bin/pastisd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ from libpastis import ClientAgent
99
from libpastis.types import FuzzingEngine
1010

1111
try:
12-
import hfwrapper
13-
from hfwrapper import Honggfuzz
12+
import pastishonggfuzz
13+
from pastishonggfuzz import Honggfuzz
1414
if os.environ.get("HFUZZ_PATH") is None:
1515
raise ImportError("HFUZZ_PATH not set")
1616
HONGGFUZZ_AVAILABLE = True
1717
except ImportError:
18-
hfwrapper, Honggfuzz = None, None
18+
pastishonggfuzz, Honggfuzz = None, None
1919
HONGGFUZZ_AVAILABLE = False
2020
try:
2121
import pastistritondse
@@ -77,7 +77,7 @@ def main(host=PASTIS_MASTER):
7777

7878
engines = []
7979
if HONGGFUZZ_AVAILABLE:
80-
engines.append((FuzzingEngine.HONGGFUZZ, hfwrapper.__version__))
80+
engines.append((FuzzingEngine.HONGGFUZZ, pastishonggfuzz.__version__))
8181
else:
8282
logging.warning("Honggfuzz is not available (cannot import it)")
8383
if PASTISTRITONDSE_AVAILABLE:

bin/pastis-benchmark renamed to pastisbenchmark/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
# built-in imports
42
import shutil
53

@@ -389,6 +387,9 @@ def history(workspace: str):
389387
plotter.show_delta_history(campaign)
390388

391389

392-
if __name__ == "__main__":
390+
def main():
393391
cli()
394392

393+
394+
if __name__ == "__main__":
395+
main()

bin/pastis-broker renamed to pastisbroker/__main__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
# built-in imports
42
import click
53
import sys

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@
6868
test_suite="",
6969
entry_points={
7070
"console_scripts": [
71+
"pastis-benchmark = pastisbenchmark.__main__:main",
72+
"pastis-broker = pastisbroker.__main__:main",
7173
"pastis-aflpp = pastisaflpp.__main__:main",
7274
"pastis-honggfuzz = pastishonggfuzz.__main__:main",
7375
"pastis-tritondse = pastistritondse.__main__:main"
7476
]
7577
},
7678
scripts=[
77-
'bin/pastis-broker',
78-
'bin/pastis-benchmark',
7979
'bin/pastisd',
8080
]
8181
)

0 commit comments

Comments
 (0)