Bug 158723 - 2 bugs in inf2mondb.py
2 bugs in inf2mondb.py
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: hwdata (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2005-05-25 04:31 EDT by Fred New
Modified: 2015-03-04 20:14 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-18 08:37:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Fred New 2005-05-25 04:31:10 EDT
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 04:33:50 EDT
Created attachment 114816 [details]
New version of script

My patched version of the script.
Comment 2 Fred New 2005-05-25 04:42:47 EDT
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 08:46:27 EDT
Created attachment 114910 [details]
Possible script enhancement, version 2

Added parameters --new, --verbose and --database.
Comment 4 Phil Knirsch 2006-02-01 11:33:23 EST
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 07:26:39 EST
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 07:59:16 EST
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 11:43:02 EST
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 09:53:55 EDT
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 18:23:39 EDT
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 18:32:42 EDT
Updating bug to -devel as it's not addressed in FC6.
Comment 12 Phil Knirsch 2006-07-18 08:37:46 EDT
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.