]> git.pld-linux.org Git - packages/yum-utils.git/commitdiff
- based on yum-plugins/kernel-module.py
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 26 Apr 2008 02:06:32 +0000 (02:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    yum-plugin-pld-kernel.py -> 1.1

yum-plugin-pld-kernel.py [new file with mode: 0644]

diff --git a/yum-plugin-pld-kernel.py b/yum-plugin-pld-kernel.py
new file mode 100644 (file)
index 0000000..55b48e0
--- /dev/null
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# vim: set fileencoding=utf-8
+#
+# Yum Kernel Module Support for PLD Linux
+# Plugin for handling setting kernel packages as installonlypkgs in transaction
+#
+# 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.
+#
+# by Elan Ruusamäe <glen@pld-linux.org>
+
+from yum.plugins import PluginYumExit
+from yum.misc import unique
+from yum.packages import YumInstalledPackage
+from yum.plugins import TYPE_CORE
+from yum.constants import TS_INSTALL
+
+requires_api_version = '2.1'
+plugin_type = (TYPE_CORE,)
+
+knames = ['kernel', 'kernel-smp', 'kernel-grsecurity', 'kernel-grsecurity-smp', 'kernel-desktop', 'kernel-laptop', 'kernel-vanilla']
+ksubpkgs = ['drm', 'pcmcia' 'sound-oss', 'sound-alsa']
+
+def preresolve_hook(conduit):
+    ts = conduit.getTsInfo()
+
+    for te in ts.getMembers():
+        if te.ts_state != 'u':
+            continue
+
+        pkgname = te.name
+        if pkgname in knames:
+            conduit.info(2, 'Marking package %s for installation' % pkgname)
+            te.ts_state = 'i'
+            te.output_state = TS_INSTALL
+            continue
+
+        for kname in knames:
+            if pkgname.startswith(kname + '-'):
+                r = pkgname[len(kname) + 1:]
+                if r in ksubpkgs:
+                    conduit.info(2, 'Marking package %s for installation' % pkgname)
+                    te.ts_state = 'i'
+                    te.output_state = TS_INSTALL
+
+# vim:ts=4:sw=4:expandtab
This page took 0.059062 seconds and 4 git commands to generate.