Skip to content
Snippets Groups Projects
Commit 883478f4 authored by Devcurmudgeon's avatar Devcurmudgeon
Browse files

WIP add binary input support

parent 5607aaac
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -171,6 +171,8 @@ def run_build(dn):
if dn.get('repo'):
repos.checkout(dn)
dn['SOURCE_DATE_EPOCH'] = repos.source_date_epoch(dn['checkout'])
else if dn.get('url'):
repos.get_binary(dn)
get_build_commands(dn)
env_vars = sandbox.env_vars_for_build(dn)
......
......@@ -11,6 +11,7 @@ morph-fields: ['arch',
'devices',
'kind',
'max-jobs',
'md5',
'morph',
'name',
'orig_ref',
......@@ -20,12 +21,15 @@ morph-fields: ['arch',
'strata',
'ref',
'repo',
'rpm-metadata',
'sha',
'sha256',
'subsystems',
'submodules',
'systems',
'system-integration',
'unpetrify-ref']
'unpetrify-ref',
'url']
# Mapping from arch to cpu defaults
cpus:
......
......@@ -328,6 +328,23 @@ def checkout_submodules(dn):
app.log(dn, "Git submodules problem", exit=True)
def get_binary(dn):
with app.chdir(dn['checkout']), open(os.devnull, "w") as fnull:
requests.get(dn['url'], auth=('user', 'pass'))
if call(['wget', dn['url']], stdout=fnull, stderr=fnull):
app.log(dn, 'ERROR running wget on url:', dn['url'], exit=True)
if dn.get('sha256'):
import hashlib
checksum = hashlib.sha256(factors).hexdigest()
if checksum != dn['sha256']:
app.log(dn, 'ERROR sha256 %s mismatch:' % dn['sha256'],
checksum, exit=True)
checksum = hashlib.md5(factors).hexdigest()
if checksum != dn['md5']:
app.log(dn, 'ERROR md5 %s mismatch:' % dn['md5'],
checksum, exit=True)
@contextlib.contextmanager
def explore(ref):
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment