aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-usb.py
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2015-07-19 13:06:37 -0700
committerGerald Combs <gerald@wireshark.org>2015-07-19 20:24:08 +0000
commit19b28488acb0f603fe0ddde47d7063c0d521238c (patch)
treeac54de1eb84aaa9501f196a9ac4bf48af566c24e /tools/make-usb.py
parent0809a4e0868cd03baf5be575c8791608dc81ed92 (diff)
Fixup make-usb.py
SourceForge (which is where the Linux USB project is hosted) is currently under maintenance. As a result this morning's update-numbers run clobbered usb.c. Add a minimum vendor and product count check to make-usb.py. Change-Id: Ia18bcd9c0eb365bd97b735795e9ad39cd85093a8 Reviewed-on: https://code.wireshark.org/review/9706 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools/make-usb.py')
-rwxr-xr-xtools/make-usb.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/make-usb.py b/tools/make-usb.py
index 1e967f70f6..2d9c931b56 100755
--- a/tools/make-usb.py
+++ b/tools/make-usb.py
@@ -17,7 +17,8 @@ else:
MODE_IDLE = 0
MODE_VENDOR_PRODUCT = 1
-
+MIN_VENDORS = 2900 # 2948 as of 2015-06-28
+MIN_PRODUCTS = 15000 # 15415 as of 2015-06-28
mode = MODE_IDLE
@@ -60,6 +61,13 @@ for line in u.readlines():
fields=line.split()
products[fields[0]]= ' '.join(fields[1:])
+if (len(vendors) < MIN_VENDORS):
+ sys.stderr.write("Not enough vendors: %d\n" % len(vendors))
+ sys.exit(1)
+
+if (len(products) < MIN_PRODUCTS):
+ sys.stderr.write("Not enough products: %d\n" % len(products))
+ sys.exit(1)
for v in sorted(vendors):
vendors_str += " { 0x%s, \"%s\" },\n"%(v,vendors[v])
@@ -131,5 +139,3 @@ f.write("\n")
f.close()
print("Success!")
-
-