| … | |
… | |
| 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. |
| 6 | Gentoo Linux Installer |
6 | Gentoo Linux Installer |
| 7 | |
7 | |
| 8 | $Id: GLIPortage.py,v 1.41 2006/02/11 18:05:24 agaffney Exp $ |
8 | $Id: GLIPortage.py,v 1.42 2006/02/17 17:47:40 agaffney Exp $ |
| 9 | """ |
9 | """ |
| 10 | |
10 | |
| 11 | import re |
11 | import re |
| 12 | import os |
12 | import os |
| 13 | import GLIUtility |
13 | import 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: |
| … | |
… | |
| 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) |