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

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

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

Revision 1297 Revision 1305
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.40 2006/02/11 17:26:33 agaffney Exp $ 8$Id: GLIPortage.py,v 1.42 2006/02/17 17:47:40 agaffney Exp $
9""" 9"""
10 10
11import re 11import re
12import os 12import os
13import GLIUtility 13import GLIUtility
26 def get_deps(self, pkgs): 26 def get_deps(self, pkgs):
27 pkglist = [] 27 pkglist = []
28 if isinstance(pkgs, str): 28 if isinstance(pkgs, str):
29 pkgs = pkgs.split() 29 pkgs = pkgs.split()
30 for pkg in pkgs: 30 for pkg in pkgs:
31 if not pkg: continue
31 if self._debug: self._logger.log("get_deps(): pkg is " + pkg) 32 if self._debug: self._logger.log("get_deps(): pkg is " + pkg)
32 if not self._grp_install or not self.get_best_version_vdb(pkg): 33 if not self._grp_install or not self.get_best_version_vdb(pkg):
33 if self._debug: self._logger.log("get_deps(): grabbing compile deps") 34 if self._debug: self._logger.log("get_deps(): grabbing compile deps")
34 tmppkglist = GLIUtility.spawn("emerge -p " + pkg + r" 2>/dev/null | grep -e '^\[[a-z]' | cut -d ']' -f2 | sed -e 's:^ ::' -e 's: .\+$::'", chroot=self._chroot_dir, return_output=True)[1].strip().split("\n") 35 tmppkglist = GLIUtility.spawn("emerge -p " + pkg + r" 2>/dev/null | grep -e '^\[[a-z]' | cut -d ']' -f2 | sed -e 's:^ ::' -e 's: .\+$::'", chroot=self._chroot_dir, return_output=True)[1].strip().split("\n")
35 else: 36 else:
167 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not remove + " + image_dir + " for " + package) 168 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not remove + " + image_dir + " for " + package)
168 169
169 # Run env-update 170 # Run env-update
170 if not use_root: 171 if not use_root:
171 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running env-update inside chroot") 172 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running env-update inside chroot")
172 if not GLIUtility.exitstatus(GLIUtility.spawn("env-update", chroot=self._chroot_dir)): 173 if not GLIUtility.exitsuccess(GLIUtility.spawn("env-update", chroot=self._chroot_dir)):
173 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not run env-update for " + package) 174 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not run env-update for " + package)
174 175
175 def add_pkg_to_world(self, package): 176 def add_pkg_to_world(self, package):
176 if package.find("/") == -1: 177 if package.find("/") == -1:
177 package = self.get_best_version_vdb_chroot(package) 178 package = self.get_best_version_vdb_chroot(package)
209 packages = packages.split() 210 packages = packages.split()
210 self._cc.addNotification("progress", (0, "Calculating dependencies for " + " ".join(packages))) 211 self._cc.addNotification("progress", (0, "Calculating dependencies for " + " ".join(packages)))
211 pkglist = self.get_deps(packages) 212 pkglist = self.get_deps(packages)
212 if self._debug: self._logger.log("install_packages(): pkglist is " + str(pkglist)) 213 if self._debug: self._logger.log("install_packages(): pkglist is " + str(pkglist))
213 for i, pkg in enumerate(pkglist): 214 for i, pkg in enumerate(pkglist):
215 if not pkg: continue
214 if self._debug: self._logger.log("install_packages(): processing package " + pkg) 216 if self._debug: self._logger.log("install_packages(): processing package " + pkg)
215 self._cc.addNotification("progress", (float(i) / len(pkglist), "Emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")")) 217 self._cc.addNotification("progress", (float(i) / len(pkglist), "Emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")"))
216 if not self._grp_install or not self.get_best_version_vdb("=" + pkg): 218 if not self._grp_install or not self.get_best_version_vdb("=" + pkg):
217 status = GLIUtility.spawn("emerge -1 =" + pkg, display_on_tty8=True, chroot=self._chroot_dir, logfile=self._compile_logfile, append_log=True) 219 status = GLIUtility.spawn("emerge -1 =" + pkg, display_on_tty8=True, chroot=self._chroot_dir, logfile=self._compile_logfile, append_log=True)
218# status = self._emerge("=" + pkg) 220# status = self._emerge("=" + pkg)

Legend:
Removed from v.1297  
changed lines
  Added in v.1305

  ViewVC Help
Powered by ViewVC 1.1.20