2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
12 # This script performs version bumping activities for an ODL release.
13 echo "---> compare-autorelease-projects.sh"
15 # The purpose of this script is to compare list of projects in autorelease
16 # are equal to the list of projects in integration/distribution.
18 mapfile -t PROJECTS_INT_DIST < <(xmlstarlet sel\
19 -N "x=http://maven.apache.org/POM/4.0.0"\
20 -t -m "/x:project/x:profiles/x:profile[x:activation/x:activeByDefault='true']/x:dependencies/x:dependency/x:groupId"\
22 -n integration/distribution/features/repos/index/pom.xml 2>/dev/null | sort -u)
24 # process projects in int/dist read from pom.xml file
25 declare -a project_int_dist
26 for project in "${PROJECTS_INT_DIST[@]}"; do
27 if [[ $project =~ project.groupId ]] || [[ $project =~ odlparent ]]; then
29 elif [[ $project =~ org.opendaylight ]]; then
30 project=$(echo "${project/org.opendaylight./}")
31 project_int_dist+=( "$(echo "${project/.//}" )" )
35 project_int_dist+=("mdsal")
36 project_int_dist+=("integration/distribution")
38 # Get a list of all the projects from releng/autorelease repo
40 mapfile -t project_AR < <(git submodule status | awk -e '{print $2}' | sort | uniq)
42 # Use associative arrays to get diff in the projects lists
43 declare -A map_AR map_intdist
44 for project in "${project_AR[@]}"
46 ((map_AR[$project]++))
49 for project in "${project_int_dist[@]-0}"
51 ((map_intdist[$project]++))
54 for project in "${!map_AR[@]}"
56 if (( ${map_AR[$project]} >= 1 && ${map_intdist[$project]-0} >= 1 )); then
57 unset "map_AR[$project]" "map_intdist[$project]"
61 result=("${!map_AR[@]}" "${!map_intdist[@]}")
63 if [ "${#result[@]}" != "0" ]; then
64 if [ "${#map_AR[@]}" != "0" ]; then
65 echo "WARNING: List of projects in releng/autorelease but NOT in integration/distribution: ${!map_AR[*]}"
66 elif [ "${#map_intdist[@]}" != "0" ]; then
67 echo "ERROR: List of projects in integration/distribution but NOT in releng/autorelease: ${!map_intdist[*]}"
71 echo "List of projects releng/autorelease and integration/distribution repositories are equal"