Commit 1bd4fc32 authored by Łukasz Nowak's avatar Łukasz Nowak

component/defaults: Allow to force gcc from SlapOS

In some environments it is required to have gcc provided by SlapOS, and simply
forcing seems better than setting bugs min_version.
parent 0e8ce88d
...@@ -38,6 +38,8 @@ part = gcc-8.2 ...@@ -38,6 +38,8 @@ part = gcc-8.2
# Minimum version for all components that might be required for # Minimum version for all components that might be required for
# slapos.rebootstrap (see https://bugs.python.org/issue34112 about Python 3.7+). # slapos.rebootstrap (see https://bugs.python.org/issue34112 about Python 3.7+).
min_version = 5.4 min_version = 5.4
# A switch for environments which want to force slapos provided gcc
force_slapos_gcc = False
init = init =
import os, subprocess import os, subprocess
parse_version = lambda ver: tuple(map(int, ver.strip().split('.'))) parse_version = lambda ver: tuple(map(int, ver.strip().split('.')))
...@@ -53,8 +55,9 @@ init = ...@@ -53,8 +55,9 @@ init =
# the conditions have no impact on the dependant parts. # the conditions have no impact on the dependant parts.
min_version = options.pop('min_version', None) min_version = options.pop('min_version', None)
max_version = options.pop('max_version', None) max_version = options.pop('max_version', None)
force_slapos_gcc = options.pop('force_slapos_gcc', 'False').lower() == 'true'
### ###
if (parse_version(min_version or current) if (not force_slapos_gcc) and (parse_version(min_version or current)
<= parse_version(current) <= parse_version(current)
<= parse_version(max_version or current)): <= parse_version(max_version or current)):
del options['part'] del options['part']
......
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