Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11303 - in main/trunk/pym: _emerge portage
Date: Fri, 01 Aug 2008 00:47:27
Message-Id: E1KOink-0005HX-Ry@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-08-01 00:47:23 +0000 (Fri, 01 Aug 2008)
3 New Revision: 11303
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 main/trunk/pym/portage/__init__.py
8 Log:
9 Bug #233487 - Fix --fetch-all-uri breakage:
10
11 * Make --fetch-all-uri imply --fetchonly so that all the --fetchonly
12 conditionals apply to --fetch-all-uri as well.
13
14 * Add an EbuildFetcher.fetchall attribute, and also add the required
15 support to portage.doebuild() for a "fetchall" phase that EbuildFetcher
16 can invoke in the background via the ebuild(1) command.
17
18
19 Modified: main/trunk/pym/_emerge/__init__.py
20 ===================================================================
21 --- main/trunk/pym/_emerge/__init__.py 2008-07-31 13:30:22 UTC (rev 11302)
22 +++ main/trunk/pym/_emerge/__init__.py 2008-08-01 00:47:23 UTC (rev 11303)
23 @@ -2227,7 +2227,7 @@
24
25 class EbuildFetcher(SpawnProcess):
26
27 - __slots__ = ("fetchonly", "pkg",)
28 + __slots__ = ("fetchonly", "fetchall", "pkg",)
29
30 def _start(self):
31
32 @@ -2235,6 +2235,9 @@
33 portdb = root_config.trees["porttree"].dbapi
34 ebuild_path = portdb.findname(self.pkg.cpv)
35 settings = root_config.settings
36 + phase = "fetch"
37 + if self.fetchall:
38 + phase = "fetchall"
39
40 fetch_env = dict(settings.iteritems())
41 fetch_env["PORTAGE_NICENESS"] = "0"
42 @@ -2244,7 +2247,7 @@
43 ebuild_binary = os.path.join(
44 settings["PORTAGE_BIN_PATH"], "ebuild")
45
46 - fetch_args = [ebuild_binary, ebuild_path, "fetch"]
47 + fetch_args = [ebuild_binary, ebuild_path, phase]
48 debug = settings.get("PORTAGE_DEBUG") == "1"
49 if debug:
50 fetch_args.append("--debug")
51 @@ -2396,7 +2399,8 @@
52 if self.background:
53 fetch_log = self.scheduler.fetch.log_file
54
55 - fetcher = EbuildFetcher(fetchonly=opts.fetchonly,
56 + fetcher = EbuildFetcher(fetchall=opts.fetch_all_uri,
57 + fetchonly=opts.fetchonly,
58 background=self.background, logfile=fetch_log,
59 pkg=pkg, scheduler=self.scheduler)
60
61 @@ -13399,6 +13403,9 @@
62 "--usepkg", "--usepkgonly"):
63 myopts.pop(opt, None)
64
65 + if "--fetch-all-uri" in myopts:
66 + myopts["--fetchonly"] = True
67 +
68 if "--skipfirst" in myopts and "--resume" not in myopts:
69 myopts["--resume"] = True
70
71
72 Modified: main/trunk/pym/portage/__init__.py
73 ===================================================================
74 --- main/trunk/pym/portage/__init__.py 2008-07-31 13:30:22 UTC (rev 11302)
75 +++ main/trunk/pym/portage/__init__.py 2008-08-01 00:47:23 UTC (rev 11303)
76 @@ -5061,7 +5061,8 @@
77
78 clean_phases = ("clean", "cleanrm")
79 validcommands = ["help","clean","prerm","postrm","cleanrm","preinst","postinst",
80 - "config","info","setup","depend","fetch","digest",
81 + "config", "info", "setup", "depend",
82 + "fetch", "fetchall", "digest",
83 "unpack","compile","test","install","rpm","qmerge","merge",
84 "package","unmerge", "manifest"]
85
86 @@ -5076,6 +5077,10 @@
87 writemsg("\n", noiselevel=-1)
88 return 1
89
90 + if mydo == "fetchall":
91 + fetchall = 1
92 + mydo = "fetch"
93 +
94 if mydo not in clean_phases and not os.path.exists(myebuild):
95 writemsg("!!! doebuild: %s not found for %s\n" % (myebuild, mydo),
96 noiselevel=-1)