2 ##############################################################################
3 # Copyright (c) 2017 Mirantis Inc., Enea AB and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
13 while IFS=': ' read -r p_dest p_file; do
14 if [[ ! "${p_dest}" =~ '^#' ]] && [[ "${p_dest}" =~ $2 ]] && \
15 ! patch --dry-run -Rd "${p_dest}" -r - -s -p1 < \
16 "/root/fuel/mcp/patches/${p_file}" > /dev/null; then
17 patch -fd "${p_dest}" -p1 < "/root/fuel/mcp/patches/${p_file}"