Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13745 - in main/trunk: man pym/_emerge
Date: Tue, 30 Jun 2009 21:33:44
Message-Id: E1MLkxT-0005ps-1Z@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-06-30 21:33:42 +0000 (Tue, 30 Jun 2009)
3 New Revision: 13745
4
5 Modified:
6 main/trunk/man/emerge.1
7 main/trunk/pym/_emerge/depgraph.py
8 main/trunk/pym/_emerge/help.py
9 main/trunk/pym/_emerge/main.py
10 Log:
11 Bug #275945 - Add a new --avoid-update which tries to avoid updating packages
12 which possible. Thanks to Sebastian Mingramm (few) <s.mingramm@×××.de> for
13 this patch.
14
15
16 Modified: main/trunk/man/emerge.1
17 ===================================================================
18 --- main/trunk/man/emerge.1 2009-06-30 09:24:08 UTC (rev 13744)
19 +++ main/trunk/man/emerge.1 2009-06-30 21:33:42 UTC (rev 13745)
20 @@ -90,6 +90,15 @@
21 to the \fBworld\fR file at the end, so that they are considered for
22 later updating.
23 .TP
24 +.BR "\-\-avoid\-update "
25 +Tries to prevent package updates. This may not always be
26 +possible since new packages or new dependencies due to USE
27 +flag changes may require a newer version of an installed
28 +package. Furthermore, this option may lead to slot conflicts
29 +(Multiple package instances within a single package slot
30 +have been pulled into the dependency graph). It is not
31 +possible to use this option in such a case.
32 +.TP
33 .BR "\-\-clean " (\fB\-c\fR)
34 Cleans up the system by examining the installed packages and removing older
35 packages. This is accomplished by looking at each installed package and separating
36 @@ -364,6 +373,9 @@
37
38 USE flags may be toggled by your profile as well as your USE and package.use
39 settings.
40 +
41 +\fB\-\-avoid\-update\fR may prevent updates of installed packages without
42 +use flag changes. Note that \fB\-\-avoid-\update\fR may lead to slot conflicts.
43 .TP
44 .BR "\-\-noconfmem"
45 Causes portage to disregard merge records indicating that a config file
46
47 Modified: main/trunk/pym/_emerge/depgraph.py
48 ===================================================================
49 --- main/trunk/pym/_emerge/depgraph.py 2009-06-30 09:24:08 UTC (rev 13744)
50 +++ main/trunk/pym/_emerge/depgraph.py 2009-06-30 21:33:42 UTC (rev 13745)
51 @@ -2091,6 +2091,11 @@
52 break
53
54 if len(matched_packages) > 1:
55 + if "--avoid-update" in self.myopts:
56 + for pkg in matched_packages:
57 + if pkg.installed:
58 + return pkg, existing_node
59 +
60 bestmatch = portage.best(
61 [pkg.cpv for pkg in matched_packages])
62 matched_packages = [pkg for pkg in matched_packages \
63
64 Modified: main/trunk/pym/_emerge/help.py
65 ===================================================================
66 --- main/trunk/pym/_emerge/help.py 2009-06-30 09:24:08 UTC (rev 13744)
67 +++ main/trunk/pym/_emerge/help.py 2009-06-30 21:33:42 UTC (rev 13745)
68 @@ -235,6 +235,17 @@
69 print " to the prompt, so an accidental press of the \"Enter\" key at any"
70 print " time prior to the prompt will be interpreted as a choice!"
71 print
72 + print " "+green("--avoid-update")
73 + desc = "Tries to prevent package updates. This may not always be" + \
74 + " possible since new packages or new dependencies due to USE" + \
75 + " flag changes may require a newer version of an installed" + \
76 + " package. Furthermore, this option may lead to slot conflicts" + \
77 + " (Multiple package instances within a single package slot" + \
78 + " have been pulled into the dependency graph). It is not" + \
79 + " possible to use this option in such a case."
80 + for line in wrap(desc, desc_width):
81 + print desc_indent + line
82 + print
83 print " "+green("--buildpkg")+" ("+green("-b")+" short option)"
84 desc = "Tells emerge to build binary packages for all ebuilds processed in" + \
85 " addition to actually merging the packages. Useful for maintainers" + \
86
87 Modified: main/trunk/pym/_emerge/main.py
88 ===================================================================
89 --- main/trunk/pym/_emerge/main.py 2009-06-30 09:24:08 UTC (rev 13744)
90 +++ main/trunk/pym/_emerge/main.py 2009-06-30 21:33:42 UTC (rev 13745)
91 @@ -65,6 +65,7 @@
92 "--searchdesc", "--selective",
93 "--skipfirst",
94 "--tree",
95 +"--avoid-update",
96 "--update",
97 "--usepkg", "--usepkgonly",
98 "--verbose",
99 @@ -1060,6 +1061,11 @@
100 noiselevel=-1)
101 return 1
102
103 + if "--avoid-update" in myopts and "--update" in myopts:
104 + writemsg("!!! conflicting options given: " + \
105 + "--update and --avoid-update\n", noiselevel=-1)
106 + return 1
107 +
108 if settings.get("PORTAGE_DEBUG", "") == "1":
109 spinner.update = spinner.update_quiet
110 portage.debug=1