--- /usr/bin/emerge 2003-10-23 01:47:02.000000000 +0800 +++ /usr/bin/emerge 2003-11-04 00:11:03.803596136 +0800 @@ -3,6 +3,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.228 2003/10/13 07:43:38 carpaski Exp $ +import gettext +gettext.install('portage', '/usr/share/locale', unicode=1) + import os,sys os.environ["PORTAGE_CALLER"]="emerge" sys.path += ["/usr/lib/portage/pym"] @@ -19,7 +22,7 @@ try: os.nice(int(portage.settings["PORTAGE_NICENESS"])) except Exception,e: - print "!!! Failed to change nice value to '"+str(portage.settings["PORTAGE_NICENESS"])+"'" + print _("!!! Failed to change nice value to '")+str(portage.settings["PORTAGE_NICENESS"])+"'" print "!!!",e #Freeze the portdbapi for enhanced performance: @@ -93,11 +96,11 @@ if shortmapping.has_key(y): if shortmapping[y] in cmdline: print - print "*** Warning: Redundant use of",shortmapping[y] + print _("*** Warning: Redundant use of %s") % shortmapping[y] else: cmdline.append(shortmapping[y]) else: - print "!!! Error: -"+y+" is an invalid short action or option." + print _("!!! Error: -%s is an invalid short action or option.") % y sys.exit(1) else: cmdline.append(x) @@ -112,34 +115,34 @@ elif x[2:] in actions: if x[2:]=="rsync": #print - #print red("*** --rsync has been deprecated.") - #print red("*** Please use '--sync' instead.") + #print red(_("*** --rsync has been deprecated.")) + #print red(_("*** Please use '--sync' instead.")) x="--sync" if myaction: if myaction not in ["system", "world"]: myaction="--"+myaction print - print red("!!!")+green(" Multiple actions requested... Please choose one only.") - print red("!!!")+" '"+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print red("!!!")+green(_(" Multiple actions requested... Please choose one only.")) + print red("!!!")+" '"+darkgreen(myaction)+"' "+red(_("or"))+" '"+darkgreen(x)+"'" print sys.exit(1) myaction=x[2:] else: - print "!!! Error:",x,"is an invalid option." + print _("!!! Error: %s is an invalid option.") % x sys.exit(1) elif (not myaction) and (x in actions): if x not in ["system", "world"]: - #print red("*** Deprecated use of action '"+x+"'") + #print red(_("*** Deprecated use of action '%s'") % x) if x=="rsync": - #print red("*** Please use '--sync' instead.") + #print red(_("*** Please use '--sync' instead.")) x="sync" #else: - #print red("*** Please use '--"+x+"' instead.") + #print red(_("*** Please use '--"+x+"' instead.")) if myaction: print - print red("!!!")+green(" Multiple actions requested... Please choose one only.") - #print red("!!! '")+darkgreen("--"+myaction)+"' "+red("or")+" '"+darkgreen("--"+x)+"'" - print red("!!! '")+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print red("!!!")+green(_(" Multiple actions requested... Please choose one only.")) + #print red("!!! '")+darkgreen("--"+myaction)+"' "+red(_("or"))+" '"+darkgreen("--"+x)+"'" + print red("!!! '")+darkgreen(myaction)+"' "+red(_("or"))+" '"+darkgreen(x)+"'" print sys.exit(1) myaction=x @@ -150,7 +153,7 @@ myfiles.append(x) if (myaction in ["world", "system"]) and myfiles: - print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both." + print _("emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both.") sys.exit(1) # Always create packages if FEATURES=buildpkg @@ -178,12 +181,12 @@ # Also allow -U to apply --update/-u if ("--upgradeonly" in myopts) and not ("--update" in myopts): - print ">>> --upgradeonly implies --update... adding --update to options." + print _(">>> --upgradeonly implies --update... adding --update to options.") myopts.append("--update") # Also allow -l to apply --pretend/-p if ("--changelog" in myopts) and not ("--pretend" in myopts): - print ">>> --changelog implies --pretend... adding --pretend to options." + print _(">>> --changelog implies --pretend... adding --pretend to options.") myopts.append("--pretend") # Set so that configs will be merged regardless of remembered status @@ -213,7 +216,7 @@ """This gets out final log message in before we quit. As it overrides any other atexit's we have setup, we need to call them ourself.""" portage.portageexit() - emergelog(" *** terminating.") + emergelog(_(" *** terminating.")) if "notitles" not in portage.features: xtermTitleReset() atexit.register(emergeexit) @@ -225,8 +228,8 @@ def countdown(secs=5, doing="Starting"): if secs: - print ">>> Waiting",secs,"seconds before starting..." - print ">>> (Control-C to abort)...\n"+doing+" in: ", + print _(">>> Waiting %d seconds before starting...") % secs + print _(">>> (Control-C to abort)...\n%s in: ") % doing, ticks=range(secs) ticks.reverse() for sec in ticks: @@ -247,15 +250,15 @@ gcc_ver_prefix = 'gcc-' gcc_not_found_error = red( - "!!! No gcc found. You probably need to 'source /etc/profile'\n" + - "!!! to update the environment of this terminal and possibly\n" + - "!!! other terminals also." + _("!!! No gcc found. You probably need to 'source /etc/profile'\n") + + _("!!! to update the environment of this terminal and possibly\n") + + _("!!! other terminals also.") ) gcc_distcc_broken_error = green( - '!!! Using `which gcc` to gcc locate version, this may break\n' + - '!!! DISTCC, installing gcc-config and setting your current gcc\n' + - '!!! profile will fix this' + _('!!! Using `which gcc` to gcc locate version, this may break\n') + + _('!!! DISTCC, installing gcc-config and setting your current gcc\n') + + _('!!! profile will fix this') ) def fallback(): @@ -266,7 +269,7 @@ if gccout[0] != 0: print >>sys.stderr, gcc_not_found_error - gccver = "[unavailable]" + gccver = _("[unavailable]") else: gccver = gcc_ver_prefix + gccout[1] @@ -327,11 +330,11 @@ if ("--pretend" in myopts) or (myaction=="search"): if not portage.secpass: if portage.wheelgid==portage.portage_gid: - print "emerge: wheel group membership required for \"--pretend\" and search." - print "emerge: wheel group use is being deprecated. Please update group and passwd to" - print " include the portage user as noted above, and then use group portage." + print _("emerge: wheel group membership required for \"--pretend\" and search.") + print _("emerge: wheel group use is being deprecated. Please update group and passwd to") + print _(" include the portage user as noted above, and then use group portage.") else: - print "emerge: portage group membership required for \"--pretend\" and search." + print _("emerge: portage group membership required for \"--pretend\" and search.") sys.exit(1) elif "--version" in myopts: print getportageversion() @@ -349,7 +352,7 @@ else: print "myaction",myaction print "myopts",myopts - print "emerge: root access required." + print _("emerge: root access required.") sys.exit(1) if not "--pretend" in myopts: @@ -433,7 +436,7 @@ else: self.searchdesc=0 self.matches = {"pkg":[]} - print "Searching... ", + print _("Searching... "), if self.searchkey=="*": #hack for people who aren't regular expression gurus self.searchkey==".*" @@ -461,7 +464,7 @@ try: full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] except KeyError: - print "emerge: search: aux_get() failed, skipping" + print _("emerge: search: aux_get() failed, skipping") continue if self.searchre.search(full_desc): self.matches["desc"].append([full_package,masked]) @@ -522,11 +525,11 @@ mysum[0]=" [no/bad digest]" if "--quiet" not in myopts: - print " ", darkgreen("Latest version available:"),myversion + print " ", darkgreen(_("Latest version available:")),myversion print " ", self.getInstallationStatus(catpack) - print " ", darkgreen("Size of downloaded files:"),mysum[0] - print " ", darkgreen("Homepage:")+" ",homepage - print " ", darkgreen("Description:"),desc + print " ", darkgreen(_("Size of downloaded files:")),mysum[0] + print " ", darkgreen(_("Homepage:"))+" ",homepage + print " ", darkgreen(_("Description:")),desc print print # @@ -560,7 +563,7 @@ if portage.profiledir: pfile=portage.profiledir+"/packages" else: - print "!!! No profile directory; system mode unavailable." + print _("!!! No profile directory; system mode unavailable.") sys.exit(1) elif mode=="world": pfile=portage.root+"var/cache/edb/world" @@ -569,7 +572,7 @@ mylines=myfile.readlines() myfile.close() except OSError: - print "!!! Couldn't open "+pfile+"; exiting." + print _("!!! Couldn't open %s; exiting.") % pfile sys.exit(1) except IOError: #world file doesn't exist @@ -737,7 +740,7 @@ for x in ["DEPEND","RDEPEND","PDEPEND","REBUILD"]: edepend[x]=string.join(portage.portdb.aux_get(mykey,[x]), " ") except (KeyError,IOError): - print "emerge: create(): aux_get() error on",mykey+"; aborting..." + print _("emerge: create(): aux_get() error on %s; aborting...") % mykey sys.exit(1) mydep={} mp=string.join(mybigkey) @@ -773,8 +776,8 @@ elif os.path.exists(portage.settings["PKGDIR"]+"/"+x): x=portage.settings["PKGDIR"]+"/"+x else: - print "\n\n!!! Binary package '"+str(x)+"' does not exist." - print "!!! Please ensure the tbz2 exists as specified.\n" + print _("\n\n!!! Binary package '%s' does not exist.") % str(x) + print _("!!! Please ensure the tbz2 exists as specified.\n") sys.exit(1) mytbz2=xpak.tbz2(x) mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] @@ -795,7 +798,7 @@ try: self.mysd=self.select_dep(portage.root,mykey,arg=x) except Exception, e: - print "\n!!! Problem in",mykey,"dependencies." + print _("\n!!! Problem in %s dependencies.") % mykey print "!!!",e sys.exit(1) @@ -812,7 +815,7 @@ if self.missingbins == 0: print self.missingbins+=1 - print "Missing binary for:",xs[2] + print _("Missing binary for:"),xs[2] # We're true here unless we are missing binaries. return (not self.missingbins,myfavorites) @@ -839,8 +842,8 @@ "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" if "--debug" in myopts: print - print "Parent: ",myparent - print "Depstring:",depstring + print _("Parent: "),myparent + print _("Depstring:"),depstring if not arg: #processing dependencies mycheck=portage.dep_check(depstring,self.mydbapi[myroot],myuse=myuse) @@ -851,7 +854,7 @@ #we're processing a command-line argument; unconditionally merge it even if it's already merged mymerge=[depstring] if "--debug" in myopts: - print "Candidates:",mymerge + print _("Candidates:"),mymerge for x in mymerge: myk=None binpkguseflags=None @@ -878,14 +881,14 @@ alleb=portage.portdb.xmatch("match-all",x) if alleb: if "--usepkgonly" not in myopts: - print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") + print "\n!!! "+red(_("all ebuilds that could satisfy "))+green(xinfo)+red(_(" have been masked.")) if myparent: print "!!! "+red(xfrom) else: - print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) - print "!!! Either add a suitable binary package or compile from an ebuild." + print "\n!!! "+red(_("There are no packages available to satisfy: "))+green(xinfo) + print _("!!! Either add a suitable binary package or compile from an ebuild.") else: - print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"." + print _("\nemerge: there are no masked or unmasked ebuilds to satisfy ")+xinfo+"." return 0 if "--debug" in myopts: @@ -943,7 +946,7 @@ return 0 if "--debug" in myopts: - print "Exiting...",myparent + print _("Exiting..."),myparent return 1 @@ -958,11 +961,11 @@ while (not mygraph.empty()): mycurkey=mygraph.firstzero() if not mycurkey: - print "!!! Error: circular dependencies:" + print _("!!! Error: circular dependencies:") print for x in mygraph.dict.keys(): for y in mygraph.dict[x][1]: - print y,"depends on",x + print y,_("depends on"),x print sys.exit(1) splitski=string.split(mycurkey) @@ -1000,7 +1003,7 @@ #package is installed sysdict[x]=worlddict[x] else: - print "\n*** Package in world file is not installed: "+x + print _("\n*** Package in world file is not installed: ")+x mylist=[] for x in sysdict.keys(): mylist.append(sysdict[x]) @@ -1033,8 +1036,8 @@ myk=["ebuild",portage.root,myeb] if not self.create(myk): print - print "!!! Problem with",myk[0],myk[2] - print "!!! Possibly a DEPEND/*DEPEND problem." + print _("!!! Problem with"),myk[0],myk[2] + print _("!!! Possibly a DEPEND/*DEPEND problem.") print return 0 return 1 @@ -1052,9 +1055,9 @@ myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) if not myeb: if not mykey: - print "\n!!! Error: couldn't find match for",mydep + print _("\n!!! Error: couldn't find match for"),mydep else: - print "\n!!! Error: couldn't find match for",mydep,"in",mykey + print _("\n!!! Error: couldn't find match for"),mydep,_("in"),mykey print sys.exit(1) @@ -1186,17 +1189,17 @@ if mysplit[0]=="sys-apps/portage": if mysplit[1]+mysplit[2]!=portage.VERSION: if mylist.index(x)>> Recording",myfavkey,"in \"world\" favorites file..." + print _(">>> Recording"),myfavkey,_("in \"world\" favorites file...") if not "--fetchonly" in myopts: portage.writedict(myfavdict,portage.root+"var/cache/edb/world",writekey=0) @@ -1324,7 +1327,7 @@ retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1) if retval: print - print "!!! Fetch for",y,"failed, continuing..." + print _("!!! Fetch for %s failed, continuing...") % y print returnme=1 continue @@ -1441,7 +1444,7 @@ #fetch everything even if a particular download fails. if "--fetchonly" in myopts: if returnme: - print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" + print _("\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n") sys.exit(returnme) else: sys.exit(0) @@ -1453,8 +1456,8 @@ if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: if "unmerge"==unmerge_action: print - print bold("emerge unmerge")+" can only be used with specific package names, not with "+bold("world")+" or" - print bold("system")+" targets." + print bold("emerge unmerge")+_(" can only be used with specific package names, not with ")+bold("world")+_(" or") + print bold("system")+_(" targets.") print return 0 else: @@ -1470,7 +1473,7 @@ else: #we've got command-line arguments if not unmerge_files: - print "\nNo packages to unmerge have been provided.\n" + print _("\nNo packages to unmerge have been provided.\n") return 0 for x in unmerge_files: arg_parts=x.split('/') @@ -1478,13 +1481,13 @@ #possible cat/pkg or dep; treat as such candidate_catpkgs.append(x) elif unmerge_action in ["prune","clean"]: - print "\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n" + print _("\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n") continue else: # it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's # ok. if not os.path.exists(x): - print "\n!!! The path '"+x+"' doesn't exist.\n" + print _("\n!!! The path '"+x+"' doesn't exist.\n") return 0 absx=os.path.abspath(x) spabsx=absx.split("/") @@ -1496,7 +1499,7 @@ candidate_catpkgs.append("="+spabsx[4]+"/"+spabsx[5]) if "--pretend" in myopts: - print darkgreen("\n>>> These are the packages that I would unmerge:") + print darkgreen(_("\n>>> These are the packages that I would unmerge:")) pkgmap={} numselected=0 @@ -1507,7 +1510,7 @@ #add a "=" if missing mymatch=localtree.dep_match("="+x) if not mymatch: - print "\n!!! Couldn't find match for",white(x) + print _("\n!!! Couldn't find match for"),white(x) continue mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) if not pkgmap.has_key(mykey): @@ -1543,11 +1546,11 @@ numselected=numselected+1 #ok, now the last-merged package is protected, and the rest are selected if global_unmerge and not numselected: - print "\n>>> No outdated packages were found on your system.\n" + print _("\n>>> No outdated packages were found on your system.\n") return 0 if not numselected: - print "\n>>>",unmerge_action+": No packages selected for removal.\n" + print _("\n>>>",unmerge_action+": No packages selected for removal.\n") return 0 if mymatch: @@ -1652,9 +1655,9 @@ regen+=1 if not regen: - print " "+green("*")+" GNU info directory index is up-to-date." + print " "+green("*")+_(" GNU info directory index is up-to-date.") else: - print " "+green("*")+" Regenerating GNU info directory index..." + print " "+green("*")+_(" Regenerating GNU info directory index...") icount=0 badcount=0 @@ -1720,7 +1723,7 @@ if myaction in ["sync","rsync"] and (not "--help" in myopts): if "--pretend" in myopts: - print "emerge: the \"sync\" action does not support \"--pretend.\"" + print _("emerge: the \"sync\" action does not support \"--pretend.\"") sys.exit(1) emergelog(" === rsync") @@ -1734,8 +1737,8 @@ os.umask(0022) if syncuri[:8]=="rsync://": if not os.path.exists("/usr/bin/rsync"): - print "!!! /usr/bin/rsync does not exist, so rsync support is disabled." - print "!!! Type \"emerge net-misc/rsync\" to enable rsync support." + print _("!!! /usr/bin/rsync does not exist, so rsync support is disabled.") + print _("!!! Type \"emerge net-misc/rsync\" to enable rsync support.") sys.exit(1) mytimeout=180 if portage.settings.has_key("RSYNC_TIMEOUT"): @@ -1748,9 +1751,9 @@ if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]): mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] else: - print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." + print _("!!! RSYNC_EXCLUDEFROM specified, but file does not exist.") mycommand=mycommand+" "+syncuri+"/* "+myportdir - print ">>> starting rsync with "+syncuri+"..." + print _(">>> starting rsync with ")+syncuri+"..." exitcode=portage.spawn(mycommand,free=1) #exitcode=0 try: @@ -1759,63 +1762,63 @@ maxretries=3 #default number of retries retries=1 while (exitcode not in [0,1,2,3,4,11,14,20,21]) and (retries<=maxretries): - print "\n\n>>> Starting retry %d of %d"% (retries,maxretries) + print _("\n\n>>> Starting retry %d of %d")% (retries,maxretries) time.sleep(11) retries=retries+1 exitcode=portage.spawn(mycommand,free=1) if (exitcode>0): print if exitcode==1: - print darkred("!!!")+green(" Rsync has reported that there is a syntax error. Please ensure") - print darkred("!!!")+green(" that your SYNC statement is proper.") - print darkred("!!!")+green(" SYNC="+portage.settings["SYNC"]) + print darkred("!!!")+green(_(" Rsync has reported that there is a syntax error. Please ensure")) + print darkred("!!!")+green(_(" that your SYNC statement is proper.")) + print darkred("!!!")+green(_(" SYNC="+portage.settings["SYNC"])) elif exitcode==11: - print darkred("!!!")+green(" Rsync has reported that there is a File IO error. Normally") - print darkred("!!!")+green(" this means your disk is full, but can be caused by corruption") - print darkred("!!!")+green(" on the filesystem that contains PORTDIR. Please investigate") - print darkred("!!!")+green(" and try again after the problem has been fixed.") - print darkred("!!!")+green(" PORTDIR="+portage.settings["PORTDIR"]) + print darkred("!!!")+green(_(" Rsync has reported that there is a File IO error. Normally")) + print darkred("!!!")+green(_(" this means your disk is full, but can be caused by corruption")) + print darkred("!!!")+green(_(" on the filesystem that contains PORTDIR. Please investigate")) + print darkred("!!!")+green(_(" and try again after the problem has been fixed.")) + print darkred("!!!")+green(_(" PORTDIR="+portage.settings["PORTDIR"])) elif exitcode==20: - print darkred("!!!")+green(" Rsync was killed before it finished.") + print darkred("!!!")+green(_(" Rsync was killed before it finished.")) else: - print darkred("!!!")+green(" Rsync has not successfully finished. It is recommended that you keep") - print darkred("!!!")+green(" trying or that you use the 'emerge-webrsync' option if you are unable") - print darkred("!!!")+green(" to use rsync due to firewall or other restrictions. This should be a") - print darkred("!!!")+green(" temporary problem unless complications exist with your network") - print darkred("!!!")+green(" (and possibly your system's filesystem) configuration.") + print darkred("!!!")+green(_(" Rsync has not successfully finished. It is recommended that you keep")) + print darkred("!!!")+green(_(" trying or that you use the 'emerge-webrsync' option if you are unable")) + print darkred("!!!")+green(_(" to use rsync due to firewall or other restrictions. This should be a")) + print darkred("!!!")+green(_(" temporary problem unless complications exist with your network")) + print darkred("!!!")+green(_(" (and possibly your system's filesystem) configuration.")) print sys.exit(exitcode) elif syncuri[:6]=="cvs://": if not os.path.exists("/usr/bin/cvs"): - print "!!! /usr/bin/cvs does not exist, so rsync support is disabled." - print "!!! Type \"emerge dev-util/cvs\" to enable CVS support." + print _("!!! /usr/bin/cvs does not exist, so rsync support is disabled.") + print _("!!! Type \"emerge dev-util/cvs\" to enable CVS support.") sys.exit(1) cvsroot=syncuri[6:] cvsdir=os.path.dirname(myportdir) if not os.path.exists(myportdir+"/CVS"): #initial checkout - print ">>> starting initial cvs checkout with "+syncuri+"..." + print _(">>> starting initial cvs checkout with ")+syncuri+"..." if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",free=1): - print "!!! cvs login error; exiting." + print _("!!! cvs login error; exiting.") sys.exit(1) if os.path.exists(cvsdir+"/gentoo-x86"): print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." sys.exit(1) if not portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co gentoo-x86",free=1): - print "!!! cvs checkout error; exiting." + print _("!!! cvs checkout error; exiting.") sys.exit(1) if cvsdir!=myportdir: portage.movefile(cvsdir,portage.settings["PORTDIR"]) sys.exit(0) else: #cvs update - print ">>> starting cvs update with "+syncuri+"..." + print _(">>> starting cvs update with ")+syncuri+"..." sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",free=1)) else: - print "!!! rsync setting: ",syncuri,"not recognized; exiting." + print _("!!! rsync setting: %s not recognized; exiting.") % syncuri sys.exit(1) if os.path.exists(myportdir+"/metadata/cache"): - print "\n>>> Updating Portage cache... ", + print _("\n>>> Updating Portage cache... "), os.umask(0002) portage.db["/"]["porttree"].dbapi.flush_auxcache() if os.path.exists(portage.dbcachedir): @@ -1855,14 +1858,14 @@ if(mybestpv != mypvs): print - print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" - print red(" * ")+"that you update portage now, before any other packages are updated." - print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." + print red(" * ")+bold(_("An update to portage is available."))+_(" It is _highly_ recommended") + print red(" * ")+_("that you update portage now, before any other packages are updated.") + print red(" * ")+_("Please do so and then update "+bold("ALL")+" of your configuration files.") print elif myaction=="regen": emergelog(" === regen") #regenerate cache entries - print "Regenerating cache entries... " + print _("Regenerating cache entries... ") sys.stdout.flush() mynodes=portage.portdb.cp_all() for x in mynodes: @@ -1874,12 +1877,12 @@ foo=portage.portdb.aux_get(y,["DEPEND"],debug=1) except: print "\nerror processing",y+", continuing..." - print "done!" + print _("done!") # HELP action elif "config"==myaction: emergelog(" === config") print - print "Currently, \'config\' is a help option only." + print _("Currently, \'config\' is a help option only.") print # INFO action elif "info"==myaction: @@ -1893,17 +1896,17 @@ if not output[0]: print str(string.split(output[1],"\n",1)[0]), if "distcc" in portage.features: - print "[enabled]" + print _("[enabled]") else: - print "[disabled]" + print _("[disabled]") output=commands.getstatusoutput("`which ccache` -V") if not output[0]: print str(string.split(output[1],"\n",1)[0]), if "ccache" in portage.features: - print "[enabled]" + print _("[enabled]") else: - print "[disabled]" + print _("[disabled]") if "--verbose" in myopts: myvars=portage.settings.keys() @@ -1920,27 +1923,27 @@ # SEARCH action elif "search"==myaction: if not myfiles: - print "emerge: no search terms provided." + print _("emerge: no search terms provided.") else: searchinstance = search() for mysearch in myfiles: try: searchinstance.execute(mysearch) except re.error, comment: - print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) + print _("\n!!! Regular expression error in \"%s\": %s") % ( mysearch, comment ) sys.exit(1) searchinstance.output() elif "inject"==myaction: if not myfiles: - print "emerge: please specify at least one cat/pkg-ver to inject." + print _("emerge: please specify at least one cat/pkg-ver to inject.") sys.exit(1) if "--pretend" in myopts: - print "emerge: the \"inject\" action does not support \"--pretend.\"" + print _("emerge: the \"inject\" action does not support \"--pretend.\"") sys.exit(1) for x in myfiles: if x[0] in [">","<","=","!"]: - print "!!! '"+x+"' is an invalid specification." - print "!!! Must be 'category/package-version' with no other symbols." + print _("!!! '"+x+"' is an invalid specification.") + print _("!!! Must be 'category/package-version' with no other symbols.") print continue mycps=portage.catpkgsplit(x) @@ -1962,21 +1965,21 @@ # dependency of another package. World file is explicit. print - print red("*** WARNING ***")+" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION." - print red("*** WARNING ***")+" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE" - print red("*** WARNING ***")+" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO" - print red("*** WARNING ***")+" : UNMERGE ANY PACKAGES." - print red("*** WARNING ***")+" :" - print red("*** WARNING ***")+" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT." - print red("*** WARNING ***")+" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT" - print red("*** WARNING ***")+" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS." - print red("*** WARNING ***")+" :" - print red("*** WARNING ***")+" : Packages in the list that are desired may be added" - print red("*** WARNING ***")+" : directly to the world file to cause them to be ignored" - print red("*** WARNING ***")+" : by depclean and maintained in the future. BREAKAGES DUE" - print red("*** WARNING ***")+" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY" - print red("*** WARNING ***")+" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE" - print red("*** WARNING ***")+" : MISSING LIBRARY." + print red(_("*** WARNING ***"))+_(" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION.") + print red(_("*** WARNING ***"))+_(" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE") + print red(_("*** WARNING ***"))+_(" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO") + print red(_("*** WARNING ***"))+_(" : UNMERGE ANY PACKAGES.") + print red(_("*** WARNING ***"))+" :" + print red(_("*** WARNING ***"))+_(" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT.") + print red(_("*** WARNING ***"))+_(" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT") + print red(_("*** WARNING ***"))+_(" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS.") + print red(_("*** WARNING ***"))+" :" + print red(_("*** WARNING ***"))+_(" : Packages in the list that are desired may be added") + print red(_("*** WARNING ***"))+_(" : directly to the world file to cause them to be ignored") + print red(_("*** WARNING ***"))+_(" : by depclean and maintained in the future. BREAKAGES DUE") + print red(_("*** WARNING ***"))+_(" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY") + print red(_("*** WARNING ***"))+_(" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE") + print red(_("*** WARNING ***"))+_(" : MISSING LIBRARY.") print if not "--pretend" in myopts: countdown(10, ">>> Depclean") @@ -1988,9 +1991,9 @@ print "Calculating",myaction,"dependencies ", if not mydepgraph.xcreate("world"): - print "\n!!! Failed to create deptree." + print _("\n!!! Failed to create deptree.") sys.exit(1) - print "\b\b ... done!" + print _("\b\b ... done!") if ("--usepkgonly" in myopts) and mydepgraph.missingbins: sys.stderr.write(red("The following binaries are not available for merging...\n")) @@ -2003,13 +2006,13 @@ myvarlist=portage.vardbapi(portage.root).cp_all() if not syslist: - print "!!! You have no system list. Cannot determine system from world." + print _("!!! You have no system list. Cannot determine system from world.") if not worldlist: - print "!!! You have no world file. Cannot determine explicit merges." + print _("!!! You have no world file. Cannot determine explicit merges.") if not myvarlist: - print "!!! You have no /var/db tree. This is a problem." + print _("!!! You have no /var/db tree. This is a problem.") if not alldeps: - print "!!! You have no dependencies. Impossible. Bug." + print _("!!! You have no dependencies. Impossible. Bug.") if not (syslist and worldlist and myvarlist and alldeps): print @@ -2020,9 +2023,9 @@ myparts=portage.catpkgsplit(string.split(x)[2]) if not myparts: sys.stderr.write( - red("!!! There appears to be a problem with the following package:\n")+ + red(_("!!! There appears to be a problem with the following package:\n"))+ red("!!! "+str(string.split(x)[2])+"\n\n")+ - "!!! Please ensure that blocking/conflicting packages are not merged."+ + _("!!! Please ensure that blocking/conflicting packages are not merged.")+ "!!! 'emerge -p "+str(string.split(x)[2])+"\n\n") if "--pretend" not in myopts: countdown(15, "*** Continuing") @@ -2060,15 +2063,15 @@ unmerge("unmerge", cleanlist) print - print "Packages installed: "+str(len(myvarlist)) - print "Packages in world: "+str(len(worldlist)) - print "Packages in system: "+str(len(syslist)) - print "Unique package names: "+str(len(reallist)) - print "Required packages: "+str(len(alldeps)) + print _("Packages installed: ")+str(len(myvarlist)) + print _("Packages in world: ")+str(len(worldlist)) + print _("Packages in system: ")+str(len(syslist)) + print _("Unique package names: ")+str(len(reallist)) + print _("Required packages: ")+str(len(alldeps)) if "--pretend" in myopts: - print "Number to remove: "+str(len(cleanlist)) + print _("Number to remove: ")+str(len(cleanlist)) else: - print "Number removed: "+str(len(cleanlist)) + print _("Number removed: ")+str(len(cleanlist)) post_emerge() @@ -2078,7 +2081,7 @@ syslist=getlist("system") if ("--pretend" in myopts) and not ("--fetchonly" in myopts): print - print darkgreen("These are the packages that I would merge, in order:") + print darkgreen(_("These are the packages that I would merge, in order:")) print if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): myresumeopts=portage.mtimedb["resume"]["myopts"][:] @@ -2094,36 +2097,36 @@ else: if ("--resume" in myopts): del myopts[myopts.index("--resume")] - print darkgreen("emerge: It seems we have nothing to resume...") + print darkgreen(_("emerge: It seems we have nothing to resume...")) sys.exit(0) mydepgraph=depgraph(myaction,myopts) if myaction in ["system","world"]: print "Calculating",myaction,"dependencies ", if not mydepgraph.xcreate(myaction): - print "!!! Depgraph creation failed." + print _("!!! Depgraph creation failed.") sys.exit(1) print "\b\b ...done!" else: if not myfiles: - print "emerge: please tell me what to do." + print _("emerge: please tell me what to do.") help() sys.exit(1) #we don't have any files to process; skip this step and exit - print "Calculating dependencies ", + print _("Calculating dependencies "), retval,favorites=mydepgraph.select_files(myfiles) if not retval: - print "\n!!! Error calculating dependencies. Please correct." + print _("\n!!! Error calculating dependencies. Please correct.") sys.exit(1) - print "\b\b ...done!" + print _("\b\b ...done!") if ("--usepkgonly" in myopts) and mydepgraph.missingbins: - sys.stderr.write(red("The following binaries are not available for merging...\n")) + sys.stderr.write(red(_("The following binaries are not available for merging...\n"))) if mydepgraph.missingbins: for x in mydepgraph.missingbins: sys.stderr.write(" "+str(x)+"\n") - sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") + sys.stderr.write(_("\nThese are required by '--usepkgonly' -- Terminating.\n\n")) sys.exit(1) if ("--pretend" in myopts) and ("--fetchonly" not in myopts): @@ -2134,8 +2137,8 @@ else: if ("--buildpkgonly" in myopts): if not mydepgraph.digraph.hasallzeros(): - print "\n!!! --buildpkgonly requires all dependencies to be merged." - print "!!! Cannot merge requested packages. Merge deps and try again.\n" + print _("\n!!! --buildpkgonly requires all dependencies to be merged.") + print _("!!! Cannot merge requested packages. Merge deps and try again.\n") sys.exit(1) if ("--resume" in myopts): @@ -2155,6 +2158,6 @@ if portage.mtimedb.has_key("resume"): del portage.mtimedb["resume"] if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: - print ">>> Auto-cleaning packages ..." + print _(">>> Auto-cleaning packages ...") unmerge("clean", ["world"]) post_emerge()