File: test-hex-casing.sh

package info (click to toggle)
openrazer 2.9.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,176 kB
  • sloc: python: 9,377; ansic: 8,091; sh: 580; makefile: 179; xml: 141
file content (23 lines) | stat: -rwxr-xr-x 680 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Checks for correct casing of hex values in the source

out=$(grep -rh "USB_PID = " daemon/openrazer_daemon/hardware/ | cut -d '=' -f2 | grep -v None | sort -f | grep -E '[a-f]')

if [ ! -z "$out" ]; then
  echo "ERROR: wrong casing of hex number!"
  echo "Please convert the following hex numbers in daemon/openrazer_daemon/hardware/ to uppercase:"
  echo "$out"
  exit 1
fi

out=$(git grep "#define USB_DEVICE_ID_" driver/ | cut -d' ' -f3 | sort -f | grep -E '[a-f]')

if [ ! -z "$out" ]; then
  echo "ERROR: wrong casing of hex number!"
  echo "Please convert the following hex numbers in driver/ to uppercase:"
  echo "$out"
  exit 1
fi

echo "No issues found."