3 # Copyright (c) 2020 Yubico AB. All rights reserved.
4 # Use of this source code is governed by a BSD-style
5 # license that can be found in the LICENSE file.
8 awk '{ printf "%d\n", $3 }' | sort -Cnu
11 if ! grep '^vendor' "$1" | sort_by_id; then
12 echo unsorted vendor section 1>&2
16 VENDORS=$(grep '^vendor' "$1" | awk '{ print $2 }')
17 PRODUCTS=$(grep '^product' "$1" | awk '{ print $2 }' | uniq)
19 if [ "${VENDORS}" != "${PRODUCTS}" ]; then
20 echo vendors: "$(echo "${VENDORS}" | tr '\n' ',')" 1>&2
21 echo products: "$(echo "${PRODUCTS}" | tr '\n' ',')" 1>&2
22 echo vendors and products in different order 1>&2
26 for v in ${VENDORS}; do
27 if ! grep "^product ${v}" "$1" | sort_by_id; then
28 echo "${v}": unsorted product section 1>&2