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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1757 - (show annotations) (download) (as text)
Tue Mar 6 15:25:27 2007 UTC (7 years, 4 months ago) by agaffney
File MIME type: text/x-python
File size: 20857 byte(s)
add code for updating COUNTER properly for livecd-kernel and GRP
1 """
2 # Copyright 1999-2005 Gentoo Foundation
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
5 # of which can be found in the main directory of this project.
6 Gentoo Linux Installer
7
8 $Id: GLIPortage.py,v 1.57 2006/09/13 18:29:13 agaffney Exp $
9 """
10
11 import re
12 import os
13 import sys
14 import GLIUtility
15 from GLIException import GLIException
16
17 class GLIPortage(object):
18
19 def __init__(self, chroot_dir, logger, debug, cc, compile_logfile):
20 self._chroot_dir = chroot_dir
21 self._logger = logger
22 self._debug = debug
23 self._cc = cc
24 self._compile_logfile = compile_logfile
25
26 def get_deps(self, pkgs, grp_install=False):
27 pkglist = []
28 if isinstance(pkgs, str):
29 pkgs = pkgs.split()
30 for pkg in pkgs:
31 if not pkg: continue
32 if self._debug: self._logger.log("get_deps(): pkg is " + pkg)
33 if not grp_install or not self.get_best_version_vdb(pkg):
34 if self._debug: self._logger.log("get_deps(): grabbing compile deps")
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")
36 else:
37 if self._debug: self._logger.log("get_deps(): grabbing binary deps")
38 # The runtimedeps.py script generates a package install order that is *very* different from emerge itself
39 # tmppkglist = GLIUtility.spawn("python ../../runtimedeps.py " + self._chroot_dir + " " + pkg, return_output=True)[1].strip().split("\n")
40 tmppkglist = []
41 for tmppkg in 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"):
42 if self._debug: self._logger.log("get_deps(): looking at " + tmppkg)
43 if self.get_best_version_vdb("=" + tmppkg):
44 if self._debug: self._logger.log("get_deps(): package " + tmppkg + " in host vdb...adding to tmppkglist")
45 tmppkglist.append(tmppkg)
46 if self._debug: self._logger.log("get_deps(): deplist for " + pkg + ": " + str(tmppkglist))
47 for tmppkg in tmppkglist:
48 if self._debug: self._logger.log("get_deps(): checking to see if " + tmppkg + " is already in pkglist")
49 if not tmppkg in pkglist and not self.get_best_version_vdb_chroot("=" + tmppkg):
50 if self._debug: self._logger.log("get_deps(): adding " + tmppkg + " to pkglist")
51 pkglist.append(tmppkg)
52 if self._debug: self._logger.log("get_deps(): pkglist is " + str(pkglist))
53 if not pkglist:
54 raise GLIException("GetDepListError", 'fatal', 'get_deps', "Dep list is empty. This usually means there is no portage tree in the chroot")
55 return pkglist
56
57 def parse_vdb_contents(self, file):
58 entries = []
59 try:
60 vdbfile = open(file, "r")
61 except:
62 return entries
63 for line in vdbfile.readlines():
64 parts = line.strip().split(" ")
65 if parts[0] == "obj":
66 entries.append(parts[1])
67 # elif parts[0] == "dir":
68 # entries.append(parts[1] + "/")
69 elif parts[0] == "sym":
70 entries.append(" ".join(parts[1:4]))
71 entries.sort()
72 return entries
73
74 def update_counter(self):
75 try:
76 counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "r")
77 counter = int(counter_f.readline().strip())
78 counter_f.close()
79 except:
80 counter = 0
81 counter += 1
82 counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "w")
83 counter_f.write(str(counter))
84 counter_f.close()
85 return counter
86
87 def copy_pkg_to_chroot(self, package, use_root=False, ignore_missing=False):
88 symlinks = { '/bin': '/mnt/livecd/bin/', '/boot': '/mnt/livecd/boot/', '/lib': '/mnt/livecd/lib/',
89 '/opt': '/mnt/livecd/opt/', '/sbin': '/mnt/livecd/sbin/', '/usr': '/mnt/livecd/usr/',
90 '/etc/gconf': '/usr/livecd/gconf/' }
91
92 tmpdir = "/var/tmp"
93 image_dir = tmpdir + "/portage/" + package.split("/")[1] + "/image"
94 root_cmd = ""
95 tmp_chroot_dir = self._chroot_dir
96 portage_tmpdir = "/var/tmp"
97 vdb_dir = "/var/db/pkg/"
98 if use_root:
99 root_cmd = "ROOT=" + self._chroot_dir
100 tmp_chroot_dir = ""
101 portage_tmpdir = self._chroot_dir + "/var/tmp"
102 vdb_dir = self._chroot_dir + "/var/db/pkg/"
103
104 # Create /tmp, /var/tmp, and /var/lib/portage with proper permissions
105 oldumask = os.umask(0)
106 if not os.path.exists(self._chroot_dir + "/tmp"):
107 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): /tmp doesn't exist in chroot...creating with proper permissions")
108 try:
109 os.mkdir(self._chroot_dir + "/tmp", 01777)
110 except:
111 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Failed to create /tmp in chroot")
112 if not os.path.exists(self._chroot_dir + "/var/tmp"):
113 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): /var/tmp doesn't exist in chroot...creating with proper permissions")
114 try:
115 os.mkdir(self._chroot_dir + "/var", 0755)
116 except:
117 pass
118 try:
119 os.mkdir(self._chroot_dir + "/var/tmp", 01777)
120 except:
121 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Failed to create /var/tmp in chroot")
122 if not os.path.exists(self._chroot_dir + "/var/lib/portage"):
123 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): /var/lib/portage doesn't exist in chroot...creating with proper permissions")
124 try:
125 os.mkdir(self._chroot_dir + "/var/lib", 0755)
126 except:
127 pass
128 try:
129 os.mkdir(self._chroot_dir + "/var/lib/portage", 02750)
130 except:
131 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Failed to create /var/lib/portage in chroot")
132 os.umask(oldumask)
133
134 # Check to see if package is actually in vdb
135 if not GLIUtility.is_file("/var/db/pkg/" + package):
136 if ignore_missing:
137 if self._debug:
138 self._logger.log("DEBUG: copy_pkg_to_chroot(): package " + package + " does not have a vdb entry but ignore_missing=True...ignoring error")
139 return
140 else:
141 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "There is no vdb entry for " + package)
142
143 # Copy the vdb entry for the package from the LiveCD to the chroot
144 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying vdb entry for " + package)
145 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + "/var/db/pkg/" + package + " && cp -a /var/db/pkg/" + package + "/* " + self._chroot_dir + "/var/db/pkg/" + package, logfile=self._compile_logfile, append_log=True)):
146 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy vdb entry for " + package)
147
148 # Update COUNTER
149 try:
150 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): calling update_counter() to get updated COUNTER value for " + package)
151 counter = self.update_counter()
152 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): updating COUNTER value in vdb entry for " + package)
153 counter_f = open(self._chroot_dir + "/var/db/pkg/" + package + "/COUNTER", "w")
154 counter_f.write(str(counter))
155 counter_f.close()
156 except:
157 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not update COUNTER for " + package)
158
159 # Create the image dir in the chroot
160 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'mkdir -p " + self._chroot_dir + image_dir + "'")
161 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + image_dir, logfile=self._compile_logfile, append_log=True)):
162 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not create image dir for " + package)
163
164 # Create list of files for tar to work with from CONTENTS file in vdb entry
165 entries = self.parse_vdb_contents("/var/db/pkg/" + package + "/CONTENTS")
166 if not entries:
167 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): no files for " + package + "...skipping tar and symlink fixup")
168 else:
169 # if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot: files for " + package + ": " + str(entries))
170 try:
171 tarfiles = open("/tmp/tarfilelist", "w")
172 for entry in entries:
173 parts = entry.split(" ")
174 # # Hack for symlink crappiness
175 # for symlink in symlinks:
176 # if parts[0].startswith(symlink):
177 # parts[0] = symlinks[symlink] + parts[0][len(symlink):]
178 tarfiles.write(parts[0] + "\n")
179 tarfiles.close()
180 except:
181 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not create filelist for " + package)
182
183 # Use tar to transfer files into IMAGE directory
184 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp'")
185 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp", logfile=self._compile_logfile, append_log=True)):
186 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute tar for " + package)
187
188 # Fix mode, uid, and gid of directories
189 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running find " + self._chroot_dir + image_dir + " -mindepth 1 -type d 2>/dev/null | sed -e 's:^" + self._chroot_dir + image_dir + "::' | grep -v '^$'")
190 dirlist = GLIUtility.spawn("find " + self._chroot_dir + image_dir + " -mindepth 1 -type d 2>/dev/null | sed -e 's:^" + self._chroot_dir + image_dir + "::' | grep -v '^$'", return_output=True)[1].strip().split("\n")
191 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): found the following directories: " + str(dirlist))
192 if not dirlist or dirlist[0] == "":
193 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "directory list entry for " + package + "...this shouldn't happen!")
194 for dir in dirlist:
195 dirstat = os.stat(dir)
196 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): setting mode " + str(dirstat[0]) + " and uid/gid " + str(dirstat[4]) + "/" + str(dirstat[5]) + " for directory " + self._chroot_dir + image_dir + dir)
197 os.chown(self._chroot_dir + image_dir + dir, dirstat[4], dirstat[5])
198 os.chmod(self._chroot_dir + image_dir + dir, dirstat[0])
199
200 # # More symlink crappiness hacks
201 # for symlink in symlinks:
202 ## if GLIUtility.is_file(self._chroot_dir + image_dir + symlinks[symlink]):
203 # if os.path.islink(self._chroot_dir + image_dir + symlink):
204 # if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): fixing " + symlink + " symlink ickiness stuff in " + image_dir + " for " + package)
205 # GLIUtility.spawn("rm " + self._chroot_dir + image_dir + symlink)
206 # if not GLIUtility.exitsuccess(GLIUtility.spawn("mv " + self._chroot_dir + image_dir + symlinks[symlink] + " " + self._chroot_dir + image_dir + symlink)):
207 # raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not fix " + symlink + " symlink ickiness for " + package)
208
209 # Run pkg_setup
210 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running pkg_setup for " + package)
211 if not GLIUtility.exitsuccess(GLIUtility.spawn("env " + root_cmd + " PORTAGE_TMPDIR=" + portage_tmpdir + " FEATURES=noauto ebuild " + vdb_dir + package + "/*.ebuild setup", chroot=tmp_chroot_dir, logfile=self._compile_logfile, append_log=True)):
212 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute pkg_setup for " + package)
213
214 # Run pkg_preinst
215 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running preinst for " + package)
216 if not GLIUtility.exitsuccess(GLIUtility.spawn("env " + root_cmd + " PORTAGE_TMPDIR=" + portage_tmpdir + " FEATURES=noauto ebuild " + vdb_dir + package + "/*.ebuild preinst", chroot=tmp_chroot_dir, logfile=self._compile_logfile, append_log=True)):
217 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute preinst for " + package)
218
219 # Copy files from image_dir to chroot
220 if not entries:
221 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): no files for " + package + "...skipping copy from image dir to /")
222 else:
223 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying files from " + image_dir + " to / for " + package)
224 # if not GLIUtility.exitsuccess(GLIUtility.spawn("cp -a " + self._chroot_dir + image_dir + "/* " + self._chroot_dir)):
225 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -C " + self._chroot_dir + image_dir + "/ -cp . | tar -C " + self._chroot_dir + "/ -xp", logfile=self._compile_logfile, append_log=True)):
226 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy files from " + image_dir + " to / for " + package)
227
228 # Run pkg_postinst
229 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running postinst for " + package)
230 if not GLIUtility.exitsuccess(GLIUtility.spawn("env " + root_cmd + " PORTAGE_TMPDIR=" + portage_tmpdir + " FEATURES=noauto ebuild " + vdb_dir + package + "/*.ebuild postinst", chroot=tmp_chroot_dir, logfile=self._compile_logfile, append_log=True)):
231 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute postinst for " + package)
232
233 # Remove image_dir
234 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): removing " + image_dir + " for " + package)
235 if not GLIUtility.exitsuccess(GLIUtility.spawn("rm -rf " + self._chroot_dir + image_dir, logfile=self._compile_logfile, append_log=True)):
236 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not remove + " + image_dir + " for " + package)
237
238 # Run env-update
239 if not use_root:
240 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running env-update inside chroot")
241 if not GLIUtility.exitsuccess(GLIUtility.spawn("env-update", chroot=self._chroot_dir, logfile=self._compile_logfile, append_log=True)):
242 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not run env-update for " + package)
243
244 def add_pkg_to_world(self, package):
245 if package.find("/") == -1:
246 package = self.get_best_version_vdb_chroot(package)
247 if not package: return False
248 expr = re.compile('^=?(.+?/.+?)(-\d.+)?$')
249 res = expr.match(package)
250 if res:
251 GLIUtility.spawn("echo " + res.group(1) + " >> " + self._chroot_dir + "/var/lib/portage/world")
252
253 def get_best_version_vdb(self, package):
254 if package.startswith('='):
255 package = package[1:]
256 if GLIUtility.is_file("/var/db/pkg/" + package):
257 return package
258 else:
259 return ""
260 else:
261 return GLIUtility.spawn("portageq best_version / " + package, return_output=True)[1].strip()
262
263 def get_best_version_vdb_chroot(self, package):
264 if package.startswith('='):
265 package = package[1:]
266 if GLIUtility.is_file(self._chroot_dir + "/var/db/pkg/" + package):
267 return package
268 else:
269 return ""
270 else:
271 return GLIUtility.spawn("portageq best_version / " + package, chroot=self._chroot_dir, return_output=True)[1].strip()
272
273 # def get_best_version_tree(self, package):
274 # return portage.best(tree.match(package))
275
276 def emerge(self, packages, grp_install=False, add_to_world=True):
277 if isinstance(packages, str):
278 packages = packages.split()
279 self._cc.addNotification("progress", (0, "Calculating dependencies for " + " ".join(packages)))
280 pkglist = self.get_deps(packages, grp_install)
281 if self._debug: self._logger.log("install_packages(): pkglist is " + str(pkglist))
282 for i, pkg in enumerate(pkglist):
283 if not pkg: continue
284 if self._debug: self._logger.log("install_packages(): processing package " + pkg)
285 self._cc.addNotification("progress", (float(i) / len(pkglist), "Emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")"))
286 if not grp_install or not self.get_best_version_vdb("=" + pkg):
287 status = GLIUtility.spawn("emerge -1 =" + pkg, display_on_tty8=True, chroot=self._chroot_dir, logfile=self._compile_logfile, append_log=True)
288 # status = self._emerge("=" + pkg)
289 if not GLIUtility.exitsuccess(status):
290 raise GLIException("EmergePackageError", "fatal", "emerge", "Could not emerge " + pkg + "!")
291 else:
292 # try:
293 self.copy_pkg_to_chroot(pkg)
294 # except:
295 # raise GLIException("EmergePackageError", "fatal", "emerge", "Could not emerge " + pkg + "!")
296 self._cc.addNotification("progress", (float(i+1) / len(pkglist), "Done emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")"))
297 if add_to_world:
298 for package in packages:
299 self.add_pkg_to_world(package)
300
301
302 def usage(progname):
303 print """
304 Usage: %s [-c|--chroot-dir <chroot directory>] [-g|--grp] [-s|--stage3] [-h|--help]
305
306 Options:
307
308 -c|--chroot-dir Specifies the directory where your chroot is. This is
309 "/mnt/gentoo" by default.
310
311 -g|--grp Install specified packages and dependencies into chroot
312 by using files from the LiveCD.
313
314 -s|--stage3 Create a stage3 equivelant in the chroot directory by using
315 files from the LiveCD.
316
317 -k|--kernel Install kernel and modules from LiveCD into the chroot
318
319 -h|--help Display this help
320 """ % (progname)
321
322 if __name__ == "__main__":
323 chroot_dir = "/mnt/gentoo"
324 mode = None
325 grp_packages = []
326 progname = sys.argv.pop(0)
327 while len(sys.argv):
328 arg = sys.argv.pop(0)
329 if arg == "-c" or arg == "--chroot-dir":
330 chroot_dir = sys.argv.pop(0)
331 elif arg == "-g" or arg == "--grp":
332 mode = "grp"
333 elif arg == "-s" or arg == "--stage3":
334 mode = "stage3"
335 elif arg == "-k" or arg == "--kernel":
336 mode = "kernel"
337 elif arg == "-h" or arg == "--help":
338 usage(progname)
339 sys.exit(0)
340 elif arg[0] == "-":
341 usage(progname)
342 sys.exit(1)
343 else:
344 grp_packages.append(arg)
345
346 gliportage = GLIPortage(chroot_dir, True, None, False, None, None)
347 if mode == "stage3":
348 if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"):
349 print "Required file /usr/livecd/systempkgs.txt does not exist!"
350 sys.exit(1)
351 try:
352 syspkgs = open("/usr/livecd/systempkgs.txt", "r")
353 systempkgs = syspkgs.readlines()
354 syspkgs.close()
355 except:
356 print "Could not open /usr/livecd/systempkgs.txt!"
357 sys.exit(1)
358
359 # Pre-create /lib (and possible /lib32 and /lib64)
360 if os.path.islink("/lib") and os.readlink("/lib") == "lib64":
361 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir " + chroot_dir + "/lib64 && ln -s lib64 " + chroot_dir + "/lib")):
362 print "Could not precreate /lib64 dir and /lib -> /lib64 symlink"
363 sys.exit(1)
364
365 syspkglen = len(systempkgs)
366 for i, pkg in enumerate(systempkgs):
367 pkg = pkg.strip()
368 print "Copying " + pkg + " (" + str(i+1) + "/" + str(syspkglen) + ")"
369 gliportage.copy_pkg_to_chroot(pkg, True, ignore_missing=True)
370 GLIUtility.spawn("cp /etc/make.conf " + chroot_dir + "/etc/make.conf")
371 GLIUtility.spawn("ln -s `readlink /etc/make.profile` " + chroot_dir + "/etc/make.profile")
372 GLIUtility.spawn("cp -f /etc/inittab.old " + chroot_dir + "/etc/inittab")
373
374 # Nasty, nasty, nasty hack because vapier is a tool
375 for tmpfile in ("/etc/passwd", "/etc/group", "/etc/shadow"):
376 GLIUtility.spawn("grep -ve '^gentoo' " + tmpfile + " > " + chroot_dir + tmpfile)
377
378 chrootscript = r"""
379 #!/bin/bash
380
381 source /etc/make.conf
382 export LDPATH="/usr/lib/gcc-lib/${CHOST}/$(cd /usr/lib/gcc-lib/${CHOST} && ls -1 | head -n 1)"
383
384 ldconfig $LDPATH
385 gcc-config 1
386 env-update
387 source /etc/profile
388 modules-update
389 [ -f /usr/bin/binutils-config ] && binutils-config 1
390 source /etc/profile
391 #mount -t proc none /proc
392 #cd /dev
393 #/sbin/MAKEDEV generic-i386
394 #umount /proc
395 [ -f /lib/udev-state/devices.tar.bz2 ] && tar -C /dev -xjf /lib/udev-state/devices.tar.bz2
396 """
397 script = open(chroot_dir + "/tmp/extrastuff.sh", "w")
398 script.write(chrootscript)
399 script.close()
400 GLIUtility.spawn("chmod 755 /tmp/extrastuff.sh && /tmp/extrastuff.sh", chroot=chroot_dir)
401 GLIUtility.spawn("rm -rf /var/tmp/portage/* /usr/portage /tmp/*", chroot=chroot_dir)
402 print "Stage3 equivelant generation complete!"
403 elif mode == "grp":
404 for pkg in grp_packages:
405 if not gliportage.get_best_version_vdb(pkg):
406 print "Package " + pkg + " is not available for install from the LiveCD"
407 continue
408 pkglist = gliportage.get_deps(pkg, True)
409 for i, tmppkg in enumerate(pkglist):
410 print "Copying " + tmppkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")"
411 gliportage.copy_pkg_to_chroot(tmppkg)
412 gliportage.add_pkg_to_world(pkg)
413 print "GRP install complete!"
414 elif mode == "kernel":
415 kernelpkg = gliportage.get_best_version_vdb("sys-kernel/livecd-kernel")
416 gliportage.copy_pkg_to_chroot(kernelpkg)
417 print "LiveCD kernel installed!"
418 else:
419 print "You must specify an operating mode (-g or -s)!"
420 usage(progname)
421 sys.exit(1)

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20