Commit bf7b2816 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

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