Lines 3-8
Link Here
|
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.228 2003/10/13 07:43:38 carpaski Exp $ |
4 |
# $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.228 2003/10/13 07:43:38 carpaski Exp $ |
5 |
|
5 |
|
|
|
6 |
import gettext |
7 |
gettext.install('portage', '/usr/share/locale', unicode=1) |
8 |
|
6 |
import os,sys |
9 |
import os,sys |
7 |
os.environ["PORTAGE_CALLER"]="emerge" |
10 |
os.environ["PORTAGE_CALLER"]="emerge" |
8 |
sys.path += ["/usr/lib/portage/pym"] |
11 |
sys.path += ["/usr/lib/portage/pym"] |
Lines 19-25
Link Here
|
19 |
try: |
22 |
try: |
20 |
os.nice(int(portage.settings["PORTAGE_NICENESS"])) |
23 |
os.nice(int(portage.settings["PORTAGE_NICENESS"])) |
21 |
except Exception,e: |
24 |
except Exception,e: |
22 |
print "!!! Failed to change nice value to '"+str(portage.settings["PORTAGE_NICENESS"])+"'" |
25 |
print _("!!! Failed to change nice value to '")+str(portage.settings["PORTAGE_NICENESS"])+"'" |
23 |
print "!!!",e |
26 |
print "!!!",e |
24 |
|
27 |
|
25 |
#Freeze the portdbapi for enhanced performance: |
28 |
#Freeze the portdbapi for enhanced performance: |
Lines 93-103
Link Here
|
93 |
if shortmapping.has_key(y): |
96 |
if shortmapping.has_key(y): |
94 |
if shortmapping[y] in cmdline: |
97 |
if shortmapping[y] in cmdline: |
95 |
print |
98 |
print |
96 |
print "*** Warning: Redundant use of",shortmapping[y] |
99 |
print _("*** Warning: Redundant use of %s") % shortmapping[y] |
97 |
else: |
100 |
else: |
98 |
cmdline.append(shortmapping[y]) |
101 |
cmdline.append(shortmapping[y]) |
99 |
else: |
102 |
else: |
100 |
print "!!! Error: -"+y+" is an invalid short action or option." |
103 |
print _("!!! Error: -%s is an invalid short action or option.") % y |
101 |
sys.exit(1) |
104 |
sys.exit(1) |
102 |
else: |
105 |
else: |
103 |
cmdline.append(x) |
106 |
cmdline.append(x) |
Lines 112-145
Link Here
|
112 |
elif x[2:] in actions: |
115 |
elif x[2:] in actions: |
113 |
if x[2:]=="rsync": |
116 |
if x[2:]=="rsync": |
114 |
#print |
117 |
#print |
115 |
#print red("*** --rsync has been deprecated.") |
118 |
#print red(_("*** --rsync has been deprecated.")) |
116 |
#print red("*** Please use '--sync' instead.") |
119 |
#print red(_("*** Please use '--sync' instead.")) |
117 |
x="--sync" |
120 |
x="--sync" |
118 |
if myaction: |
121 |
if myaction: |
119 |
if myaction not in ["system", "world"]: |
122 |
if myaction not in ["system", "world"]: |
120 |
myaction="--"+myaction |
123 |
myaction="--"+myaction |
121 |
print |
124 |
print |
122 |
print red("!!!")+green(" Multiple actions requested... Please choose one only.") |
125 |
print red("!!!")+green(_(" Multiple actions requested... Please choose one only.")) |
123 |
print red("!!!")+" '"+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" |
126 |
print red("!!!")+" '"+darkgreen(myaction)+"' "+red(_("or"))+" '"+darkgreen(x)+"'" |
124 |
print |
127 |
print |
125 |
sys.exit(1) |
128 |
sys.exit(1) |
126 |
myaction=x[2:] |
129 |
myaction=x[2:] |
127 |
else: |
130 |
else: |
128 |
print "!!! Error:",x,"is an invalid option." |
131 |
print _("!!! Error: %s is an invalid option.") % x |
129 |
sys.exit(1) |
132 |
sys.exit(1) |
130 |
elif (not myaction) and (x in actions): |
133 |
elif (not myaction) and (x in actions): |
131 |
if x not in ["system", "world"]: |
134 |
if x not in ["system", "world"]: |
132 |
#print red("*** Deprecated use of action '"+x+"'") |
135 |
#print red(_("*** Deprecated use of action '%s'") % x) |
133 |
if x=="rsync": |
136 |
if x=="rsync": |
134 |
#print red("*** Please use '--sync' instead.") |
137 |
#print red(_("*** Please use '--sync' instead.")) |
135 |
x="sync" |
138 |
x="sync" |
136 |
#else: |
139 |
#else: |
137 |
#print red("*** Please use '--"+x+"' instead.") |
140 |
#print red(_("*** Please use '--"+x+"' instead.")) |
138 |
if myaction: |
141 |
if myaction: |
139 |
print |
142 |
print |
140 |
print red("!!!")+green(" Multiple actions requested... Please choose one only.") |
143 |
print red("!!!")+green(_(" Multiple actions requested... Please choose one only.")) |
141 |
#print red("!!! '")+darkgreen("--"+myaction)+"' "+red("or")+" '"+darkgreen("--"+x)+"'" |
144 |
#print red("!!! '")+darkgreen("--"+myaction)+"' "+red(_("or"))+" '"+darkgreen("--"+x)+"'" |
142 |
print red("!!! '")+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" |
145 |
print red("!!! '")+darkgreen(myaction)+"' "+red(_("or"))+" '"+darkgreen(x)+"'" |
143 |
print |
146 |
print |
144 |
sys.exit(1) |
147 |
sys.exit(1) |
145 |
myaction=x |
148 |
myaction=x |
Lines 150-156
Link Here
|
150 |
myfiles.append(x) |
153 |
myfiles.append(x) |
151 |
|
154 |
|
152 |
if (myaction in ["world", "system"]) and myfiles: |
155 |
if (myaction in ["world", "system"]) and myfiles: |
153 |
print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both." |
156 |
print _("emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both.") |
154 |
sys.exit(1) |
157 |
sys.exit(1) |
155 |
|
158 |
|
156 |
# Always create packages if FEATURES=buildpkg |
159 |
# Always create packages if FEATURES=buildpkg |
Lines 178-189
Link Here
|
178 |
|
181 |
|
179 |
# Also allow -U to apply --update/-u |
182 |
# Also allow -U to apply --update/-u |
180 |
if ("--upgradeonly" in myopts) and not ("--update" in myopts): |
183 |
if ("--upgradeonly" in myopts) and not ("--update" in myopts): |
181 |
print ">>> --upgradeonly implies --update... adding --update to options." |
184 |
print _(">>> --upgradeonly implies --update... adding --update to options.") |
182 |
myopts.append("--update") |
185 |
myopts.append("--update") |
183 |
|
186 |
|
184 |
# Also allow -l to apply --pretend/-p |
187 |
# Also allow -l to apply --pretend/-p |
185 |
if ("--changelog" in myopts) and not ("--pretend" in myopts): |
188 |
if ("--changelog" in myopts) and not ("--pretend" in myopts): |
186 |
print ">>> --changelog implies --pretend... adding --pretend to options." |
189 |
print _(">>> --changelog implies --pretend... adding --pretend to options.") |
187 |
myopts.append("--pretend") |
190 |
myopts.append("--pretend") |
188 |
|
191 |
|
189 |
# Set so that configs will be merged regardless of remembered status |
192 |
# Set so that configs will be merged regardless of remembered status |
Lines 213-219
Link Here
|
213 |
"""This gets out final log message in before we quit. As it overrides |
216 |
"""This gets out final log message in before we quit. As it overrides |
214 |
any other atexit's we have setup, we need to call them ourself.""" |
217 |
any other atexit's we have setup, we need to call them ourself.""" |
215 |
portage.portageexit() |
218 |
portage.portageexit() |
216 |
emergelog(" *** terminating.") |
219 |
emergelog(_(" *** terminating.")) |
217 |
if "notitles" not in portage.features: |
220 |
if "notitles" not in portage.features: |
218 |
xtermTitleReset() |
221 |
xtermTitleReset() |
219 |
atexit.register(emergeexit) |
222 |
atexit.register(emergeexit) |
Lines 225-232
Link Here
|
225 |
|
228 |
|
226 |
def countdown(secs=5, doing="Starting"): |
229 |
def countdown(secs=5, doing="Starting"): |
227 |
if secs: |
230 |
if secs: |
228 |
print ">>> Waiting",secs,"seconds before starting..." |
231 |
print _(">>> Waiting %d seconds before starting...") % secs |
229 |
print ">>> (Control-C to abort)...\n"+doing+" in: ", |
232 |
print _(">>> (Control-C to abort)...\n%s in: ") % doing, |
230 |
ticks=range(secs) |
233 |
ticks=range(secs) |
231 |
ticks.reverse() |
234 |
ticks.reverse() |
232 |
for sec in ticks: |
235 |
for sec in ticks: |
Lines 247-261
Link Here
|
247 |
gcc_ver_prefix = 'gcc-' |
250 |
gcc_ver_prefix = 'gcc-' |
248 |
|
251 |
|
249 |
gcc_not_found_error = red( |
252 |
gcc_not_found_error = red( |
250 |
"!!! No gcc found. You probably need to 'source /etc/profile'\n" + |
253 |
_("!!! No gcc found. You probably need to 'source /etc/profile'\n") + |
251 |
"!!! to update the environment of this terminal and possibly\n" + |
254 |
_("!!! to update the environment of this terminal and possibly\n") + |
252 |
"!!! other terminals also." |
255 |
_("!!! other terminals also.") |
253 |
) |
256 |
) |
254 |
|
257 |
|
255 |
gcc_distcc_broken_error = green( |
258 |
gcc_distcc_broken_error = green( |
256 |
'!!! Using `which gcc` to gcc locate version, this may break\n' + |
259 |
_('!!! Using `which gcc` to gcc locate version, this may break\n') + |
257 |
'!!! DISTCC, installing gcc-config and setting your current gcc\n' + |
260 |
_('!!! DISTCC, installing gcc-config and setting your current gcc\n') + |
258 |
'!!! profile will fix this' |
261 |
_('!!! profile will fix this') |
259 |
) |
262 |
) |
260 |
|
263 |
|
261 |
def fallback(): |
264 |
def fallback(): |
Lines 266-272
Link Here
|
266 |
|
269 |
|
267 |
if gccout[0] != 0: |
270 |
if gccout[0] != 0: |
268 |
print >>sys.stderr, gcc_not_found_error |
271 |
print >>sys.stderr, gcc_not_found_error |
269 |
gccver = "[unavailable]" |
272 |
gccver = _("[unavailable]") |
270 |
else: |
273 |
else: |
271 |
gccver = gcc_ver_prefix + gccout[1] |
274 |
gccver = gcc_ver_prefix + gccout[1] |
272 |
|
275 |
|
Lines 327-337
Link Here
|
327 |
if ("--pretend" in myopts) or (myaction=="search"): |
330 |
if ("--pretend" in myopts) or (myaction=="search"): |
328 |
if not portage.secpass: |
331 |
if not portage.secpass: |
329 |
if portage.wheelgid==portage.portage_gid: |
332 |
if portage.wheelgid==portage.portage_gid: |
330 |
print "emerge: wheel group membership required for \"--pretend\" and search." |
333 |
print _("emerge: wheel group membership required for \"--pretend\" and search.") |
331 |
print "emerge: wheel group use is being deprecated. Please update group and passwd to" |
334 |
print _("emerge: wheel group use is being deprecated. Please update group and passwd to") |
332 |
print " include the portage user as noted above, and then use group portage." |
335 |
print _(" include the portage user as noted above, and then use group portage.") |
333 |
else: |
336 |
else: |
334 |
print "emerge: portage group membership required for \"--pretend\" and search." |
337 |
print _("emerge: portage group membership required for \"--pretend\" and search.") |
335 |
sys.exit(1) |
338 |
sys.exit(1) |
336 |
elif "--version" in myopts: |
339 |
elif "--version" in myopts: |
337 |
print getportageversion() |
340 |
print getportageversion() |
Lines 349-355
Link Here
|
349 |
else: |
352 |
else: |
350 |
print "myaction",myaction |
353 |
print "myaction",myaction |
351 |
print "myopts",myopts |
354 |
print "myopts",myopts |
352 |
print "emerge: root access required." |
355 |
print _("emerge: root access required.") |
353 |
sys.exit(1) |
356 |
sys.exit(1) |
354 |
|
357 |
|
355 |
if not "--pretend" in myopts: |
358 |
if not "--pretend" in myopts: |
Lines 433-439
Link Here
|
433 |
else: |
436 |
else: |
434 |
self.searchdesc=0 |
437 |
self.searchdesc=0 |
435 |
self.matches = {"pkg":[]} |
438 |
self.matches = {"pkg":[]} |
436 |
print "Searching... ", |
439 |
print _("Searching... "), |
437 |
if self.searchkey=="*": |
440 |
if self.searchkey=="*": |
438 |
#hack for people who aren't regular expression gurus |
441 |
#hack for people who aren't regular expression gurus |
439 |
self.searchkey==".*" |
442 |
self.searchkey==".*" |
Lines 461-467
Link Here
|
461 |
try: |
464 |
try: |
462 |
full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] |
465 |
full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] |
463 |
except KeyError: |
466 |
except KeyError: |
464 |
print "emerge: search: aux_get() failed, skipping" |
467 |
print _("emerge: search: aux_get() failed, skipping") |
465 |
continue |
468 |
continue |
466 |
if self.searchre.search(full_desc): |
469 |
if self.searchre.search(full_desc): |
467 |
self.matches["desc"].append([full_package,masked]) |
470 |
self.matches["desc"].append([full_package,masked]) |
Lines 522-532
Link Here
|
522 |
mysum[0]=" [no/bad digest]" |
525 |
mysum[0]=" [no/bad digest]" |
523 |
|
526 |
|
524 |
if "--quiet" not in myopts: |
527 |
if "--quiet" not in myopts: |
525 |
print " ", darkgreen("Latest version available:"),myversion |
528 |
print " ", darkgreen(_("Latest version available:")),myversion |
526 |
print " ", self.getInstallationStatus(catpack) |
529 |
print " ", self.getInstallationStatus(catpack) |
527 |
print " ", darkgreen("Size of downloaded files:"),mysum[0] |
530 |
print " ", darkgreen(_("Size of downloaded files:")),mysum[0] |
528 |
print " ", darkgreen("Homepage:")+" ",homepage |
531 |
print " ", darkgreen(_("Homepage:"))+" ",homepage |
529 |
print " ", darkgreen("Description:"),desc |
532 |
print " ", darkgreen(_("Description:")),desc |
530 |
print |
533 |
print |
531 |
print |
534 |
print |
532 |
# |
535 |
# |
Lines 560-566
Link Here
|
560 |
if portage.profiledir: |
563 |
if portage.profiledir: |
561 |
pfile=portage.profiledir+"/packages" |
564 |
pfile=portage.profiledir+"/packages" |
562 |
else: |
565 |
else: |
563 |
print "!!! No profile directory; system mode unavailable." |
566 |
print _("!!! No profile directory; system mode unavailable.") |
564 |
sys.exit(1) |
567 |
sys.exit(1) |
565 |
elif mode=="world": |
568 |
elif mode=="world": |
566 |
pfile=portage.root+"var/cache/edb/world" |
569 |
pfile=portage.root+"var/cache/edb/world" |
Lines 569-575
Link Here
|
569 |
mylines=myfile.readlines() |
572 |
mylines=myfile.readlines() |
570 |
myfile.close() |
573 |
myfile.close() |
571 |
except OSError: |
574 |
except OSError: |
572 |
print "!!! Couldn't open "+pfile+"; exiting." |
575 |
print _("!!! Couldn't open %s; exiting.") % pfile |
573 |
sys.exit(1) |
576 |
sys.exit(1) |
574 |
except IOError: |
577 |
except IOError: |
575 |
#world file doesn't exist |
578 |
#world file doesn't exist |
Lines 737-743
Link Here
|
737 |
for x in ["DEPEND","RDEPEND","PDEPEND","REBUILD"]: |
740 |
for x in ["DEPEND","RDEPEND","PDEPEND","REBUILD"]: |
738 |
edepend[x]=string.join(portage.portdb.aux_get(mykey,[x]), " ") |
741 |
edepend[x]=string.join(portage.portdb.aux_get(mykey,[x]), " ") |
739 |
except (KeyError,IOError): |
742 |
except (KeyError,IOError): |
740 |
print "emerge: create(): aux_get() error on",mykey+"; aborting..." |
743 |
print _("emerge: create(): aux_get() error on %s; aborting...") % mykey |
741 |
sys.exit(1) |
744 |
sys.exit(1) |
742 |
mydep={} |
745 |
mydep={} |
743 |
mp=string.join(mybigkey) |
746 |
mp=string.join(mybigkey) |
Lines 773-780
Link Here
|
773 |
elif os.path.exists(portage.settings["PKGDIR"]+"/"+x): |
776 |
elif os.path.exists(portage.settings["PKGDIR"]+"/"+x): |
774 |
x=portage.settings["PKGDIR"]+"/"+x |
777 |
x=portage.settings["PKGDIR"]+"/"+x |
775 |
else: |
778 |
else: |
776 |
print "\n\n!!! Binary package '"+str(x)+"' does not exist." |
779 |
print _("\n\n!!! Binary package '%s' does not exist.") % str(x) |
777 |
print "!!! Please ensure the tbz2 exists as specified.\n" |
780 |
print _("!!! Please ensure the tbz2 exists as specified.\n") |
778 |
sys.exit(1) |
781 |
sys.exit(1) |
779 |
mytbz2=xpak.tbz2(x) |
782 |
mytbz2=xpak.tbz2(x) |
780 |
mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] |
783 |
mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] |
Lines 795-801
Link Here
|
795 |
try: |
798 |
try: |
796 |
self.mysd=self.select_dep(portage.root,mykey,arg=x) |
799 |
self.mysd=self.select_dep(portage.root,mykey,arg=x) |
797 |
except Exception, e: |
800 |
except Exception, e: |
798 |
print "\n!!! Problem in",mykey,"dependencies." |
801 |
print _("\n!!! Problem in %s dependencies.") % mykey |
799 |
print "!!!",e |
802 |
print "!!!",e |
800 |
sys.exit(1) |
803 |
sys.exit(1) |
801 |
|
804 |
|
Lines 812-818
Link Here
|
812 |
if self.missingbins == 0: |
815 |
if self.missingbins == 0: |
813 |
print |
816 |
print |
814 |
self.missingbins+=1 |
817 |
self.missingbins+=1 |
815 |
print "Missing binary for:",xs[2] |
818 |
print _("Missing binary for:"),xs[2] |
816 |
|
819 |
|
817 |
# We're true here unless we are missing binaries. |
820 |
# We're true here unless we are missing binaries. |
818 |
return (not self.missingbins,myfavorites) |
821 |
return (not self.missingbins,myfavorites) |
Lines 839-846
Link Here
|
839 |
"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" |
842 |
"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" |
840 |
if "--debug" in myopts: |
843 |
if "--debug" in myopts: |
841 |
print |
844 |
print |
842 |
print "Parent: ",myparent |
845 |
print _("Parent: "),myparent |
843 |
print "Depstring:",depstring |
846 |
print _("Depstring:"),depstring |
844 |
if not arg: |
847 |
if not arg: |
845 |
#processing dependencies |
848 |
#processing dependencies |
846 |
mycheck=portage.dep_check(depstring,self.mydbapi[myroot],myuse=myuse) |
849 |
mycheck=portage.dep_check(depstring,self.mydbapi[myroot],myuse=myuse) |
Lines 851-857
Link Here
|
851 |
#we're processing a command-line argument; unconditionally merge it even if it's already merged |
854 |
#we're processing a command-line argument; unconditionally merge it even if it's already merged |
852 |
mymerge=[depstring] |
855 |
mymerge=[depstring] |
853 |
if "--debug" in myopts: |
856 |
if "--debug" in myopts: |
854 |
print "Candidates:",mymerge |
857 |
print _("Candidates:"),mymerge |
855 |
for x in mymerge: |
858 |
for x in mymerge: |
856 |
myk=None |
859 |
myk=None |
857 |
binpkguseflags=None |
860 |
binpkguseflags=None |
Lines 878-891
Link Here
|
878 |
alleb=portage.portdb.xmatch("match-all",x) |
881 |
alleb=portage.portdb.xmatch("match-all",x) |
879 |
if alleb: |
882 |
if alleb: |
880 |
if "--usepkgonly" not in myopts: |
883 |
if "--usepkgonly" not in myopts: |
881 |
print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") |
884 |
print "\n!!! "+red(_("all ebuilds that could satisfy "))+green(xinfo)+red(_(" have been masked.")) |
882 |
if myparent: |
885 |
if myparent: |
883 |
print "!!! "+red(xfrom) |
886 |
print "!!! "+red(xfrom) |
884 |
else: |
887 |
else: |
885 |
print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) |
888 |
print "\n!!! "+red(_("There are no packages available to satisfy: "))+green(xinfo) |
886 |
print "!!! Either add a suitable binary package or compile from an ebuild." |
889 |
print _("!!! Either add a suitable binary package or compile from an ebuild.") |
887 |
else: |
890 |
else: |
888 |
print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"." |
891 |
print _("\nemerge: there are no masked or unmasked ebuilds to satisfy ")+xinfo+"." |
889 |
return 0 |
892 |
return 0 |
890 |
|
893 |
|
891 |
if "--debug" in myopts: |
894 |
if "--debug" in myopts: |
Lines 943-949
Link Here
|
943 |
return 0 |
946 |
return 0 |
944 |
|
947 |
|
945 |
if "--debug" in myopts: |
948 |
if "--debug" in myopts: |
946 |
print "Exiting...",myparent |
949 |
print _("Exiting..."),myparent |
947 |
return 1 |
950 |
return 1 |
948 |
|
951 |
|
949 |
|
952 |
|
Lines 958-968
Link Here
|
958 |
while (not mygraph.empty()): |
961 |
while (not mygraph.empty()): |
959 |
mycurkey=mygraph.firstzero() |
962 |
mycurkey=mygraph.firstzero() |
960 |
if not mycurkey: |
963 |
if not mycurkey: |
961 |
print "!!! Error: circular dependencies:" |
964 |
print _("!!! Error: circular dependencies:") |
962 |
print |
965 |
print |
963 |
for x in mygraph.dict.keys(): |
966 |
for x in mygraph.dict.keys(): |
964 |
for y in mygraph.dict[x][1]: |
967 |
for y in mygraph.dict[x][1]: |
965 |
print y,"depends on",x |
968 |
print y,_("depends on"),x |
966 |
print |
969 |
print |
967 |
sys.exit(1) |
970 |
sys.exit(1) |
968 |
splitski=string.split(mycurkey) |
971 |
splitski=string.split(mycurkey) |
Lines 1000-1006
Link Here
|
1000 |
#package is installed |
1003 |
#package is installed |
1001 |
sysdict[x]=worlddict[x] |
1004 |
sysdict[x]=worlddict[x] |
1002 |
else: |
1005 |
else: |
1003 |
print "\n*** Package in world file is not installed: "+x |
1006 |
print _("\n*** Package in world file is not installed: ")+x |
1004 |
mylist=[] |
1007 |
mylist=[] |
1005 |
for x in sysdict.keys(): |
1008 |
for x in sysdict.keys(): |
1006 |
mylist.append(sysdict[x]) |
1009 |
mylist.append(sysdict[x]) |
Lines 1033-1040
Link Here
|
1033 |
myk=["ebuild",portage.root,myeb] |
1036 |
myk=["ebuild",portage.root,myeb] |
1034 |
if not self.create(myk): |
1037 |
if not self.create(myk): |
1035 |
print |
1038 |
print |
1036 |
print "!!! Problem with",myk[0],myk[2] |
1039 |
print _("!!! Problem with"),myk[0],myk[2] |
1037 |
print "!!! Possibly a DEPEND/*DEPEND problem." |
1040 |
print _("!!! Possibly a DEPEND/*DEPEND problem.") |
1038 |
print |
1041 |
print |
1039 |
return 0 |
1042 |
return 0 |
1040 |
return 1 |
1043 |
return 1 |
Lines 1052-1060
Link Here
|
1052 |
myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) |
1055 |
myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) |
1053 |
if not myeb: |
1056 |
if not myeb: |
1054 |
if not mykey: |
1057 |
if not mykey: |
1055 |
print "\n!!! Error: couldn't find match for",mydep |
1058 |
print _("\n!!! Error: couldn't find match for"),mydep |
1056 |
else: |
1059 |
else: |
1057 |
print "\n!!! Error: couldn't find match for",mydep,"in",mykey |
1060 |
print _("\n!!! Error: couldn't find match for"),mydep,_("in"),mykey |
1058 |
print |
1061 |
print |
1059 |
sys.exit(1) |
1062 |
sys.exit(1) |
1060 |
|
1063 |
|
Lines 1186-1202
Link Here
|
1186 |
if mysplit[0]=="sys-apps/portage": |
1189 |
if mysplit[0]=="sys-apps/portage": |
1187 |
if mysplit[1]+mysplit[2]!=portage.VERSION: |
1190 |
if mysplit[1]+mysplit[2]!=portage.VERSION: |
1188 |
if mylist.index(x)<len(mylist)-1: |
1191 |
if mylist.index(x)<len(mylist)-1: |
1189 |
print red("*** Portage will stop merging at this point and reload itself,") |
1192 |
print red(_("*** Portage will stop merging at this point and reload itself,")) |
1190 |
print red(" recalculate dependencies, and complete the merge.") |
1193 |
print red(_(" recalculate dependencies, and complete the merge.")) |
1191 |
if "--update" not in myopts: |
1194 |
if "--update" not in myopts: |
1192 |
print darkgreen(" You may avoid the remerging of packages by updating portage on its own.") |
1195 |
print darkgreen(_(" You may avoid the remerging of packages by updating portage on its own.")) |
1193 |
print |
1196 |
print |
1194 |
else: |
1197 |
else: |
1195 |
if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts): |
1198 |
if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts): |
1196 |
if mysplit[1]+mysplit[2]!=portage.VERSION: |
1199 |
if mysplit[1]+mysplit[2]!=portage.VERSION: |
1197 |
print red("***")+" Please update portage to the above version before proceeding." |
1200 |
print red("***")+_(" Please update portage to the above version before proceeding.") |
1198 |
print " Failure to do so may result in failed or improper merges." |
1201 |
print _(" Failure to do so may result in failed or improper merges.") |
1199 |
print " A simple '"+green("emerge -u portage")+"' is sufficient." |
1202 |
print _(" A simple '")+green("emerge -u portage")+_("' is sufficient.") |
1200 |
print |
1203 |
print |
1201 |
del mysplit |
1204 |
del mysplit |
1202 |
|
1205 |
|
Lines 1263-1278
Link Here
|
1263 |
if ("--fetchonly" not in myopts) and ("--buildpkgonly" not in myopts): |
1266 |
if ("--fetchonly" not in myopts) and ("--buildpkgonly" not in myopts): |
1264 |
for x in mylist: |
1267 |
for x in mylist: |
1265 |
if x[0]=="blocks": |
1268 |
if x[0]=="blocks": |
1266 |
print "\n!!! Error: the "+x[2]+" package conflicts with another package." |
1269 |
print _("\n!!! Error: the "+x[2]+" package conflicts with another package.") |
1267 |
print "!!! both can't be installed on the same system together." |
1270 |
print _("!!! both can't be installed on the same system together.") |
1268 |
print "!!! Please use 'emerge --pretend' to determine blockers." |
1271 |
print _("!!! Please use 'emerge --pretend' to determine blockers.") |
1269 |
print |
1272 |
print |
1270 |
if ("--pretend" not in myopts): |
1273 |
if ("--pretend" not in myopts): |
1271 |
sys.exit(1) |
1274 |
sys.exit(1) |
1272 |
|
1275 |
|
1273 |
if ("--resume" in myopts): |
1276 |
if ("--resume" in myopts): |
1274 |
# We're resuming. |
1277 |
# We're resuming. |
1275 |
print green("*** Resuming merge...") |
1278 |
print green(_("*** Resuming merge...")) |
1276 |
emergelog(" *** Resuming merge...") |
1279 |
emergelog(" *** Resuming merge...") |
1277 |
mymergelist=portage.mtimedb["resume"]["mergelist"][:] |
1280 |
mymergelist=portage.mtimedb["resume"]["mergelist"][:] |
1278 |
if ("--skipfirst" in myopts) and mymergelist: |
1281 |
if ("--skipfirst" in myopts) and mymergelist: |
Lines 1293-1299
Link Here
|
1293 |
if (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)): |
1296 |
if (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)): |
1294 |
#we don't have a favorites entry for this package yet; add one |
1297 |
#we don't have a favorites entry for this package yet; add one |
1295 |
myfavdict[myfavkey]=myfavkey |
1298 |
myfavdict[myfavkey]=myfavkey |
1296 |
print ">>> Recording",myfavkey,"in \"world\" favorites file..." |
1299 |
print _(">>> Recording"),myfavkey,_("in \"world\" favorites file...") |
1297 |
if not "--fetchonly" in myopts: |
1300 |
if not "--fetchonly" in myopts: |
1298 |
portage.writedict(myfavdict,portage.root+"var/cache/edb/world",writekey=0) |
1301 |
portage.writedict(myfavdict,portage.root+"var/cache/edb/world",writekey=0) |
1299 |
|
1302 |
|
Lines 1324-1330
Link Here
|
1324 |
retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1) |
1327 |
retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1) |
1325 |
if retval: |
1328 |
if retval: |
1326 |
print |
1329 |
print |
1327 |
print "!!! Fetch for",y,"failed, continuing..." |
1330 |
print _("!!! Fetch for %s failed, continuing...") % y |
1328 |
print |
1331 |
print |
1329 |
returnme=1 |
1332 |
returnme=1 |
1330 |
continue |
1333 |
continue |
Lines 1441-1447
Link Here
|
1441 |
#fetch everything even if a particular download fails. |
1444 |
#fetch everything even if a particular download fails. |
1442 |
if "--fetchonly" in myopts: |
1445 |
if "--fetchonly" in myopts: |
1443 |
if returnme: |
1446 |
if returnme: |
1444 |
print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" |
1447 |
print _("\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n") |
1445 |
sys.exit(returnme) |
1448 |
sys.exit(returnme) |
1446 |
else: |
1449 |
else: |
1447 |
sys.exit(0) |
1450 |
sys.exit(0) |
Lines 1453-1460
Link Here
|
1453 |
if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: |
1456 |
if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: |
1454 |
if "unmerge"==unmerge_action: |
1457 |
if "unmerge"==unmerge_action: |
1455 |
print |
1458 |
print |
1456 |
print bold("emerge unmerge")+" can only be used with specific package names, not with "+bold("world")+" or" |
1459 |
print bold("emerge unmerge")+_(" can only be used with specific package names, not with ")+bold("world")+_(" or") |
1457 |
print bold("system")+" targets." |
1460 |
print bold("system")+_(" targets.") |
1458 |
print |
1461 |
print |
1459 |
return 0 |
1462 |
return 0 |
1460 |
else: |
1463 |
else: |
Lines 1470-1476
Link Here
|
1470 |
else: |
1473 |
else: |
1471 |
#we've got command-line arguments |
1474 |
#we've got command-line arguments |
1472 |
if not unmerge_files: |
1475 |
if not unmerge_files: |
1473 |
print "\nNo packages to unmerge have been provided.\n" |
1476 |
print _("\nNo packages to unmerge have been provided.\n") |
1474 |
return 0 |
1477 |
return 0 |
1475 |
for x in unmerge_files: |
1478 |
for x in unmerge_files: |
1476 |
arg_parts=x.split('/') |
1479 |
arg_parts=x.split('/') |
Lines 1478-1490
Link Here
|
1478 |
#possible cat/pkg or dep; treat as such |
1481 |
#possible cat/pkg or dep; treat as such |
1479 |
candidate_catpkgs.append(x) |
1482 |
candidate_catpkgs.append(x) |
1480 |
elif unmerge_action in ["prune","clean"]: |
1483 |
elif unmerge_action in ["prune","clean"]: |
1481 |
print "\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n" |
1484 |
print _("\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n") |
1482 |
continue |
1485 |
continue |
1483 |
else: |
1486 |
else: |
1484 |
# it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's |
1487 |
# it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's |
1485 |
# ok. |
1488 |
# ok. |
1486 |
if not os.path.exists(x): |
1489 |
if not os.path.exists(x): |
1487 |
print "\n!!! The path '"+x+"' doesn't exist.\n" |
1490 |
print _("\n!!! The path '"+x+"' doesn't exist.\n") |
1488 |
return 0 |
1491 |
return 0 |
1489 |
absx=os.path.abspath(x) |
1492 |
absx=os.path.abspath(x) |
1490 |
spabsx=absx.split("/") |
1493 |
spabsx=absx.split("/") |
Lines 1496-1502
Link Here
|
1496 |
candidate_catpkgs.append("="+spabsx[4]+"/"+spabsx[5]) |
1499 |
candidate_catpkgs.append("="+spabsx[4]+"/"+spabsx[5]) |
1497 |
|
1500 |
|
1498 |
if "--pretend" in myopts: |
1501 |
if "--pretend" in myopts: |
1499 |
print darkgreen("\n>>> These are the packages that I would unmerge:") |
1502 |
print darkgreen(_("\n>>> These are the packages that I would unmerge:")) |
1500 |
|
1503 |
|
1501 |
pkgmap={} |
1504 |
pkgmap={} |
1502 |
numselected=0 |
1505 |
numselected=0 |
Lines 1507-1513
Link Here
|
1507 |
#add a "=" if missing |
1510 |
#add a "=" if missing |
1508 |
mymatch=localtree.dep_match("="+x) |
1511 |
mymatch=localtree.dep_match("="+x) |
1509 |
if not mymatch: |
1512 |
if not mymatch: |
1510 |
print "\n!!! Couldn't find match for",white(x) |
1513 |
print _("\n!!! Couldn't find match for"),white(x) |
1511 |
continue |
1514 |
continue |
1512 |
mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) |
1515 |
mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) |
1513 |
if not pkgmap.has_key(mykey): |
1516 |
if not pkgmap.has_key(mykey): |
Lines 1543-1553
Link Here
|
1543 |
numselected=numselected+1 |
1546 |
numselected=numselected+1 |
1544 |
#ok, now the last-merged package is protected, and the rest are selected |
1547 |
#ok, now the last-merged package is protected, and the rest are selected |
1545 |
if global_unmerge and not numselected: |
1548 |
if global_unmerge and not numselected: |
1546 |
print "\n>>> No outdated packages were found on your system.\n" |
1549 |
print _("\n>>> No outdated packages were found on your system.\n") |
1547 |
return 0 |
1550 |
return 0 |
1548 |
|
1551 |
|
1549 |
if not numselected: |
1552 |
if not numselected: |
1550 |
print "\n>>>",unmerge_action+": No packages selected for removal.\n" |
1553 |
print _("\n>>>",unmerge_action+": No packages selected for removal.\n") |
1551 |
return 0 |
1554 |
return 0 |
1552 |
|
1555 |
|
1553 |
if mymatch: |
1556 |
if mymatch: |
Lines 1652-1660
Link Here
|
1652 |
regen+=1 |
1655 |
regen+=1 |
1653 |
|
1656 |
|
1654 |
if not regen: |
1657 |
if not regen: |
1655 |
print " "+green("*")+" GNU info directory index is up-to-date." |
1658 |
print " "+green("*")+_(" GNU info directory index is up-to-date.") |
1656 |
else: |
1659 |
else: |
1657 |
print " "+green("*")+" Regenerating GNU info directory index..." |
1660 |
print " "+green("*")+_(" Regenerating GNU info directory index...") |
1658 |
|
1661 |
|
1659 |
icount=0 |
1662 |
icount=0 |
1660 |
badcount=0 |
1663 |
badcount=0 |
Lines 1720-1726
Link Here
|
1720 |
|
1723 |
|
1721 |
if myaction in ["sync","rsync"] and (not "--help" in myopts): |
1724 |
if myaction in ["sync","rsync"] and (not "--help" in myopts): |
1722 |
if "--pretend" in myopts: |
1725 |
if "--pretend" in myopts: |
1723 |
print "emerge: the \"sync\" action does not support \"--pretend.\"" |
1726 |
print _("emerge: the \"sync\" action does not support \"--pretend.\"") |
1724 |
sys.exit(1) |
1727 |
sys.exit(1) |
1725 |
|
1728 |
|
1726 |
emergelog(" === rsync") |
1729 |
emergelog(" === rsync") |
Lines 1734-1741
Link Here
|
1734 |
os.umask(0022) |
1737 |
os.umask(0022) |
1735 |
if syncuri[:8]=="rsync://": |
1738 |
if syncuri[:8]=="rsync://": |
1736 |
if not os.path.exists("/usr/bin/rsync"): |
1739 |
if not os.path.exists("/usr/bin/rsync"): |
1737 |
print "!!! /usr/bin/rsync does not exist, so rsync support is disabled." |
1740 |
print _("!!! /usr/bin/rsync does not exist, so rsync support is disabled.") |
1738 |
print "!!! Type \"emerge net-misc/rsync\" to enable rsync support." |
1741 |
print _("!!! Type \"emerge net-misc/rsync\" to enable rsync support.") |
1739 |
sys.exit(1) |
1742 |
sys.exit(1) |
1740 |
mytimeout=180 |
1743 |
mytimeout=180 |
1741 |
if portage.settings.has_key("RSYNC_TIMEOUT"): |
1744 |
if portage.settings.has_key("RSYNC_TIMEOUT"): |
Lines 1748-1756
Link Here
|
1748 |
if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]): |
1751 |
if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]): |
1749 |
mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] |
1752 |
mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] |
1750 |
else: |
1753 |
else: |
1751 |
print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." |
1754 |
print _("!!! RSYNC_EXCLUDEFROM specified, but file does not exist.") |
1752 |
mycommand=mycommand+" "+syncuri+"/* "+myportdir |
1755 |
mycommand=mycommand+" "+syncuri+"/* "+myportdir |
1753 |
print ">>> starting rsync with "+syncuri+"..." |
1756 |
print _(">>> starting rsync with ")+syncuri+"..." |
1754 |
exitcode=portage.spawn(mycommand,free=1) |
1757 |
exitcode=portage.spawn(mycommand,free=1) |
1755 |
#exitcode=0 |
1758 |
#exitcode=0 |
1756 |
try: |
1759 |
try: |
Lines 1759-1821
Link Here
|
1759 |
maxretries=3 #default number of retries |
1762 |
maxretries=3 #default number of retries |
1760 |
retries=1 |
1763 |
retries=1 |
1761 |
while (exitcode not in [0,1,2,3,4,11,14,20,21]) and (retries<=maxretries): |
1764 |
while (exitcode not in [0,1,2,3,4,11,14,20,21]) and (retries<=maxretries): |
1762 |
print "\n\n>>> Starting retry %d of %d"% (retries,maxretries) |
1765 |
print _("\n\n>>> Starting retry %d of %d")% (retries,maxretries) |
1763 |
time.sleep(11) |
1766 |
time.sleep(11) |
1764 |
retries=retries+1 |
1767 |
retries=retries+1 |
1765 |
exitcode=portage.spawn(mycommand,free=1) |
1768 |
exitcode=portage.spawn(mycommand,free=1) |
1766 |
if (exitcode>0): |
1769 |
if (exitcode>0): |
1767 |
print |
1770 |
print |
1768 |
if exitcode==1: |
1771 |
if exitcode==1: |
1769 |
print darkred("!!!")+green(" Rsync has reported that there is a syntax error. Please ensure") |
1772 |
print darkred("!!!")+green(_(" Rsync has reported that there is a syntax error. Please ensure")) |
1770 |
print darkred("!!!")+green(" that your SYNC statement is proper.") |
1773 |
print darkred("!!!")+green(_(" that your SYNC statement is proper.")) |
1771 |
print darkred("!!!")+green(" SYNC="+portage.settings["SYNC"]) |
1774 |
print darkred("!!!")+green(_(" SYNC="+portage.settings["SYNC"])) |
1772 |
elif exitcode==11: |
1775 |
elif exitcode==11: |
1773 |
print darkred("!!!")+green(" Rsync has reported that there is a File IO error. Normally") |
1776 |
print darkred("!!!")+green(_(" Rsync has reported that there is a File IO error. Normally")) |
1774 |
print darkred("!!!")+green(" this means your disk is full, but can be caused by corruption") |
1777 |
print darkred("!!!")+green(_(" this means your disk is full, but can be caused by corruption")) |
1775 |
print darkred("!!!")+green(" on the filesystem that contains PORTDIR. Please investigate") |
1778 |
print darkred("!!!")+green(_(" on the filesystem that contains PORTDIR. Please investigate")) |
1776 |
print darkred("!!!")+green(" and try again after the problem has been fixed.") |
1779 |
print darkred("!!!")+green(_(" and try again after the problem has been fixed.")) |
1777 |
print darkred("!!!")+green(" PORTDIR="+portage.settings["PORTDIR"]) |
1780 |
print darkred("!!!")+green(_(" PORTDIR="+portage.settings["PORTDIR"])) |
1778 |
elif exitcode==20: |
1781 |
elif exitcode==20: |
1779 |
print darkred("!!!")+green(" Rsync was killed before it finished.") |
1782 |
print darkred("!!!")+green(_(" Rsync was killed before it finished.")) |
1780 |
else: |
1783 |
else: |
1781 |
print darkred("!!!")+green(" Rsync has not successfully finished. It is recommended that you keep") |
1784 |
print darkred("!!!")+green(_(" Rsync has not successfully finished. It is recommended that you keep")) |
1782 |
print darkred("!!!")+green(" trying or that you use the 'emerge-webrsync' option if you are unable") |
1785 |
print darkred("!!!")+green(_(" trying or that you use the 'emerge-webrsync' option if you are unable")) |
1783 |
print darkred("!!!")+green(" to use rsync due to firewall or other restrictions. This should be a") |
1786 |
print darkred("!!!")+green(_(" to use rsync due to firewall or other restrictions. This should be a")) |
1784 |
print darkred("!!!")+green(" temporary problem unless complications exist with your network") |
1787 |
print darkred("!!!")+green(_(" temporary problem unless complications exist with your network")) |
1785 |
print darkred("!!!")+green(" (and possibly your system's filesystem) configuration.") |
1788 |
print darkred("!!!")+green(_(" (and possibly your system's filesystem) configuration.")) |
1786 |
print |
1789 |
print |
1787 |
sys.exit(exitcode) |
1790 |
sys.exit(exitcode) |
1788 |
elif syncuri[:6]=="cvs://": |
1791 |
elif syncuri[:6]=="cvs://": |
1789 |
if not os.path.exists("/usr/bin/cvs"): |
1792 |
if not os.path.exists("/usr/bin/cvs"): |
1790 |
print "!!! /usr/bin/cvs does not exist, so rsync support is disabled." |
1793 |
print _("!!! /usr/bin/cvs does not exist, so rsync support is disabled.") |
1791 |
print "!!! Type \"emerge dev-util/cvs\" to enable CVS support." |
1794 |
print _("!!! Type \"emerge dev-util/cvs\" to enable CVS support.") |
1792 |
sys.exit(1) |
1795 |
sys.exit(1) |
1793 |
cvsroot=syncuri[6:] |
1796 |
cvsroot=syncuri[6:] |
1794 |
cvsdir=os.path.dirname(myportdir) |
1797 |
cvsdir=os.path.dirname(myportdir) |
1795 |
if not os.path.exists(myportdir+"/CVS"): |
1798 |
if not os.path.exists(myportdir+"/CVS"): |
1796 |
#initial checkout |
1799 |
#initial checkout |
1797 |
print ">>> starting initial cvs checkout with "+syncuri+"..." |
1800 |
print _(">>> starting initial cvs checkout with ")+syncuri+"..." |
1798 |
if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",free=1): |
1801 |
if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",free=1): |
1799 |
print "!!! cvs login error; exiting." |
1802 |
print _("!!! cvs login error; exiting.") |
1800 |
sys.exit(1) |
1803 |
sys.exit(1) |
1801 |
if os.path.exists(cvsdir+"/gentoo-x86"): |
1804 |
if os.path.exists(cvsdir+"/gentoo-x86"): |
1802 |
print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." |
1805 |
print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." |
1803 |
sys.exit(1) |
1806 |
sys.exit(1) |
1804 |
if not portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co gentoo-x86",free=1): |
1807 |
if not portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co gentoo-x86",free=1): |
1805 |
print "!!! cvs checkout error; exiting." |
1808 |
print _("!!! cvs checkout error; exiting.") |
1806 |
sys.exit(1) |
1809 |
sys.exit(1) |
1807 |
if cvsdir!=myportdir: |
1810 |
if cvsdir!=myportdir: |
1808 |
portage.movefile(cvsdir,portage.settings["PORTDIR"]) |
1811 |
portage.movefile(cvsdir,portage.settings["PORTDIR"]) |
1809 |
sys.exit(0) |
1812 |
sys.exit(0) |
1810 |
else: |
1813 |
else: |
1811 |
#cvs update |
1814 |
#cvs update |
1812 |
print ">>> starting cvs update with "+syncuri+"..." |
1815 |
print _(">>> starting cvs update with ")+syncuri+"..." |
1813 |
sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",free=1)) |
1816 |
sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",free=1)) |
1814 |
else: |
1817 |
else: |
1815 |
print "!!! rsync setting: ",syncuri,"not recognized; exiting." |
1818 |
print _("!!! rsync setting: %s not recognized; exiting.") % syncuri |
1816 |
sys.exit(1) |
1819 |
sys.exit(1) |
1817 |
if os.path.exists(myportdir+"/metadata/cache"): |
1820 |
if os.path.exists(myportdir+"/metadata/cache"): |
1818 |
print "\n>>> Updating Portage cache... ", |
1821 |
print _("\n>>> Updating Portage cache... "), |
1819 |
os.umask(0002) |
1822 |
os.umask(0002) |
1820 |
portage.db["/"]["porttree"].dbapi.flush_auxcache() |
1823 |
portage.db["/"]["porttree"].dbapi.flush_auxcache() |
1821 |
if os.path.exists(portage.dbcachedir): |
1824 |
if os.path.exists(portage.dbcachedir): |
Lines 1855-1868
Link Here
|
1855 |
|
1858 |
|
1856 |
if(mybestpv != mypvs): |
1859 |
if(mybestpv != mypvs): |
1857 |
print |
1860 |
print |
1858 |
print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" |
1861 |
print red(" * ")+bold(_("An update to portage is available."))+_(" It is _highly_ recommended") |
1859 |
print red(" * ")+"that you update portage now, before any other packages are updated." |
1862 |
print red(" * ")+_("that you update portage now, before any other packages are updated.") |
1860 |
print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." |
1863 |
print red(" * ")+_("Please do so and then update "+bold("ALL")+" of your configuration files.") |
1861 |
print |
1864 |
print |
1862 |
elif myaction=="regen": |
1865 |
elif myaction=="regen": |
1863 |
emergelog(" === regen") |
1866 |
emergelog(" === regen") |
1864 |
#regenerate cache entries |
1867 |
#regenerate cache entries |
1865 |
print "Regenerating cache entries... " |
1868 |
print _("Regenerating cache entries... ") |
1866 |
sys.stdout.flush() |
1869 |
sys.stdout.flush() |
1867 |
mynodes=portage.portdb.cp_all() |
1870 |
mynodes=portage.portdb.cp_all() |
1868 |
for x in mynodes: |
1871 |
for x in mynodes: |
Lines 1874-1885
Link Here
|
1874 |
foo=portage.portdb.aux_get(y,["DEPEND"],debug=1) |
1877 |
foo=portage.portdb.aux_get(y,["DEPEND"],debug=1) |
1875 |
except: |
1878 |
except: |
1876 |
print "\nerror processing",y+", continuing..." |
1879 |
print "\nerror processing",y+", continuing..." |
1877 |
print "done!" |
1880 |
print _("done!") |
1878 |
# HELP action |
1881 |
# HELP action |
1879 |
elif "config"==myaction: |
1882 |
elif "config"==myaction: |
1880 |
emergelog(" === config") |
1883 |
emergelog(" === config") |
1881 |
print |
1884 |
print |
1882 |
print "Currently, \'config\' is a help option only." |
1885 |
print _("Currently, \'config\' is a help option only.") |
1883 |
print |
1886 |
print |
1884 |
# INFO action |
1887 |
# INFO action |
1885 |
elif "info"==myaction: |
1888 |
elif "info"==myaction: |
Lines 1893-1909
Link Here
|
1893 |
if not output[0]: |
1896 |
if not output[0]: |
1894 |
print str(string.split(output[1],"\n",1)[0]), |
1897 |
print str(string.split(output[1],"\n",1)[0]), |
1895 |
if "distcc" in portage.features: |
1898 |
if "distcc" in portage.features: |
1896 |
print "[enabled]" |
1899 |
print _("[enabled]") |
1897 |
else: |
1900 |
else: |
1898 |
print "[disabled]" |
1901 |
print _("[disabled]") |
1899 |
|
1902 |
|
1900 |
output=commands.getstatusoutput("`which ccache` -V") |
1903 |
output=commands.getstatusoutput("`which ccache` -V") |
1901 |
if not output[0]: |
1904 |
if not output[0]: |
1902 |
print str(string.split(output[1],"\n",1)[0]), |
1905 |
print str(string.split(output[1],"\n",1)[0]), |
1903 |
if "ccache" in portage.features: |
1906 |
if "ccache" in portage.features: |
1904 |
print "[enabled]" |
1907 |
print _("[enabled]") |
1905 |
else: |
1908 |
else: |
1906 |
print "[disabled]" |
1909 |
print _("[disabled]") |
1907 |
|
1910 |
|
1908 |
if "--verbose" in myopts: |
1911 |
if "--verbose" in myopts: |
1909 |
myvars=portage.settings.keys() |
1912 |
myvars=portage.settings.keys() |
Lines 1920-1946
Link Here
|
1920 |
# SEARCH action |
1923 |
# SEARCH action |
1921 |
elif "search"==myaction: |
1924 |
elif "search"==myaction: |
1922 |
if not myfiles: |
1925 |
if not myfiles: |
1923 |
print "emerge: no search terms provided." |
1926 |
print _("emerge: no search terms provided.") |
1924 |
else: |
1927 |
else: |
1925 |
searchinstance = search() |
1928 |
searchinstance = search() |
1926 |
for mysearch in myfiles: |
1929 |
for mysearch in myfiles: |
1927 |
try: |
1930 |
try: |
1928 |
searchinstance.execute(mysearch) |
1931 |
searchinstance.execute(mysearch) |
1929 |
except re.error, comment: |
1932 |
except re.error, comment: |
1930 |
print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) |
1933 |
print _("\n!!! Regular expression error in \"%s\": %s") % ( mysearch, comment ) |
1931 |
sys.exit(1) |
1934 |
sys.exit(1) |
1932 |
searchinstance.output() |
1935 |
searchinstance.output() |
1933 |
elif "inject"==myaction: |
1936 |
elif "inject"==myaction: |
1934 |
if not myfiles: |
1937 |
if not myfiles: |
1935 |
print "emerge: please specify at least one cat/pkg-ver to inject." |
1938 |
print _("emerge: please specify at least one cat/pkg-ver to inject.") |
1936 |
sys.exit(1) |
1939 |
sys.exit(1) |
1937 |
if "--pretend" in myopts: |
1940 |
if "--pretend" in myopts: |
1938 |
print "emerge: the \"inject\" action does not support \"--pretend.\"" |
1941 |
print _("emerge: the \"inject\" action does not support \"--pretend.\"") |
1939 |
sys.exit(1) |
1942 |
sys.exit(1) |
1940 |
for x in myfiles: |
1943 |
for x in myfiles: |
1941 |
if x[0] in [">","<","=","!"]: |
1944 |
if x[0] in [">","<","=","!"]: |
1942 |
print "!!! '"+x+"' is an invalid specification." |
1945 |
print _("!!! '"+x+"' is an invalid specification.") |
1943 |
print "!!! Must be 'category/package-version' with no other symbols." |
1946 |
print _("!!! Must be 'category/package-version' with no other symbols.") |
1944 |
print |
1947 |
print |
1945 |
continue |
1948 |
continue |
1946 |
mycps=portage.catpkgsplit(x) |
1949 |
mycps=portage.catpkgsplit(x) |
Lines 1962-1982
Link Here
|
1962 |
# dependency of another package. World file is explicit. |
1965 |
# dependency of another package. World file is explicit. |
1963 |
|
1966 |
|
1964 |
print |
1967 |
print |
1965 |
print red("*** WARNING ***")+" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION." |
1968 |
print red(_("*** WARNING ***"))+_(" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION.") |
1966 |
print red("*** WARNING ***")+" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE" |
1969 |
print red(_("*** WARNING ***"))+_(" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE") |
1967 |
print red("*** WARNING ***")+" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO" |
1970 |
print red(_("*** WARNING ***"))+_(" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO") |
1968 |
print red("*** WARNING ***")+" : UNMERGE ANY PACKAGES." |
1971 |
print red(_("*** WARNING ***"))+_(" : UNMERGE ANY PACKAGES.") |
1969 |
print red("*** WARNING ***")+" :" |
1972 |
print red(_("*** WARNING ***"))+" :" |
1970 |
print red("*** WARNING ***")+" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT." |
1973 |
print red(_("*** WARNING ***"))+_(" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT.") |
1971 |
print red("*** WARNING ***")+" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT" |
1974 |
print red(_("*** WARNING ***"))+_(" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT") |
1972 |
print red("*** WARNING ***")+" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS." |
1975 |
print red(_("*** WARNING ***"))+_(" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS.") |
1973 |
print red("*** WARNING ***")+" :" |
1976 |
print red(_("*** WARNING ***"))+" :" |
1974 |
print red("*** WARNING ***")+" : Packages in the list that are desired may be added" |
1977 |
print red(_("*** WARNING ***"))+_(" : Packages in the list that are desired may be added") |
1975 |
print red("*** WARNING ***")+" : directly to the world file to cause them to be ignored" |
1978 |
print red(_("*** WARNING ***"))+_(" : directly to the world file to cause them to be ignored") |
1976 |
print red("*** WARNING ***")+" : by depclean and maintained in the future. BREAKAGES DUE" |
1979 |
print red(_("*** WARNING ***"))+_(" : by depclean and maintained in the future. BREAKAGES DUE") |
1977 |
print red("*** WARNING ***")+" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY" |
1980 |
print red(_("*** WARNING ***"))+_(" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY") |
1978 |
print red("*** WARNING ***")+" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE" |
1981 |
print red(_("*** WARNING ***"))+_(" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE") |
1979 |
print red("*** WARNING ***")+" : MISSING LIBRARY." |
1982 |
print red(_("*** WARNING ***"))+_(" : MISSING LIBRARY.") |
1980 |
print |
1983 |
print |
1981 |
if not "--pretend" in myopts: |
1984 |
if not "--pretend" in myopts: |
1982 |
countdown(10, ">>> Depclean") |
1985 |
countdown(10, ">>> Depclean") |
Lines 1988-1996
Link Here
|
1988 |
|
1991 |
|
1989 |
print "Calculating",myaction,"dependencies ", |
1992 |
print "Calculating",myaction,"dependencies ", |
1990 |
if not mydepgraph.xcreate("world"): |
1993 |
if not mydepgraph.xcreate("world"): |
1991 |
print "\n!!! Failed to create deptree." |
1994 |
print _("\n!!! Failed to create deptree.") |
1992 |
sys.exit(1) |
1995 |
sys.exit(1) |
1993 |
print "\b\b ... done!" |
1996 |
print _("\b\b ... done!") |
1994 |
|
1997 |
|
1995 |
if ("--usepkgonly" in myopts) and mydepgraph.missingbins: |
1998 |
if ("--usepkgonly" in myopts) and mydepgraph.missingbins: |
1996 |
sys.stderr.write(red("The following binaries are not available for merging...\n")) |
1999 |
sys.stderr.write(red("The following binaries are not available for merging...\n")) |
Lines 2003-2015
Link Here
|
2003 |
myvarlist=portage.vardbapi(portage.root).cp_all() |
2006 |
myvarlist=portage.vardbapi(portage.root).cp_all() |
2004 |
|
2007 |
|
2005 |
if not syslist: |
2008 |
if not syslist: |
2006 |
print "!!! You have no system list. Cannot determine system from world." |
2009 |
print _("!!! You have no system list. Cannot determine system from world.") |
2007 |
if not worldlist: |
2010 |
if not worldlist: |
2008 |
print "!!! You have no world file. Cannot determine explicit merges." |
2011 |
print _("!!! You have no world file. Cannot determine explicit merges.") |
2009 |
if not myvarlist: |
2012 |
if not myvarlist: |
2010 |
print "!!! You have no /var/db tree. This is a problem." |
2013 |
print _("!!! You have no /var/db tree. This is a problem.") |
2011 |
if not alldeps: |
2014 |
if not alldeps: |
2012 |
print "!!! You have no dependencies. Impossible. Bug." |
2015 |
print _("!!! You have no dependencies. Impossible. Bug.") |
2013 |
|
2016 |
|
2014 |
if not (syslist and worldlist and myvarlist and alldeps): |
2017 |
if not (syslist and worldlist and myvarlist and alldeps): |
2015 |
print |
2018 |
print |
Lines 2020-2028
Link Here
|
2020 |
myparts=portage.catpkgsplit(string.split(x)[2]) |
2023 |
myparts=portage.catpkgsplit(string.split(x)[2]) |
2021 |
if not myparts: |
2024 |
if not myparts: |
2022 |
sys.stderr.write( |
2025 |
sys.stderr.write( |
2023 |
red("!!! There appears to be a problem with the following package:\n")+ |
2026 |
red(_("!!! There appears to be a problem with the following package:\n"))+ |
2024 |
red("!!! "+str(string.split(x)[2])+"\n\n")+ |
2027 |
red("!!! "+str(string.split(x)[2])+"\n\n")+ |
2025 |
"!!! Please ensure that blocking/conflicting packages are not merged."+ |
2028 |
_("!!! Please ensure that blocking/conflicting packages are not merged.")+ |
2026 |
"!!! 'emerge -p "+str(string.split(x)[2])+"\n\n") |
2029 |
"!!! 'emerge -p "+str(string.split(x)[2])+"\n\n") |
2027 |
if "--pretend" not in myopts: |
2030 |
if "--pretend" not in myopts: |
2028 |
countdown(15, "*** Continuing") |
2031 |
countdown(15, "*** Continuing") |
Lines 2060-2074
Link Here
|
2060 |
unmerge("unmerge", cleanlist) |
2063 |
unmerge("unmerge", cleanlist) |
2061 |
|
2064 |
|
2062 |
print |
2065 |
print |
2063 |
print "Packages installed: "+str(len(myvarlist)) |
2066 |
print _("Packages installed: ")+str(len(myvarlist)) |
2064 |
print "Packages in world: "+str(len(worldlist)) |
2067 |
print _("Packages in world: ")+str(len(worldlist)) |
2065 |
print "Packages in system: "+str(len(syslist)) |
2068 |
print _("Packages in system: ")+str(len(syslist)) |
2066 |
print "Unique package names: "+str(len(reallist)) |
2069 |
print _("Unique package names: ")+str(len(reallist)) |
2067 |
print "Required packages: "+str(len(alldeps)) |
2070 |
print _("Required packages: ")+str(len(alldeps)) |
2068 |
if "--pretend" in myopts: |
2071 |
if "--pretend" in myopts: |
2069 |
print "Number to remove: "+str(len(cleanlist)) |
2072 |
print _("Number to remove: ")+str(len(cleanlist)) |
2070 |
else: |
2073 |
else: |
2071 |
print "Number removed: "+str(len(cleanlist)) |
2074 |
print _("Number removed: ")+str(len(cleanlist)) |
2072 |
|
2075 |
|
2073 |
post_emerge() |
2076 |
post_emerge() |
2074 |
|
2077 |
|
Lines 2078-2084
Link Here
|
2078 |
syslist=getlist("system") |
2081 |
syslist=getlist("system") |
2079 |
if ("--pretend" in myopts) and not ("--fetchonly" in myopts): |
2082 |
if ("--pretend" in myopts) and not ("--fetchonly" in myopts): |
2080 |
print |
2083 |
print |
2081 |
print darkgreen("These are the packages that I would merge, in order:") |
2084 |
print darkgreen(_("These are the packages that I would merge, in order:")) |
2082 |
print |
2085 |
print |
2083 |
if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): |
2086 |
if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): |
2084 |
myresumeopts=portage.mtimedb["resume"]["myopts"][:] |
2087 |
myresumeopts=portage.mtimedb["resume"]["myopts"][:] |
Lines 2094-2129
Link Here
|
2094 |
else: |
2097 |
else: |
2095 |
if ("--resume" in myopts): |
2098 |
if ("--resume" in myopts): |
2096 |
del myopts[myopts.index("--resume")] |
2099 |
del myopts[myopts.index("--resume")] |
2097 |
print darkgreen("emerge: It seems we have nothing to resume...") |
2100 |
print darkgreen(_("emerge: It seems we have nothing to resume...")) |
2098 |
sys.exit(0) |
2101 |
sys.exit(0) |
2099 |
|
2102 |
|
2100 |
mydepgraph=depgraph(myaction,myopts) |
2103 |
mydepgraph=depgraph(myaction,myopts) |
2101 |
if myaction in ["system","world"]: |
2104 |
if myaction in ["system","world"]: |
2102 |
print "Calculating",myaction,"dependencies ", |
2105 |
print "Calculating",myaction,"dependencies ", |
2103 |
if not mydepgraph.xcreate(myaction): |
2106 |
if not mydepgraph.xcreate(myaction): |
2104 |
print "!!! Depgraph creation failed." |
2107 |
print _("!!! Depgraph creation failed.") |
2105 |
sys.exit(1) |
2108 |
sys.exit(1) |
2106 |
print "\b\b ...done!" |
2109 |
print "\b\b ...done!" |
2107 |
else: |
2110 |
else: |
2108 |
if not myfiles: |
2111 |
if not myfiles: |
2109 |
print "emerge: please tell me what to do." |
2112 |
print _("emerge: please tell me what to do.") |
2110 |
help() |
2113 |
help() |
2111 |
sys.exit(1) |
2114 |
sys.exit(1) |
2112 |
#we don't have any files to process; skip this step and exit |
2115 |
#we don't have any files to process; skip this step and exit |
2113 |
print "Calculating dependencies ", |
2116 |
print _("Calculating dependencies "), |
2114 |
retval,favorites=mydepgraph.select_files(myfiles) |
2117 |
retval,favorites=mydepgraph.select_files(myfiles) |
2115 |
if not retval: |
2118 |
if not retval: |
2116 |
print "\n!!! Error calculating dependencies. Please correct." |
2119 |
print _("\n!!! Error calculating dependencies. Please correct.") |
2117 |
sys.exit(1) |
2120 |
sys.exit(1) |
2118 |
print "\b\b ...done!" |
2121 |
print _("\b\b ...done!") |
2119 |
|
2122 |
|
2120 |
if ("--usepkgonly" in myopts) and mydepgraph.missingbins: |
2123 |
if ("--usepkgonly" in myopts) and mydepgraph.missingbins: |
2121 |
sys.stderr.write(red("The following binaries are not available for merging...\n")) |
2124 |
sys.stderr.write(red(_("The following binaries are not available for merging...\n"))) |
2122 |
|
2125 |
|
2123 |
if mydepgraph.missingbins: |
2126 |
if mydepgraph.missingbins: |
2124 |
for x in mydepgraph.missingbins: |
2127 |
for x in mydepgraph.missingbins: |
2125 |
sys.stderr.write(" "+str(x)+"\n") |
2128 |
sys.stderr.write(" "+str(x)+"\n") |
2126 |
sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") |
2129 |
sys.stderr.write(_("\nThese are required by '--usepkgonly' -- Terminating.\n\n")) |
2127 |
sys.exit(1) |
2130 |
sys.exit(1) |
2128 |
|
2131 |
|
2129 |
if ("--pretend" in myopts) and ("--fetchonly" not in myopts): |
2132 |
if ("--pretend" in myopts) and ("--fetchonly" not in myopts): |
Lines 2134-2141
Link Here
|
2134 |
else: |
2137 |
else: |
2135 |
if ("--buildpkgonly" in myopts): |
2138 |
if ("--buildpkgonly" in myopts): |
2136 |
if not mydepgraph.digraph.hasallzeros(): |
2139 |
if not mydepgraph.digraph.hasallzeros(): |
2137 |
print "\n!!! --buildpkgonly requires all dependencies to be merged." |
2140 |
print _("\n!!! --buildpkgonly requires all dependencies to be merged.") |
2138 |
print "!!! Cannot merge requested packages. Merge deps and try again.\n" |
2141 |
print _("!!! Cannot merge requested packages. Merge deps and try again.\n") |
2139 |
sys.exit(1) |
2142 |
sys.exit(1) |
2140 |
|
2143 |
|
2141 |
if ("--resume" in myopts): |
2144 |
if ("--resume" in myopts): |
Lines 2155-2160
Link Here
|
2155 |
if portage.mtimedb.has_key("resume"): |
2158 |
if portage.mtimedb.has_key("resume"): |
2156 |
del portage.mtimedb["resume"] |
2159 |
del portage.mtimedb["resume"] |
2157 |
if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: |
2160 |
if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: |
2158 |
print ">>> Auto-cleaning packages ..." |
2161 |
print _(">>> Auto-cleaning packages ...") |
2159 |
unmerge("clean", ["world"]) |
2162 |
unmerge("clean", ["world"]) |
2160 |
post_emerge() |
2163 |
post_emerge() |