hardware:: tag matching lib plans

Michael Vogt mvo at ubuntu.com
Mon Jan 16 15:39:52 UTC 2012

On Mon, Jan 16, 2012 at 02:07:43PM +0100, Enrico Zini wrote:
> On Mon, Jan 16, 2012 at 09:30:41AM +0100, Michael Vogt wrote:
> > for the software-center I'm currently looking into building a lib that
> > can match a debtag hardware:: tag (like hardware::storage:dvd) to the
> > capabilities of the actual computer. This will allow us to show
> > information in the GUI like: "This software requires a touchscreen,
> > but the computer does not have one." [2]
> I like the idea. In fact, the whole hardware::* tag could be managed by
> the maintainers of the detection library, effectively as part of that
> project. The two things will give each other meaning.

Cool idea! The project is still in the infant stage but some stuff
appears to be working already. My initial goal would be to cover the
current tags plus additional meaning like "requires writer" that are
combinations of tags (like you outlined below).
> > For this I would like to talk about some new tags that look useful in
> > this context:
> > 
> > Tag: hardware::input:touchscreen
> > Description: Requires a touchscreen input
> That's uncontroversial and I've added it:
>   Tag: hardware::input:touchscreen
>   Description: Touchscreen
> I'd avoid wording the description as 'Requires', since it sounds better
> if it makes a difference in the life of the user: "it's something that
> allows you to use/tweak your touch screen".

Yeah, thanks! That makes more sense.
> > Tag: hardware::storage:cd:writer
> > Description: Compact Disc writer
> > (or hardware::storage:cd-writer ?)
> > 
> > Tag: hardware::storage:dvd:writer
> > Description: Digital Versatile Disc writer
> This is something that I would prefer to get via a combination of
> different tags: use::viewing/use::editing, for example, to distinguish
> between cd/dvd players and cd/dvd writers. If that strategy gives
> wrong results, then we can consider adding special tags.

Nice! Yeah, I can certainly change the code in the lib to look at the
use:: tag and check for CD/CD-writer depending on it.

> > Here are two more that are a little more difficult. The tag would
> > embed a number that the lib parses then. I'm not sure how well that
> > fits into the general schema of debtags. If its does not fit I wonder
> > if it could be done as a private extension to the system? Would we
> > prefix it in some special way?
> > 
> > Tag: hardware::memory:{1,2,4,8}GB
> > Description: Requires at least N amount of RAM 
> > 
> > Tag: hardware::video:opengl:{2,3,4.1,4.2}
> > Description: Requires at least N opengl level to run
> It sort of fits as long as you have 'at least' and you don't need to add
> all the tags to say 'up to'.
> The biggest problem I can see is that tags are not assigned to specific
> versions of packages, so if game foo needs opengl 4.2 only since
> foo-3.0, that's something you can't encode with debtags at the moment.
> Things could be fixed by putting tags in debian/control, at some point.
> It could be time to reevaluate that option, but even if we started
> working on that now, I don't think it's going to happen before at least
> 6 months.

Thanks! I'm not very concerned about it at this point but its good to
keep it in mind. As a workaround we still could add XB-Tag to the
debian/control file, couldn't we? Or will that cause other problems?

> The other issue I see is that the logic isn't very extensible: if
> tomorrow you need to track another hardware feature that requires a <=
> or >= comparison and not just an 'has tag' one, then you're stuck. OTOH,
> if such needs arise, then it's time to design a specially crafted
> control file header, but at least tags took us to that point.

Thanks again! I would prefer not to use special headers as we have
enough of them already and debtags feels to me like a much nicer and
more general solution.

I'm not quite sure I understand the limitation here correctly. At
least for the memory case it could work like this:
 Ceck if HW requirements are meet by building up a search that
 include hardware::memory:1GB if the machine has at least 1GB
 memory. When checking the requirements it would iterate the tags and
 simply parse the value when it finds "hardware::memory:" and compare
 it. For a query it could add some tags based on the HW  (at startup
 or when building the query) or possible using a xapian KeyMaker
 (probably not very fast when python is used though). Not very
 granular, as it would probably just {0.5,1,2,4} GB initially and a
 machine with 4g would simply include a or-query with all of those values. 

Or would that be considered ugly? 
> More ideas for hardware tags can come from looking at:
> http://debtags.debian.net/edit/tags/hardware::TODO
> (I'm sorry it it still misses a 'next page' option)

Very nice, thanks! Looks like bluetooth and wifi are obvious
candidates from looking over the list (and maybe firewire 1394 but I
don't know much about that myself).

Thanks a lot!

More information about the Debtags-devel mailing list