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

Re: [virt-tools-list] [PATCH 3/7] Also extract application ID from ISO PVD



On Tue, Feb 21, 2012 at 3:50 PM, Daniel P. Berrange <berrange redhat com> wrote:
> From: "Daniel P. Berrange" <berrange redhat com>

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..

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


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