From d2caca50835598779bb58c7d9f822a8a9a6cac0f Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Wed, 26 Oct 2016 13:08:15 +0200 Subject: [PATCH] - Updated 'check' section in Makefile and usb.ids check script - Added source Dockerfile for hwdata-check image Signed-off-by: Vitezslav Crhonek --- Dockerfile | 3 +++ Makefile | 5 ++++- check-usb-ids.sh | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ca2e2e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:22 +MAINTAINER Vitezslav Crhonek +RUN dnf install -y usbutils python-hwdata && rm -rf /var/cache/yum diff --git a/Makefile b/Makefile index 05ec8cb..7fff7aa 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,9 @@ CVSTAG = $(NAME)-r$(subst .,-,$(VERSION)) IDFILES = pci.ids usb.ids oui.txt iab.txt pnp.ids +# usb.ids is not in UTF-8 +UTF_IDFILES = pci.ids oui.txt iab.txt pnp.ids + .PHONY: all install tag force-tag check commit create-archive archive srpm-x \ clean clog download @@ -55,7 +58,7 @@ check: @[ -x /sbin/lspci ] && /sbin/lspci -i pci.ids > /dev/null || { echo "FAILURE: /sbin/lspci -i pci.ids"; exit 1; } && echo "OK: /sbin/lspci -i pci.ids" @./check-pci-ids.py || { echo "FAILURE: ./check-pci-ids.py"; exit 1; } && echo "OK: ./check-pci-ids.py" @./check-usb-ids.sh - @for file in $(IDFILES); do \ + @for file in $(UTF_IDFILES); do \ text=`LANG=C file $$file`; \ expected="$$file: UTF-8 Unicode text"; \ if [[ "$$text" != "$$expected" ]]; then \ diff --git a/check-usb-ids.sh b/check-usb-ids.sh index b9f81d3..f9f2170 100755 --- a/check-usb-ids.sh +++ b/check-usb-ids.sh @@ -18,8 +18,8 @@ echo "Listing usb devices:" sudo docker run -t --privileged --rm=true \ -v `pwd`/usb.ids:/usr/share/hwdata/usb.ids:ro \ -v "$tmpdir:/mnt/out" \ - miminar/hwdata-check \ - /bin/bash -c 'lsusb 2>/mnt/out/err.out' || : + vcrhonek/hwdata-check \ + /bin/bash -c 'lsusb 2>/mnt/out/err.out; python /usr/share/doc/python-hwdata/example.py 2>>/mnt/out/err.out' || : if [[ `cat $tmpdir/err.out | wc -l` -gt 0 ]]; then echo "ERRORS:" nl $tmpdir/err.out -- 2.25.1