Commit 39cad3e8 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents a28e5c01 9976017e
...@@ -67,15 +67,21 @@ md5sum = 096c1c18b44c269808bd815d58c53c8f ...@@ -67,15 +67,21 @@ md5sum = 096c1c18b44c269808bd815d58c53c8f
version = 8.11.1 version = 8.11.1
md5sum = df0ce86d0b1d81e232ad08eef58754ed md5sum = df0ce86d0b1d81e232ad08eef58754ed
[debian-amd64-stretch-netinst.iso]
<= debian-amd64-netinst-base
version = 9.11.0
md5sum = f525f0c3f1c4ca184a604a75dabf4f71
[debian-amd64-netinst.iso] [debian-amd64-netinst.iso]
# Download the installer of Debian 9 (Stretch) # Download the installer of Debian 10 (Buster)
# XXX: This is not the latest version because
# Debian does not provide a stable URL for it.
<= debian-amd64-netinst-base <= debian-amd64-netinst-base
version = 9.8.0 version = 10.0.0
md5sum = e0a43cbb8b991735c1b38e7041019658 md5sum = f31779fcca35f5ce9833a9661a9bd5bd
[debian-amd64-testing-netinst.iso] [debian-amd64-testing-netinst.iso]
# Download the installer of Debian Buster
<= debian-amd64-netinst-base <= debian-amd64-netinst-base
release = buster_di_rc1 release = daily/20190923-1
version = buster-DI-rc1 version = testing
md5sum = cf8f8e3afef91f3ce3a09e7cc5f530f0 md5sum = 00eda4218c401c46c15f491add41cd4e
...@@ -25,27 +25,54 @@ ...@@ -25,27 +25,54 @@
# #
############################################################################## ##############################################################################
import shlex import os, shlex
from six.moves import filter
from slapos.recipe.librecipe import GenericBaseRecipe, generateHashFromFiles from slapos.recipe.librecipe import GenericBaseRecipe, generateHashFromFiles
from zc.buildout import UserError
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
"""Recipe to create a script from given command and options. """Recipe to create a script from given command and options.
:param str command-line: shell command which launches the intended process :param str command-line: shell command which launches the intended process
:param str wrapper-path: absolute path to file's destination :param str wrapper-path: absolute path to file's destination
:param lines wait-for-files: list of files to wait for :param lines wait-for-files: list of files to wait for
:param lines hash-files: list of files to be checked by hash :param lines hash-files: list of buildout-generated files to be checked by hash
:param lines hash-existing-files: list of existing files to be checked by hash
:param str pidfile: path to pidfile ensure exclusivity for the process :param str pidfile: path to pidfile ensure exclusivity for the process
:param str private-dev-shm: size of private /dev/shm, using user namespaces :param str private-dev-shm: size of private /dev/shm, using user namespaces
:param bool reserve-cpu: command will ask for an exclusive CPU core :param bool reserve-cpu: command will ask for an exclusive CPU core
""" """
_existing = ()
def __init__(self, buildout, name, options):
self.buildout = buildout
self.options = options
hash_files = options.get('hash-files')
if hash_files:
self.hash_files = hash_files.split()
self._existing = list(filter(os.path.exists, self.hash_files))
else:
self.hash_files = []
hash_files = options.get('hash-existing-files')
if hash_files:
hash_files = hash_files.split()
options['__hash_files__'] = generateHashFromFiles(hash_files)
self.hash_files += hash_files
def getWrapperPath(self):
wrapper_path = self.options['wrapper-path']
if self.hash_files:
wrapper_path += '-' + generateHashFromFiles(self.hash_files)
return wrapper_path
def install(self): def install(self):
if self._existing:
raise UserError(
"hash-files must only list files that are generated by buildout:"
"\n " + "\n ".join(self._existing))
args = shlex.split(self.options['command-line']) args = shlex.split(self.options['command-line'])
wrapper_path = self.options['wrapper-path']
wait_files = self.options.get('wait-for-files') wait_files = self.options.get('wait-for-files')
hash_files = self.options.get('hash-files')
pidfile = self.options.get('pidfile') pidfile = self.options.get('pidfile')
private_dev_shm = self.options.get('private-dev-shm') private_dev_shm = self.options.get('private-dev-shm')
...@@ -65,10 +92,10 @@ class Recipe(GenericBaseRecipe): ...@@ -65,10 +92,10 @@ class Recipe(GenericBaseRecipe):
kw['private_dev_shm'] = private_dev_shm kw['private_dev_shm'] = private_dev_shm
if self.isTrueValue(self.options.get('reserve-cpu')): if self.isTrueValue(self.options.get('reserve-cpu')):
kw['reserve_cpu'] = True kw['reserve_cpu'] = True
if hash_files: return self.createWrapper(self.getWrapperPath(),
hash_file_list = hash_files.split() args, environment, **kw)
hash = generateHashFromFiles(hash_file_list)
wrapper_path = "%s-%s" % (wrapper_path, hash)
return self.createWrapper(wrapper_path, args, environment, **kw)
def update(self):
wrapper_path = self.getWrapperPath()
if not os.path.isfile(wrapper_path):
raise UserError("unstable wrapper path (%r)" % wrapper_path)
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