[Yum-devel] new simple "protectyum" plugin
seth vidal
skvidal at linux.duke.edu
Mon Jun 11 21:45:40 UTC 2007
On Mon, 2007-06-11 at 16:42 -0400, Matthew Miller wrote:
> Look, I'm making myself useful!
>
> Or more precisely, I'm making someone who works for me be useful. She
> insisted on putting my name on this, but actually she did all the work. Not
> that there's a lot of lines to this, but credit where it is properly due. :)
>
> Anyway, it's a simple plugin to make yum stop if it's asked to remove
> itself -- the rationale being:
>
> 1) Anything else, you can use yum to repair.
> 2) This happens to catch and stop a lot of stupid accidental ways
> in which you could shoot yourself in the foot when using "yum -y".
> 3) And also a lot of stupid ways you can shoot yourself in the foot if
> you're the curious sort but don't know what little programs "glibc"
> might be good for. (It's actually pretty impressive what all this
> protects against.)
>
> In fact, I wanted to call it "yum-footshield", but Sveta's more sensible
> name prevailed.
>
> So, without further ado, protectyum.py:
>
two items here:
1. you might want to check the rest of the ts to see if yum is being
installed or updated, too. Just for sanity sake
2. why not make this more generic and have this be a
yum-protect-stupidity plugin with a list of pkgnames it will bail out if
it encounters them being removed. I can think of a few good examples:
glibc, pam, openssh-server, coreutils, filesystem, basesystem, etc
if the user can specify a 'error if you see these list it would be
convenient for a bunch of folks, I think.
What do you think?
-sv
More information about the Yum-devel
mailing list