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.
6 # SPDX-License-Identifier: BSD-2-Clause
9 awk '{ printf "%d\n", $3 }' | sort -Cnu
12 if ! grep '^vendor' "$1" | sort_by_id; then
13 echo unsorted vendor section 1>&2
17 VENDORS=$(grep '^vendor' "$1" | awk '{ print $2 }')
18 PRODUCTS=$(grep '^product' "$1" | awk '{ print $2 }' | uniq)
20 if [ "${VENDORS}" != "${PRODUCTS}" ]; then
21 echo vendors: "$(echo "${VENDORS}" | tr '\n' ',')" 1>&2
22 echo products: "$(echo "${PRODUCTS}" | tr '\n' ',')" 1>&2
23 echo vendors and products in different order 1>&2
27 for v in ${VENDORS}; do
28 if ! grep "^product ${v}" "$1" | sort_by_id; then
29 echo "${v}": unsorted product section 1>&2