Gentoo Archives: gentoo-commits

From: "Andrew Gaffney (agaffney)" <agaffney@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gli r1886 - in trunk: . src src/fe/dialog
Date: Thu, 28 Feb 2008 03:19:02
Message-Id: E1JUZIR-0008EO-3a@stork.gentoo.org
1 Author: agaffney
2 Date: 2008-02-28 03:18:58 +0000 (Thu, 28 Feb 2008)
3 New Revision: 1886
4
5 Modified:
6 trunk/ChangeLog
7 trunk/src/GLIArchitectureTemplate.py
8 trunk/src/GLIPortage.py
9 trunk/src/fe/dialog/gli-dialog.py
10 Log:
11 Switch to running vdb_to_fake_binrepo.py instead of reading systempkgs.txt
12 remove all references to systempkgs.txt
13
14 Modified: trunk/ChangeLog
15 ===================================================================
16 --- trunk/ChangeLog 2008-02-28 02:54:42 UTC (rev 1885)
17 +++ trunk/ChangeLog 2008-02-28 03:18:58 UTC (rev 1886)
18 @@ -2,6 +2,12 @@
19 # Copyright 2005-2008 Gentoo Foundation; Distributed under the GPL v2
20 # $Id: $
21
22 + 28 Feb 2008; Andrew Gaffney <agaffney@g.o>
23 + src/GLIArchitectureTemplate.py, src/GLIPortage.py,
24 + src/fe/dialog/gli-dialog.py:
25 + Switch to running vdb_to_fake_binrepo.py instead of reading systempkgs.txt
26 + remove all references to systempkgs.txt
27 +
28 28 Feb 2008; Andrew Gaffney <agaffney@g.o> -src/runtimedeps.py,
29 +src/vdb_to_fake_binrepo.py:
30 Add vdb_to_fake_binrepo.py script from the always awesome zmedico
31
32 Modified: trunk/src/GLIArchitectureTemplate.py
33 ===================================================================
34 --- trunk/src/GLIArchitectureTemplate.py 2008-02-28 02:54:42 UTC (rev 1885)
35 +++ trunk/src/GLIArchitectureTemplate.py 2008-02-28 03:18:58 UTC (rev 1886)
36 @@ -395,14 +395,10 @@
37 os.makedirs(self._chroot_dir)
38 if self._install_profile.get_install_stage() == 3 and self._install_profile.get_dynamic_stage3():
39 # stage3 generation code here
40 - if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"):
41 - raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Required file /usr/livecd/systempkgs.txt does not exist")
42 try:
43 - syspkgs = open("/usr/livecd/systempkgs.txt", "r")
44 - systempkgs = [line for line in syspkgs.readlines() if line.strip()]
45 - syspkgs.close()
46 + systempkgs = self._portage.get_system_packages()
47 except:
48 - raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Could not open /usr/livecd/systempkgs.txt")
49 + raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Could not generate list of system packages")
50
51 # Pre-create /lib (and possibly /lib32 and /lib64)
52 for libdir in ("/lib", "/usr/lib"):
53
54 Modified: trunk/src/GLIPortage.py
55 ===================================================================
56 --- trunk/src/GLIPortage.py 2008-02-28 02:54:42 UTC (rev 1885)
57 +++ trunk/src/GLIPortage.py 2008-02-28 03:18:58 UTC (rev 1886)
58 @@ -310,7 +310,21 @@
59 for package in packages:
60 self.add_pkg_to_world(package)
61
62 + def create_binpkg_repo_from_vdb(self):
63 + if not os.path.exists("/tmp/fake_binpkg"):
64 + try:
65 + os.mkdir("/tmp/fake_binpkg")
66 + except:
67 + raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Could not not create /tmp/fake_binpkg!")
68 + status = GLIUtility.spawn("PKGDIR=/tmp/fake_binpkg ../../vdb_to_fake_binrepo.py", logfile=self._compile_logfile, append_log=True)
69 + if not GLIUtility.exitsuccess(status):
70 + raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Failure while running vdb_to_fake_binrepo.py")
71
72 + def get_system_packages(self):
73 + self.create_binpkg_repo_from_vdb()
74 + 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")
75 + return systempkgs
76 +
77 def usage(progname):
78 print """
79 Usage: %s [-c|--chroot-dir <chroot directory>] [-g|--grp] [-s|--stage3] [-h|--help]
80 @@ -357,15 +371,10 @@
81
82 gliportage = GLIPortage(chroot_dir, True, None, False, None, None)
83 if mode == "stage3":
84 - if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"):
85 - print "Required file /usr/livecd/systempkgs.txt does not exist!"
86 - sys.exit(1)
87 try:
88 - syspkgs = open("/usr/livecd/systempkgs.txt", "r")
89 - systempkgs = syspkgs.readlines()
90 - syspkgs.close()
91 + systempkgs = gliportage.get_system_packages()
92 except:
93 - print "Could not open /usr/livecd/systempkgs.txt!"
94 + print "Could not open generate list of system packages!"
95 sys.exit(1)
96
97 # Pre-create /lib (and possible /lib32 and /lib64)
98
99 Modified: trunk/src/fe/dialog/gli-dialog.py
100 ===================================================================
101 --- trunk/src/fe/dialog/gli-dialog.py 2008-02-28 02:54:42 UTC (rev 1885)
102 +++ trunk/src/fe/dialog/gli-dialog.py 2008-02-28 03:18:58 UTC (rev 1886)
103 @@ -676,8 +676,7 @@
104 self._install_profile.set_install_stage(None, install_stage, None)
105 except:
106 self._d.msgbox(_(u"ERROR! Could not set install stage!"))
107 - has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt")
108 - if install_stage == "3" and has_systempkgs:
109 + if install_stage == "3":
110 #Change the Yes/No buttons to new labels for this question.
111 self._d.add_persistent_args(["--yes-label", _(u"Create from CD")])
112 self._d.add_persistent_args(["--no-label", _(u"Specify URI")])
113
114 --
115 gentoo-commits@l.g.o mailing list