Bug 158723 - 2 bugs in inf2mondb.py
Summary: 2 bugs in inf2mondb.py
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: hwdata
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2005-05-25 08:31 UTC by Fred New
Modified: 2015-03-05 01:14 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-07-18 12:37:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
New version of script (6.01 KB, text/plain)
2005-05-25 08:33 UTC, Fred New
no flags Details
Possible enhancement to script. (6.81 KB, text/plain)
2005-05-25 08:42 UTC, Fred New
no flags Details
Possible script enhancement, version 2 (8.05 KB, text/plain)
2005-05-27 12:46 UTC, Fred New
no flags Details
inf2mondb.py (8.29 KB, text/plain)
2006-02-16 16:43 UTC, Matt Domsch
no flags Details

Description Fred New 2005-05-25 08:31:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
The Windows XP monitor.inf file has two irregularities that cause inf2mondb.py
to crash.  First, I see this message:

$ inf2mondb.py monitor.inf
Traceback (most recent call last):
  File "/home/fred/bin/inf2mondb.py", line 163, in ?
    sync = string.split(modes[3], ',')
IndexError: list index out of range
$

If I fix inf2mondb.py to get around this problem, I get the following error:

$ inf2mondb.py monitor.inf
Bridge Information Co.,Ltd; Bridge BM17C; BRG00AB; 30.0-70.0; 50.0-160.0
<snip>
(Standard monitor types); Standard VGA 640x480; MS_0640; ;
Traceback (most recent call last):
  File "/home/fred/bin/inf2mondb.py", line 170, in ?
    for monitor in monitors[man].values():
KeyError: 'applem'
$

Version-Release number of selected component (if applicable):
hwdata-0.145-1

How reproducible:
Always

Steps to Reproduce:
1. inf2mondb.py monitor.inf  # Monitor .inf file from Windows XP
 

Actual Results:  I get the error messages above.

Expected Results:  Successful running of the script with no error messages.

Additional info:

Comment 1 Fred New 2005-05-25 08:33:50 UTC
Created attachment 114816 [details]
New version of script

My patched version of the script.

Comment 2 Fred New 2005-05-25 08:42:47 UTC
Created attachment 114817 [details]
Possible enhancement to script.

This version of the script looks in MonitorsDB and displays entries that don't
already exist.	It may be possible to write the script to work the old way and
my
new way depending on parameters, but I'm not a power Python programmer, yet.

Comment 3 Fred New 2005-05-27 12:46:27 UTC
Created attachment 114910 [details]
Possible script enhancement, version 2

Added parameters --new, --verbose and --database.

Comment 4 Phil Knirsch 2006-02-01 16:33:23 UTC
Interessting script. I'll take a closer look at it, maybe even put it in as long
as it provides by default the same behaviour as the old script.

Read ya, Phil

Comment 5 Fred New 2006-02-02 12:26:39 UTC
If you keep my enhancements, feel free to change the parameters to more
meaningful names.  Particularly the "--new" parameter - I couldn't think of a
more descriptive word for what I was trying to do.

Comment 6 Phil Knirsch 2006-02-02 12:59:16 UTC
The parameters sound fine to me, --new could be renamed to --diff, but i don't
think thats necessary as long as the help provides some info what --new does. :) 

I've just tested it, there is still a small bug: If you specify a monitor.inf
file and check the output all monitor entries will have the same EISA ID. I
tried it with several .inf files and always got that problem. Without having
looked at the code closer yet i suspect it's because of some hash lookup where
the correlation between a monitor entry in the .inf file and it's EISA number
somehow gets lost and only the 1st entry will be picked.

Will look at code some more and see if i can find the problem. Otherwise really
helpful as i can easily check a new .inf file against the current MonitorsDB and
see whats supposedly new.

Read ya, Phil

Comment 7 Matt Domsch 2006-02-16 16:43:02 UTC
Created attachment 124766 [details]
inf2mondb.py

the attached version is essentially a complete rewrite of the ini parsing,
using ConfigParser.  It successfully parses all the monitor*.inf files from
Windows XP, as well as all the monitor files posted on ftp.dell.com/monitors/. 
Using this version, I found 15 monitors that Dell has posted but that aren't in
any published MonitorDB files, where using the previous versions, I only found
2. :-)

Comment 9 Phil Knirsch 2006-05-10 13:53:55 UTC
Using that script internally atm. If it proves to be working for all files i get
my hands on i'll probably replace the old in in the near future.

Read ya, Phil

Comment 10 Matthew Miller 2006-07-10 22:23:39 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 11 Matt Domsch 2006-07-10 22:32:42 UTC
Updating bug to -devel as it's not addressed in FC6.

Comment 12 Phil Knirsch 2006-07-18 12:37:46 UTC
I've included your new inf2mondb.py now in the Fedora Devel package as it worked
flawless so far and the code looks ok. Will be in next hwdata package in rawhide.

Read ya, Phil


Note You need to log in before you can comment on or make changes to this bug.