/[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 1882 Revision 1886
308 self._cc.addNotification("progress", (float(i+1) / len(pkglist), "Done emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")")) 308 self._cc.addNotification("progress", (float(i+1) / len(pkglist), "Done emerging " + pkg + " (" + str(i+1) + "/" + str(len(pkglist)) + ")"))
309 if add_to_world: 309 if add_to_world:
310 for package in packages: 310 for package in packages:
311 self.add_pkg_to_world(package) 311 self.add_pkg_to_world(package)
312 312
313 def create_binpkg_repo_from_vdb(self):
314 if not os.path.exists("/tmp/fake_binpkg"):
315 try:
316 os.mkdir("/tmp/fake_binpkg")
317 except:
318 raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Could not not create /tmp/fake_binpkg!")
319 status = GLIUtility.spawn("PKGDIR=/tmp/fake_binpkg ../../vdb_to_fake_binrepo.py", logfile=self._compile_logfile, append_log=True)
320 if not GLIUtility.exitsuccess(status):
321 raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Failure while running vdb_to_fake_binrepo.py")
322
323 def get_system_packages(self):
324 self.create_binpkg_repo_from_vdb()
325 systempkgs = GLIUtility.spawn(r"PKGDIR=/tmp/fake_binpkg emerge -eqKp system | grep -e '^\[binary' | sed -e 's:^\[binary .\+\] ::' -e 's: .\+$::'", return_output=True)[1].strip().split("\n")
326 return systempkgs
313 327
314def usage(progname): 328def usage(progname):
315 print """ 329 print """
316Usage: %s [-c|--chroot-dir <chroot directory>] [-g|--grp] [-s|--stage3] [-h|--help] 330Usage: %s [-c|--chroot-dir <chroot directory>] [-g|--grp] [-s|--stage3] [-h|--help]
317 331
355 else: 369 else:
356 grp_packages.append(arg) 370 grp_packages.append(arg)
357 371
358 gliportage = GLIPortage(chroot_dir, True, None, False, None, None) 372 gliportage = GLIPortage(chroot_dir, True, None, False, None, None)
359 if mode == "stage3": 373 if mode == "stage3":
360 if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"):
361 print "Required file /usr/livecd/systempkgs.txt does not exist!"
362 sys.exit(1)
363 try: 374 try:
364 syspkgs = open("/usr/livecd/systempkgs.txt", "r") 375 systempkgs = gliportage.get_system_packages()
365 systempkgs = syspkgs.readlines()
366 syspkgs.close()
367 except: 376 except:
368 print "Could not open /usr/livecd/systempkgs.txt!" 377 print "Could not open generate list of system packages!"
369 sys.exit(1) 378 sys.exit(1)
370 379
371 # Pre-create /lib (and possible /lib32 and /lib64) 380 # Pre-create /lib (and possible /lib32 and /lib64)
372 if os.path.islink("/lib") and os.readlink("/lib") == "lib64": 381 if os.path.islink("/lib") and os.readlink("/lib") == "lib64":
373 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir " + chroot_dir + "/lib64 && ln -s lib64 " + chroot_dir + "/lib")): 382 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir " + chroot_dir + "/lib64 && ln -s lib64 " + chroot_dir + "/lib")):

Legend:
Removed from v.1882  
changed lines
  Added in v.1886

  ViewVC Help
Powered by ViewVC 1.1.20