public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Resolving HAL vs. pciutils/usbutils
Date: Tue, 30 Oct 2007 18:56:05 -0700	[thread overview]
Message-ID: <20071031015605.GY22369@curie-int.orbis-terrarum.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3178 bytes --]

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     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #1.2: pciutils-2.2.7-update-pciids-both-forms.patch --]
[-- Type: text/plain, Size: 865 bytes --]

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 #2: Type: application/pgp-signature, Size: 321 bytes --]

             reply	other threads:[~2007-10-31  1:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  1:56 Robin H. Johnson [this message]
2007-10-31 10:46 ` [gentoo-dev] Resolving HAL vs. pciutils/usbutils Daniel Drake
2007-10-31 11:04   ` [gentoo-dev] " Guilherme Amadio
2007-10-31 11:31     ` Jan Kundrát
2007-10-31 13:30   ` Ryan Hill
2007-10-31 15:09   ` [gentoo-dev] " Wulf C. Krueger
2007-10-31 14:56     ` Daniel Drake
2007-10-31 15:40   ` Doug Goldstein
2007-10-31 16:12     ` Roy Marples
2007-10-31 17:07       ` Rémi Cardona
2007-10-31 16:26     ` Daniel Drake
2007-10-31 16:41       ` Jan Kundrát

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071031015605.GY22369@curie-int.orbis-terrarum.net \
    --to=robbat2@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox