mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-15 14:16:08 -06:00
fix: packaging issue
This commit is contained in:
parent
5f30a8e666
commit
15bb9eedac
5 changed files with 60 additions and 25 deletions
|
|
@ -1,4 +1,5 @@
|
|||
include README
|
||||
include requirements.txt
|
||||
include share/burpui/etc/buiagent.sample.cfg
|
||||
global-exclude *.pyc
|
||||
global-exclude __pycache__
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import subprocess
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
# only used to build the package
|
||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
|
||||
|
||||
raw_requirements = [
|
||||
|
|
@ -20,20 +21,26 @@ raw_requirements = [
|
|||
'configobj',
|
||||
]
|
||||
requirements = []
|
||||
try:
|
||||
with open(os.path.join(ROOT, 'requirements.txt'), 'r') as req:
|
||||
for line in req.readlines():
|
||||
line = line.rstrip()
|
||||
for i, look in enumerate(list(raw_requirements)):
|
||||
if re.match(r'{}(=><)?'.format(look), line, re.IGNORECASE):
|
||||
requirements.append(line)
|
||||
del raw_requirements[i]
|
||||
break
|
||||
requirements += raw_requirements
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
||||
try:
|
||||
with open(os.path.join(ROOT, 'requirements.txt'), 'r') as req:
|
||||
for line in req.readlines():
|
||||
line = line.rstrip()
|
||||
for i, look in enumerate(list(raw_requirements)):
|
||||
if re.match(r'{}(=><)?'.format(look), line, re.IGNORECASE):
|
||||
requirements.append(line)
|
||||
del raw_requirements[i]
|
||||
break
|
||||
requirements += raw_requirements
|
||||
except OSError:
|
||||
pass
|
||||
if requirements:
|
||||
try:
|
||||
with open(os.path.join(CWD, 'requirements.txt'), 'w') as req:
|
||||
req.write('\n'.join(requirements))
|
||||
except OSError:
|
||||
pass
|
||||
if not os.path.exists('burpui_agent'):
|
||||
os.makedirs('burpui_agent', mode=0o0755)
|
||||
if os.path.exists(os.path.join(ROOT, 'burpui', 'VERSION')):
|
||||
|
|
@ -71,7 +78,7 @@ if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
|||
for decoy in out.splitlines():
|
||||
real = os.path.normpath(os.path.join(os.path.dirname(decoy), os.readlink(decoy))).decode('utf-8')
|
||||
# print '{} -> {}'.format(decoy, real)
|
||||
target = os.path.join('burpui_agent', re.sub(r'.*/burpui/', '', real))
|
||||
target = os.path.join('burpui_agent', re.sub('.*/burpui/', '', real))
|
||||
dirname = os.path.dirname(target)
|
||||
if not os.path.isdir(dirname):
|
||||
# print 'mkdir {}'.format(dirname)
|
||||
|
|
@ -95,6 +102,13 @@ if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
|||
os.makedirs(dirname, mode=0o0755)
|
||||
shutil.copy(src, dst)
|
||||
|
||||
if not requirements:
|
||||
try:
|
||||
with open(os.path.join(CWD, 'requirements.txt'), 'r') as req:
|
||||
requirements = [x.rstrip() for x in req.readlines()]
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
readme = """
|
||||
Burp-UI Meta package for agent requirements
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
include README
|
||||
include requirements.txt
|
||||
include share/burpui/etc/buimonitor.sample.cfg
|
||||
global-exclude *.pyc
|
||||
global-exclude __pycache__
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import subprocess
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
# only used to build the package
|
||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
|
||||
|
||||
raw_requirements = [
|
||||
|
|
@ -20,20 +21,26 @@ raw_requirements = [
|
|||
'configobj',
|
||||
]
|
||||
requirements = []
|
||||
try:
|
||||
with open(os.path.join(ROOT, 'requirements.txt'), 'r') as req:
|
||||
for line in req.readlines():
|
||||
line = line.rstrip()
|
||||
for i, look in enumerate(list(raw_requirements)):
|
||||
if re.match(r'{}(=><)?'.format(look), line, re.IGNORECASE):
|
||||
requirements.append(line)
|
||||
del raw_requirements[i]
|
||||
break
|
||||
requirements += raw_requirements
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
||||
try:
|
||||
with open(os.path.join(ROOT, 'requirements.txt'), 'r') as req:
|
||||
for line in req.readlines():
|
||||
line = line.rstrip()
|
||||
for i, look in enumerate(list(raw_requirements)):
|
||||
if re.match(r'{}(=><)?'.format(look), line, re.IGNORECASE):
|
||||
requirements.append(line)
|
||||
del raw_requirements[i]
|
||||
break
|
||||
requirements += raw_requirements
|
||||
except OSError:
|
||||
pass
|
||||
if requirements:
|
||||
try:
|
||||
with open(os.path.join(CWD, 'requirements.txt'), 'w') as req:
|
||||
req.Write('\n'.join(requirements))
|
||||
except OSError:
|
||||
pass
|
||||
if not os.path.exists('burpui_monitor'):
|
||||
os.makedirs('burpui_monitor', mode=0o0755)
|
||||
if os.path.exists(os.path.join(ROOT, 'burpui', 'VERSION')):
|
||||
|
|
@ -95,6 +102,13 @@ if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
|||
os.makedirs(dirname, mode=0o0755)
|
||||
shutil.copy(src, dst)
|
||||
|
||||
if not requirements:
|
||||
try:
|
||||
with open(os.path.join(CWD, 'requirements.txt'), 'r') as req:
|
||||
requirements = [x.rstrip() for x in req.readlines()]
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
readme = """
|
||||
Burp-UI Meta package for monitor requirements
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue