Commit 6ac517c1 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent c78ff2bb
from __future__ import print_function
import os import os
import sys import sys
import traceback import traceback
...@@ -46,13 +48,15 @@ def pre_configure_hook(options, buildout): ...@@ -46,13 +48,15 @@ def pre_configure_hook(options, buildout):
gcc_executable = os.getenv('CC', 'gcc') gcc_executable = os.getenv('CC', 'gcc')
try: try:
gcc = Popen([gcc_executable, '-v'], stdout=PIPE, stderr=PIPE, gcc = Popen([gcc_executable, '-v'], stdout=PIPE, stderr=PIPE,
universal_newlines=True,
close_fds=True) close_fds=True)
except OSError, (errno, _): except OSError as e:
errno, _ = e
if errno == 2: if errno == 2:
# No gcc installed, nothing to check # No gcc installed, nothing to check
pass pass
else: else:
print 'Unexpected failure trying to detect gcc version' print('Unexpected failure trying to detect gcc version')
traceback.print_exc() traceback.print_exc()
else: else:
gcc.wait() gcc.wait()
...@@ -66,10 +70,10 @@ def pre_configure_hook(options, buildout): ...@@ -66,10 +70,10 @@ def pre_configure_hook(options, buildout):
error = 'broken GCC version: %s' % (line, ) error = 'broken GCC version: %s' % (line, )
break break
else: else:
print >>sys.stderr, 'GCC version could not be detected, ' \ print('GCC version could not be detected, ' \
'building anyway' 'building anyway', file=sys.stderr)
if error is not None: if error is not None:
print 'Disabling build, with reason:', error print('Disabling build, with reason:', error)
# Copy to preserver permission # Copy to preserver permission
copy(CONFIGURE_PATH, CONFIGURE_BACKUP_PATH) copy(CONFIGURE_PATH, CONFIGURE_BACKUP_PATH)
open(CONFIGURE_PATH, 'w').write(FAKE_CONFIGURE % (error, )) open(CONFIGURE_PATH, 'w').write(FAKE_CONFIGURE % (error, ))
......
...@@ -88,7 +88,7 @@ make-binary= ...@@ -88,7 +88,7 @@ make-binary=
${:extra-env} PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" make ${:extra-env} PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" make
# this post-make-hook is same for all users of the macro. # this post-make-hook is same for all users of the macro.
post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#d012f7ba3300b14b2c6b173351d410be:post_make_hook post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#f28c45a0f473ae050ca3ebaed5c39a4e:post_make_hook
perl_location = ${perl:location} perl_location = ${perl:location}
......
...@@ -17,7 +17,7 @@ def post_make_hook(options, buildout, environmet): ...@@ -17,7 +17,7 @@ def post_make_hook(options, buildout, environmet):
export PERL5LIB="{site_perl}:$PERL5LIB" export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl "$@" exec {perl_location}/bin/perl "$@"
'''.format(**locals())) '''.format(**locals()))
os.chmod(perl_wrapper_path, 0755) os.chmod(perl_wrapper_path, 0o755)
# create a wrapper for each scripts installed in perl-bin # create a wrapper for each scripts installed in perl-bin
for script_path in glob.glob(os.path.join(prefix, 'perl-bin', '*')): for script_path in glob.glob(os.path.join(prefix, 'perl-bin', '*')):
...@@ -28,4 +28,4 @@ exec {perl_location}/bin/perl "$@" ...@@ -28,4 +28,4 @@ exec {perl_location}/bin/perl "$@"
export PERL5LIB="{site_perl}:$PERL5LIB" export PERL5LIB="{site_perl}:$PERL5LIB"
exec {perl_location}/bin/perl {script_path} "$@" exec {perl_location}/bin/perl {script_path} "$@"
'''.format(**locals())) '''.format(**locals()))
os.chmod(wrapper_path, 0755) os.chmod(wrapper_path, 0o755)
...@@ -34,7 +34,7 @@ import stat ...@@ -34,7 +34,7 @@ import stat
import netaddr import netaddr
import time import time
import re import re
from six.moves.urllib import parse as urlparse from six.moves.urllib import parse
import json import json
# Use to do from slapos.recipe.librecipe import GenericBaseRecipe # Use to do from slapos.recipe.librecipe import GenericBaseRecipe
...@@ -324,7 +324,7 @@ class BaseSlapRecipe: ...@@ -324,7 +324,7 @@ class BaseSlapRecipe:
if port is not None: if port is not None:
netloc += ':%s' % port netloc += ':%s' % port
url = urlparse.urlunparse((scheme, netloc, path, params, query, fragment)) url = parse.urlunparse((scheme, netloc, path, params, query, fragment))
return url return url
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
import os import os
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
from six import itervalues import six
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
...@@ -37,7 +37,7 @@ class Recipe(GenericBaseRecipe): ...@@ -37,7 +37,7 @@ class Recipe(GenericBaseRecipe):
self.mode = int(self.directory.pop('mode', '0777'), 8) self.mode = int(self.directory.pop('mode', '0777'), 8)
def install(self): def install(self):
for path in sorted(itervalues(self.directory)): for path in sorted(six.itervalues(self.directory)):
if path and not os.path.isdir(path): if path and not os.path.isdir(path):
os.makedirs(path, self.mode) os.makedirs(path, self.mode)
# WARNING: This recipe is currently used to create directories that will # WARNING: This recipe is currently used to create directories that will
......
...@@ -31,7 +31,7 @@ import os ...@@ -31,7 +31,7 @@ import os
import slapos.slap import slapos.slap
from slapos.recipe.librecipe import unwrap from slapos.recipe.librecipe import unwrap
import six from six import iteritems
from six.moves.configparser import RawConfigParser from six.moves.configparser import RawConfigParser
from netaddr import valid_ipv4, valid_ipv6 from netaddr import valid_ipv4, valid_ipv6
from slapos.util import mkdir_p from slapos.util import mkdir_p
...@@ -124,7 +124,7 @@ class Recipe(object): ...@@ -124,7 +124,7 @@ class Recipe(object):
buildout['buildout']['directory']) buildout['buildout']['directory'])
match = self.OPTCRE_match match = self.OPTCRE_match
for key, value in six.iteritems(parameter_dict): for key, value in iteritems(parameter_dict):
if match(key) is not None: if match(key) is not None:
continue continue
options['configuration.' + key] = value options['configuration.' + key] = value
......
...@@ -23,6 +23,9 @@ branch = py3 ...@@ -23,6 +23,9 @@ branch = py3
[slapos.cookbook-repository] [slapos.cookbook-repository]
branch = py3 branch = py3
[erp5.util-repository]
branch = bryton/py3
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs += ${supervisor-develop:egg} eggs += ${supervisor-develop:egg}
...@@ -35,3 +38,5 @@ netifaces = 0.10.7 ...@@ -35,3 +38,5 @@ netifaces = 0.10.7
supervisor = supervisor =
xml-marshaller = 0.9.7+SlapOSPatched001 xml-marshaller = 0.9.7+SlapOSPatched001
slapos.recipe.build = 0.38 slapos.recipe.build = 0.38
pyOpenSSL = 18.0.0
cryptography = 2.3.1
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