project-config/tools/check_projects_yaml_alphabetized.sh
Sorin Sbarnea 97cacc26cc Enable tripleo core members to change WIP flag
This change enables people that already had permission to abandon
other changes to also toggle the WIP flag on them.

Change-Id: I894df2e26c6927eac25dbfe596a93f4209ff92ee
Reference: https://gerrit-review.googlesource.com/c/gerrit/+/212571/3/java/com/google/gerrit/common/data/Permission.java#49
2020-12-07 15:59:25 +00:00

26 lines
596 B
Bash
Executable File

#!/bin/bash -xe
# It checks that projects.yaml alphabetized and prints list of projects that
# should be sorted.
TMPDIR=$(mktemp -d)
export TMPDIR
trap "rm -rf $TMPDIR" EXIT
pushd $TMPDIR
PROJECTS_LIST=$OLDPWD/$1
sed -e '/^- project: /!d' -e 's/^- project: //' $PROJECTS_LIST > projects_list
LC_ALL=C sort --ignore-case projects_list -o projects_list.sorted
if ! diff projects_list projects_list.sorted > projects_list.diff; then
echo "The following projects should be alphabetized: "
cat projects_list.diff | grep -e '> '
exit 1
else
echo "Projects alphabetized."
fi
popd