-#!/bin/bash -exu
+#!/bin/bash
# shellcheck disable=SC2103
#
# Copyright (C) 2020 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -exu
+
#Required variables
GERRIT_NAME=${GERRIT_NAME:-}
WORKSPACE=${WORKSPACE:-}
gerrit_query="?o=CURRENT_REVISION&o=DOWNLOAD_COMMANDS"
gerrit_json_query=".revisions[.current_revision].ref"
-possible_depends_on="lttng-ust"
+possible_depends_on="lttng-ust|lttng-modules"
re="Depends-on: (${possible_depends_on}): ([^'$'\n'']*)"
property_file="${WORKSPACE}/gerrit_custom_dependencies.properties"
continue
fi
+ if [ "$project" = "lttng-modules" ]; then
+ if [ -d "$WORKSPACE/src/lttng-modules" ]; then
+ # Remove the regular modules sources to replace them with those
+ # from the gerrit change
+ rm -rf "$WORKSPACE/src/lttng-modules"
+ else
+ # This job does not require modules sources
+ continue
+ fi
+ fi
+
# Export the GERRIT_DEP_... into the property file for further jenkins usage
echo "GERRIT_DEP_${project_sanitize^^}=${gerrit_id}" >> "$property_file"