Re: Proposed guideline for init script files

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

 



On Thu, 2007-03-01 at 20:27 -0900, Jeff Spaleta wrote:
> On 2/28/07, Michael Schwendt <bugs.michael@xxxxxxx> 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

Attachment: signature.asc
Description: This is a digitally signed message part

--
Fedora-maintainers mailing list
Fedora-maintainers@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers
--
Fedora-maintainers-readonly mailing list
Fedora-maintainers-readonly@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers-readonly

[Index of Archives]     [Fedora Users]     [Fedora Development]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux