summaryrefslogtreecommitdiffstats
path: root/meta/packages
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
parentda34e322e9ec0025c7e32fc5715ac7e94aa3f045 (diff)
downloadpoky-7c72bf73b8064da0f98fe83a549ddbb1b82d4dea.tar.gz
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')
-rwxr-xr-xmeta/packages/yum/yum-native/yum-install-recommends.py39
-rw-r--r--meta/packages/yum/yum-native_3.2.18.bb4
2 files changed, 42 insertions, 1 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 0000000000..64716f2c3e
--- /dev/null
+++ b/meta/packages/yum/yum-native/yum-install-recommends.py
@@ -0,0 +1,39 @@
1#!/usr/bin/env python
2import os, sys
3
4root = sys.argv[1]
5installcmd = sys.argv[2]
6
7#
8# Take an rpm image and look through for Recommends:. For each recommends
9# found, try and install any matching packages including any Recommends for
10# packages installed by us.
11#
12
13
14def get_recommends():
15 deps = []
16 output = os.popen("rpm --root %s -aq --recommends" % (root))
17 lines = output.readlines()
18 for line in lines:
19 line = line.replace("(none)","")
20 if line:
21 deps.append(line.split()[0])
22 return deps
23
24processed = []
25
26while True:
27 toinstall = []
28 recommends = set(get_recommends())
29 for item in recommends:
30 if item not in processed:
31 toinstall.append(item)
32 if len(toinstall) != 0:
33 print "Installing %s" % " ".join(toinstall)
34 os.system("%s %s" % (installcmd, " ".join(toinstall)))
35 else:
36 break
37 processed.extend(toinstall)
38
39
diff --git a/meta/packages/yum/yum-native_3.2.18.bb b/meta/packages/yum/yum-native_3.2.18.bb
index 76e92b34a9..60dafe3265 100644
--- a/meta/packages/yum/yum-native_3.2.18.bb
+++ b/meta/packages/yum/yum-native_3.2.18.bb
@@ -3,8 +3,9 @@ HOMEPAGE = "http://linux.duke.edu/projects/yum/"
3SRC_URI = "http://linux.duke.edu/projects/yum/download/3.2/yum-${PV}.tar.gz \ 3SRC_URI = "http://linux.duke.edu/projects/yum/download/3.2/yum-${PV}.tar.gz \
4 file://hacks.patch;patch=1 \ 4 file://hacks.patch;patch=1 \
5 file://paths.patch;patch=1 \ 5 file://paths.patch;patch=1 \
6 file://yum-install-recommends.py \
6 file://extract-postinst.awk" 7 file://extract-postinst.awk"
7PR = "r4" 8PR = "r5"
8 9
9DEPENDS = "rpm-native python-native python-iniparse-native python-urlgrabber-native yum-metadata-parser-native libxml2-native" 10DEPENDS = "rpm-native python-native python-iniparse-native python-urlgrabber-native yum-metadata-parser-native libxml2-native"
10 11
@@ -20,4 +21,5 @@ do_compile_append () {
20do_install_append () { 21do_install_append () {
21 install -d ${STAGING_BINDIR}/ 22 install -d ${STAGING_BINDIR}/
22 install ${WORKDIR}/extract-postinst.awk ${STAGING_BINDIR}/ 23 install ${WORKDIR}/extract-postinst.awk ${STAGING_BINDIR}/
24 install ${WORKDIR}/yum-install-recommends.py ${STAGING_BINDIR}/
23} 25}