summaryrefslogtreecommitdiff
path: root/meta/packages/yum/yum-native
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-09-08 11:17:17 +0000
committerRichard Purdie <richard@openedhand.com>2008-09-08 11:17:17 +0000
commit7c72bf73b8064da0f98fe83a549ddbb1b82d4dea (patch)
tree40b859ffe969de131570fdd2f78bafef114f9da7 /meta/packages/yum/yum-native
parentda34e322e9ec0025c7e32fc5715ac7e94aa3f045 (diff)
downloadopenembedded-core-7c72bf73b8064da0f98fe83a549ddbb1b82d4dea.tar.gz
openembedded-core-7c72bf73b8064da0f98fe83a549ddbb1b82d4dea.tar.bz2
openembedded-core-7c72bf73b8064da0f98fe83a549ddbb1b82d4dea.tar.xz
openembedded-core-7c72bf73b8064da0f98fe83a549ddbb1b82d4dea.zip
yum: Add yum-install-recommends.py script to handle installing Recommends
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5157 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/yum/yum-native')
-rwxr-xr-xmeta/packages/yum/yum-native/yum-install-recommends.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/packages/yum/yum-native/yum-install-recommends.py b/meta/packages/yum/yum-native/yum-install-recommends.py
new file mode 100755
index 000000000..64716f2c3
--- /dev/null
+++ b/meta/packages/yum/yum-native/yum-install-recommends.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+import os, sys
+
+root = sys.argv[1]
+installcmd = sys.argv[2]
+
+#
+# Take an rpm image and look through for Recommends:. For each recommends
+# found, try and install any matching packages including any Recommends for
+# packages installed by us.
+#
+
+
+def get_recommends():
+ deps = []
+ output = os.popen("rpm --root %s -aq --recommends" % (root))
+ lines = output.readlines()
+ for line in lines:
+ line = line.replace("(none)","")
+ if line:
+ deps.append(line.split()[0])
+ return deps
+
+processed = []
+
+while True:
+ toinstall = []
+ recommends = set(get_recommends())
+ for item in recommends:
+ if item not in processed:
+ toinstall.append(item)
+ if len(toinstall) != 0:
+ print "Installing %s" % " ".join(toinstall)
+ os.system("%s %s" % (installcmd, " ".join(toinstall)))
+ else:
+ break
+ processed.extend(toinstall)
+
+