Re: [PATCH 3/7] Also extract application ID from ISO PVD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 23, 2012 at 12:06:42AM +0200, Zeeshan Ali (Khattak) wrote:
> On Tue, Feb 21, 2012 at 3:50 PM, Daniel P. Berrange <berrange@xxxxxxxxxx> wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> I was wondering why a debian ISO is getting detected as Ubuntu one now:
> 
> $ osinfo-detect ~/ISOs/debian-6.0.4-i386-CD-1.iso
> Media is bootable.
> Media is an installer for OS 'Ubuntu Feisty Fawn'
> Media is live media for OS 'Ubuntu Feisty Fawn'
> 
> git-bisect lead me to conclude that this patch is the culprit. Here is
> the problematic part:
> 
> > @@ -367,6 +368,7 @@ OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
> >     media_volume = osinfo_media_get_volume_id(media);
> >     media_system = osinfo_media_get_system_id(media);
> >     media_publisher = osinfo_media_get_publisher_id(media);
> > +    media_application = osinfo_media_get_application_id(media);
> >
> >     oss = osinfo_list_get_elements(OSINFO_LIST(db->priv->oses));
> >     for (os_iter = oss; os_iter; os_iter = os_iter->next) {
> > @@ -382,8 +384,11 @@ OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
> >             const gchar *os_volume = osinfo_media_get_volume_id(os_media);
> >             const gchar *os_system = osinfo_media_get_system_id(os_media);
> >             const gchar *os_publisher = osinfo_media_get_publisher_id(os_media);
> > +            const gchar *os_application = osinfo_media_get_application_id(os_media);
> >
> > -            if (match_regex (os_volume, media_volume) &&
> > +            if ((match_regex (os_volume, media_volume) ||
> > +                 match_regex (os_application, media_application))
> > +                 &&
> >                 (match_regex (os_system, media_system) ||
> >                  match_regex (os_publisher, media_publisher))) {
> >                 ret = os;
> 
> Seems you have changed some of the "&&" to "||" so that now if
> application and system or publisher ID matches, its a match. Sending a
> patch soon..

In fact one of my local checkouts changes this again. What I need todo
is add the Debian ISOs to the test suite too, so I can detect this flawed
logic & validate the fix.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux