Heya,

So now this is not a flamewar.

Jakub was originally going to complain at me for the upstream usbutils
adding support for gzipped usb.ids files, but a group of us (myself,
dsd, jakub, leio, steev) had a discussion about it, and came up with a
solution that both ends the breakage for direct users (HAL and others),
and provides forward momentum.

So firstly, what's the real problem? The original complaint came up
because HAL expected the uncompressed file to exist as pci.ids, and
wasn't ready to look at pci.ids.gz. While this caused breakage, it was
only a warning sign that there was a deeper problem.

libpci exists so that every application that wants to read the pci.ids
file does not need to know the format, and so that the pciutils
maintainers can change the file format (paired with changing their
parsing code), without causing breakage for any other packages.

HAL is not the only user of pci.ids/usb.ids:
http://www.google.com/codesearch?q=%22pci.ids%22
http://www.google.com/codesearch?q=%22usb.ids%22

Here's DSD's original thread on the HAL lists:
http://lists.freedesktop.org/archives/hal/2007-June/008834.html
And he also noted this, but I don't have a link for it.
<dsd_> upstream PCI are going to change the format too, they gave 
       like a years notice
Also:
<robbat2> dsd_, thanks. so really, once the libpci is installed as 
          a shared lib, there's no reason that HAL shouldn't use it?
<dsd_> robbat2: indeed - and nobody actually raised that as an 
       objection, parts of hal already statically link against 
       libpci...

So at the moment, HAL needs the changes, but the patches have been
blocked because pciutils needs move to a shared library and not cause
ABI breakages instead of the present static-lib-only situation.

usbutils is in very similar (but not quite identical) position, they
have not yet introduced any library, but will be doing so, to enable
similar format changes.

The solution that the group of us agreed on, was the following:
For USE=zlib, pciutils and usbutils should use the .gz version,
but ALSO maintain the uncompressed version until all applications 
have migrated to using the libraries to handle the pci.ids.

This uses the upstream-preferred formats for download, and stores
suitably so that both {pci,usb}utils work, and HAL works as well
(without the note about installing pciutils with USE=-zlib). The only
download until this transition is finished is using an extra 180Kb on
disk for the compressed versions (120Kb for the pci.id.gz and 60Kb for
usb.ids.gz).

Attached is my patch that has pci.ids stored in both styles (also cleans
up old .gz files if compression is not being used). I've got it ready to
commit to the tree with pciutils-2.2.8, and similarly for usb.ids
(pending an ongoing discussion with upstream usbutils about their
server-side usb.ids).

If there is no major dissent when I get up tomorrow, I'll commit this,
as the end to the breakage.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : [EMAIL PROTECTED]
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
diff -Nuar pciutils-2.2.7.orig/update-pciids.sh pciutils-2.2.7/update-pciids.sh
--- pciutils-2.2.7.orig/update-pciids.sh        2007-10-30 16:17:03.253630000 
-0800
+++ pciutils-2.2.7/update-pciids.sh     2007-10-30 16:39:46.810463056 -0800
@@ -72,4 +72,18 @@
        rm -f ${DEST%.gz} ${DEST%.gz}.old
 fi
 
+# if the gzip version exists, but we are not using compressed mode, 
+# erase the gzip version, as it is old and crufty
+if [ -z "$PCI_COMPRESSED_IDS" ] && [ -f $DEST.gz ]; then
+       rm -f ${DEST}.gz
+fi
+
+# Lastly, because HAL still reads the plaintext version only and 
+# has not yet migrated to using a library we leave the plaintext 
+# version in addition to the gzip version.
+# They need to migrate because the pci.ids format will be changing.
+if [ ${DEST%.gz} != ${DEST} ] ; then
+       gzip -d <${DEST} >${DEST%.gz}
+fi
+
 ${quiet} || echo "Done."

Attachment: pgpE6UaGODNcX.pgp
Description: PGP signature

Reply via email to