/[gli]/branches/overhaul/src/GLIPortage.py
Gentoo

Diff of /branches/overhaul/src/GLIPortage.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1182 Revision 1183
3# This source code is distributed under the terms of version 2 of the GNU 3# This source code is distributed under the terms of version 2 of the GNU
4# General Public License as published by the Free Software Foundation, a copy 4# General Public License as published by the Free Software Foundation, a copy
5# of which can be found in the main directory of this project. 5# of which can be found in the main directory of this project.
6Gentoo Linux Installer 6Gentoo Linux Installer
7 7
8$Id: GLIPortage.py,v 1.2 2005/12/23 22:32:57 agaffney Exp $ 8$Id: GLIPortage.py,v 1.3 2005/12/23 22:39:29 agaffney Exp $
9""" 9"""
10 10
11import os 11import os
12import re 12import re
13import GLIUtility 13import GLIUtility
54 important_node = node 54 important_node = node
55 return important_node 55 return important_node
56 56
57class GLIPortage(object): 57class GLIPortage(object):
58 58
59 def __init__(self, chroot_dir, logger, debug): 59 def __init__(self, chroot_dir, grp_install, logger, debug):
60 os.environ['ROOT'] = chroot_dir 60 os.environ['ROOT'] = chroot_dir
61 import portage, portage_dep 61 import portage, portage_dep
62 self.vdb = portage.db["/"]["vartree"].dbapi 62 self.vdb = portage.db["/"]["vartree"].dbapi
63 self.tree = portage.db[chroot_dir]["porttree"].dbapi 63 self.tree = portage.db[chroot_dir]["porttree"].dbapi
64 self._chroot_dir = chroot_dir 64 self._chroot_dir = chroot_dir
65 self._logger = logger 65 self._logger = logger
66 self._debug = debug 66 self._debug = debug
67 self._grp_install = grp_install
67 68
68 def resolve_deps(self, dep_list): 69 def resolve_deps(self, dep_list):
69 if dep_list and dep_list[0] == "||": 70 if dep_list and dep_list[0] == "||":
70 for dep in dep_list[1:]: 71 for dep in dep_list[1:]:
71 if isinstance(dep, list): 72 if isinstance(dep, list):
116 for atom in db.cp_all(): 117 for atom in db.cp_all():
117 for pkg in db.match(atom): 118 for pkg in db.match(atom):
118 if graph.has_node(pkg): 119 if graph.has_node(pkg):
119 graph.remove(pkg) 120 graph.remove(pkg)
120 121
121 def get_deps(self, pkgs, grp_install): 122 def get_deps(self, pkgs):
122 if not grp_install: 123 if not self._grp_install:
123 del(os.environ['ROOT']) 124 del(os.environ['ROOT'])
124 return GLIUtility.spawn("emerge -p " + pkgs + r" | grep -e '^\[[a-z]' | cut -d ']' -f2 | sed -e 's:^ ::' -e 's: .\+$::'", chroot=self._chroot_dir, return_output=True)[1].split("\n") 125 return GLIUtility.spawn("emerge -p " + pkgs + r" | grep -e '^\[[a-z]' | cut -d ']' -f2 | sed -e 's:^ ::' -e 's: .\+$::'", chroot=self._chroot_dir, return_output=True)[1].split("\n")
125 os.environ['ROOT'] = self._chroot_dir 126 os.environ['ROOT'] = self._chroot_dir
126 else: 127 else:
127 pkglist = [] 128 pkglist = []

Legend:
Removed from v.1182  
changed lines
  Added in v.1183

  ViewVC Help
Powered by ViewVC 1.1.20