Commit 15bb9eed authored by Ziirish's avatar Ziirish

fix: packaging issue

parent 5f30a8e6
Pipeline #1595 passed with stages
in 20 minutes and 42 seconds
......@@ -18,6 +18,11 @@ Current
- Fix: issue `#268 <https://git.ziirish.me/ziirish/burp-ui/issues/268>`_
- `Full changelog <https://git.ziirish.me/ziirish/burp-ui/compare/0.6.0...master>`__
0.6.5 (03/27/2019)
------------------
- Fix: packaging issue
0.6.4 (03/26/2019)
------------------
......
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
"""
......
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
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment