Proposed guideline for init script files

Toshio Kuratomi a.badger at gmail.com
Fri Mar 2 20:07:18 UTC 2007


On Thu, 2007-03-01 at 20:27 -0900, Jeff Spaleta wrote:
> On 2/28/07, Michael Schwendt <bugs.michael at gmx.net> wrote:
> > It's called "to mess around in a system". Admins, who do that, often
> > forget what files they've changed, and "rpm -Va" only reports the changed
> > checksum, not a diff.
> 
> Hmmm, how much secret sauce would it take to make it easy to get a
> diff of changes for scripts files which fail an rpm -V check. Probably
> not really worth the pain of attempting to kludge together.
> 
> -jef"goes off to sandwhich yumdownloader, rpm -V, rpm2cpio and diff
> together inside a delicious perl wrapper"spaleta
> 
Luke Macken, Will Woods, and I were talking about something just a
little less ambitious at FudCON.  Just keeping a history of config
files.  Here's a bit of a hack that could get you started.  The one
glaring problem that I see with it is that it doesn't keep a copy of the
original file.  ie: When I want to see the change, I probably want a
diff3 between the original file, my modified file, and the file rpm is
going to install.  Without the original, I can only see the changes
between my modified file and the new one.

REPO="/var/lib/rpmcraziness"
VCSCOMMIT="/usr/bin/bzr commit"
package=sys.argv[1]

changedFiles=os.popen("rpm -V %s" % package)
for fileLine in changedFiles:
    fileParts=fileLine.split()
    filename=fileParts[-1]
    if is_text_file(filename):
        shutil.copy2(filename, os.path.join(REPO, filename[1:])
os.system("%s %s" % (VCSCOMMIT, REPO))

You'll have to write is_text_file() yourself as my imagination ends
there :-)

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-maintainers/attachments/20070302/6538e94c/attachment.sig>


More information about the Fedora-maintainers mailing list