[yum-commits] plugins/protect-packages yum-utils.spec

James Antill james at osuosl.org
Thu Apr 29 22:43:15 UTC 2010


 plugins/protect-packages/protect-packages.conf |    3 
 plugins/protect-packages/protect-packages.py   |   88 -------------------------
 yum-utils.spec                                 |   21 -----
 3 files changed, 112 deletions(-)

New commits:
commit 610ef70f88ea9bf72eaa129c8da83e9cc421d23b
Author: James Antill <james at and.org>
Date:   Thu Apr 29 18:42:13 2010 -0400

    The protect-packages feature has been merged into core yum, removing it

diff --git a/plugins/protect-packages/protect-packages.conf b/plugins/protect-packages/protect-packages.conf
deleted file mode 100644
index ff3515a..0000000
--- a/plugins/protect-packages/protect-packages.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[main]
-enabled = 1
-confdir = /etc/sysconfig
diff --git a/plugins/protect-packages/protect-packages.py b/plugins/protect-packages/protect-packages.py
deleted file mode 100644
index 4cf50a2..0000000
--- a/plugins/protect-packages/protect-packages.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-# Copyright 2007 Boston University 
-# written by Svetlana Anissimova <svetanis at gmail.com> and
-#            Matthew Miller <mattdm at mattdm.org>
-
-"""
-This plugin prevents Yum from removing itself and other protected packages.
-
-By default, yum is the only package protected, but by extension this
-automatically protects everything on which yum depends (rpm, python, glibc, 
-and so on).Therefore, the plugin functions well even without
-compiling careful lists of all important packages.
-
-Additional packages to protect may be listed one per line in the file
-/etc/sysconfig/protected-packages and in *.list files placed in  
-/etc/sysconfig/protected-packages.d/. 
-
-If you wish to temporarily exclude certain packages from protection, you can
-use the --override-protection command-line option. 
-"""
-
-
-from yum.plugins import TYPE_CORE, TYPE_INTERACTIVE, PluginYumExit
-import os
-import string
-import glob
-
-requires_api_version = '2.4'
-plugin_type = (TYPE_CORE, TYPE_INTERACTIVE)
-
-def config_hook(conduit):
-    parser = conduit.getOptParser()
-    if hasattr(parser, 'plugin_option_group'):
-        parser = parser.plugin_option_group
-    parser.add_option("", "--override-protection", dest='override', 
-                      action="append", default=[], metavar='[package]',
-                      help="remove package from the list of protected packages")
-
-def postresolve_hook(conduit):
-    protectedpkgs = ['yum']
-    protectedlist = []
-    opts, args = conduit.getCmdLine()
-
-    confdir = conduit.confString('main','confdir','/etc/sysconfig')
-
-    if os.access(confdir + "/protected-packages", os.R_OK) : 
-        protectedlist.append(confdir + "/protected-packages")
-
-    if os.access(confdir + "/protected-packages.d", os.R_OK):
-        protectedlist.extend(glob.glob(confdir + "/protected-packages.d/*.list"))
-
-    if protectedlist:
-        for f in protectedlist:
-            for line in open(f).readlines():            
-                line = string.strip(line)
-                if (line and line[0] != "#" and line not in opts.override  
-                                            and line not in protectedpkgs):
-                    protectedpkgs.append(line)
-
-    for tsmem in conduit.getTsInfo().getMembers():
-        if tsmem.name in protectedpkgs and tsmem.ts_state == 'e':
-            raise PluginYumExit("This transaction would cause %s to be removed."
-                " This package is vital for the basic operation of your system."
-                " If you really want to remove it, edit the list of protected"
-                " packages in the file %s or in the directory %s or use the"
-                " --override-protection command-line option."
-                %(tsmem.name, confdir + "/protected-packages",
-                 confdir + "/protected-packages.d"))
-
-
-
-
-
-
diff --git a/yum-utils.spec b/yum-utils.spec
index 2f0b955..d0dbcb8 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -162,21 +162,6 @@ to yum and the list-security and info-security commands.
 The options make it possible to limit list/upgrade of packages to specific
 security relevant ones. The commands give you the security information.
 
-%package -n yum-plugin-protect-packages
-Summary: Yum plugin to prevents Yum from removing itself and other protected packages
-Group: System Environment/Base
-Provides: yum-protect-packages = %{version}-%{release}
-Obsoletes: yum-protect-packages < 1.1.20-0
-Conflicts: yum-protect-packages < 1.1.20-0
-Requires: yum >= 3.0
-
-%description -n yum-plugin-protect-packages
-this plugin prevents Yum from removing itself and other protected packages.
-By default, yum is the only package protected, but by extension this
-automatically protects everything on which yum depends (rpm, python, glibc,
-and so on).Therefore, the plugin functions well even without
-compiling careful lists of all important packages.
-
 %package -n yum-plugin-upgrade-helper
 Summary: Yum plugin to help upgrades to the next distribution version
 Group: System Environment/Base
@@ -382,7 +367,6 @@ plugins="\
  refresh-updatesd \
  merge-conf \
  security \
- protect-packages \
  upgrade-helper \
  aliases \
  list-data \
@@ -529,11 +513,6 @@ fi
 /usr/lib/yum-plugins/security.*
 %{_mandir}/man8/yum-security.8.*
 
-%files -n yum-plugin-protect-packages
-%defattr(-, root, root)
-%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protect-packages.conf
-/usr/lib/yum-plugins/protect-packages.*
-
 %files -n yum-plugin-upgrade-helper
 %defattr(-, root, root)
 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf


More information about the Yum-commits mailing list