Skip to content

Commit

Permalink
udev: use general numeric sort
Browse files Browse the repository at this point in the history
Ubuntu 24.04 comes with a version of original-awk that no longer accepts
hexadecimal values [1]. For the time being, use sort -Cgu instead. This
appears to work on both GNU coreutils' and Apple's versions of sort.  If
anyone has a better solution, please let us know.

[1] https://github.com/onetrueawk/awk/blob/5c261eb19a5e92bb6d68e818cf575524067c1e6a/awk.1#L626-L628
  • Loading branch information
LDVG committed Oct 4, 2024
1 parent b95a914 commit 50b8424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions udev/check.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh -u

# Copyright (c) 2020 Yubico AB. All rights reserved.
# Copyright (c) 2020-2024 Yubico AB. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# SPDX-License-Identifier: BSD-2-Clause

sort_by_id() {
awk '{ printf "%d\n", $3 }' | sort -Cnu
awk '{ printf "%s\n", $3 }' | sort -Cgu
}

if ! grep '^vendor' "$1" | sort_by_id; then
Expand Down

0 comments on commit 50b8424

Please sign in to comment.