I'm working on Fedora linux, and I want to compare the md5 sum of a current file with the md5 sum in the RPM database. This will tell me if the file has changed at all.

From the command line, I can run "rpm -q package --dump" to get gobs of data about every file in the RPM named "package", including the md5 sum of each file.

I'd like to use a perl module that uses the RPM api instead of running a thousand instances of the rpm command.

There several modules (RPM,RPM2,RPM4) that look like they might help. I'm playing with RPM2, but it's not giving me the love I need. RPM4's docs look discouraging and RPM is very old and probably doesn't match the current api.

If anyone out there has any ideas for me, please let me know. If you know that any of the existing RPM modules won't help me, please also tell me that so I can stop fiddling with it. Also speak up if you'd like something similer. If it doesn't exist, maybe I'll write it...

Oh, and if you're wondering, I'm trying to make a comprehensive list of files I've changed since installation. I can't just use tripwire or something like that because I want to find changes I might have made a while ago.

Thanks

Update I'm trying to do this without calling the rpm command over and over.

-Pileofrogs

In reply to RPMS and file md5s by pileofrogs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.