b8232161c0
Change-Id: I6725bdc2eff5a367b46075c2bf8baa8f2edbabe5
24 lines
688 B
Django/Jinja
24 lines
688 B
Django/Jinja
#!/bin/env bash
|
|
#
|
|
# Apply workarounds for minor updates
|
|
#
|
|
set -euo pipefail
|
|
|
|
{% if item.workarounds|default([]) %}
|
|
|
|
{% for workaround in item.workarounds %}
|
|
{% if workaround.patch_id %}
|
|
curl -4 'https://review.opendev.org/changes/{{workaround.patch_id}}/revisions/current/patch?download' | \
|
|
base64 -d | \
|
|
sudo patch -d {{ workaround.directory }} -p1 {{ workaround.misc }}
|
|
{% endif %} {# end of item.patch_id #}
|
|
|
|
{% if workaround.command %}
|
|
{{ workaround.command }}
|
|
{% endif %} {# apply command for workaround #}
|
|
{% endfor %} {# end of workarounds iteration #}
|
|
{% else %} {# if workarounds not needed #}
|
|
echo "No Workarounds Needed"
|
|
exit 0
|
|
{% endif %} {# end if no workarounds #}
|