Split dependencies and update sort-vendor correspondingly

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-08-08 00:39:31 -07:00
parent 95bd02d28f
commit 7d56fdcc83
2 changed files with 86 additions and 68 deletions

View File

@@ -23,6 +23,17 @@ source $(dirname "${BASH_SOURCE[0]}")/utils.sh
cd ${ROOT}
echo "Sort vendor.conf..."
sort vendor.conf -o vendor.conf
tmpdir="$(mktemp -d)"
trap "rm -rf ${tmpdir}" EXIT
awk -v RS= '{print > "'${tmpdir}/'TMP."NR}' vendor.conf
for file in ${tmpdir}/*; do
if [[ -e "${tmpdir}/vendor.conf" ]]; then
echo >> "${tmpdir}/vendor.conf"
fi
sort -Vru "${file}" >> "${tmpdir}/vendor.conf"
done
mv "${tmpdir}/vendor.conf" vendor.conf
echo "Please commit the change made by this file..."