From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1L1F1D-0005bm-QK for garchives@archives.gentoo.org; Sat, 15 Nov 2008 06:52:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6850E0212; Sat, 15 Nov 2008 06:52:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 92A11E0212 for ; Sat, 15 Nov 2008 06:52:32 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 8AE62643CE for ; Sat, 15 Nov 2008 06:52:30 +0000 (UTC) Received: from zmedico by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1L1F1C-0007zG-7l for gentoo-commits@lists.gentoo.org; Sat, 15 Nov 2008 06:52:30 +0000 To: gentoo-commits@lists.gentoo.org From: "Zac Medico (zmedico)" Subject: [gentoo-commits] portage r11936 - main/branches/2.1.6/pym/_emerge X-VCS-Repository: portage X-VCS-Revision: 11936 X-VCS-Files: main/branches/2.1.6/pym/_emerge/__init__.py X-VCS-Directories: main/branches/2.1.6/pym/_emerge X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico Content-Type: text/plain; charset=UTF-8 Message-Id: Sender: Zac Medico Date: Sat, 15 Nov 2008 06:52:30 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 955306e5-a848-4b47-ae82-5ce8d9bf217c X-Archives-Hash: 65d45759158ea0bd3db42e46212debe1 Author: zmedico Date: 2008-11-15 06:52:29 +0000 (Sat, 15 Nov 2008) New Revision: 11936 Modified: main/branches/2.1.6/pym/_emerge/__init__.py Log: Bug #236207 - Replace some hardcoded colors with color codes, and use portage.output.EOutput() where appropriate. (trunk r11935) Modified: main/branches/2.1.6/pym/_emerge/__init__.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/branches/2.1.6/pym/_emerge/__init__.py 2008-11-15 06:50:51 UTC (= rev 11935) +++ main/branches/2.1.6/pym/_emerge/__init__.py 2008-11-15 06:52:29 UTC (= rev 11936) @@ -5334,7 +5334,10 @@ print "- "+pkg.cpv+" ("+", ".join(mreasons)+")" =20 elif masked_packages: - print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+re= d(" have been masked.") + print "\n!!! " + \ + colorize("BAD", "All ebuilds that could satisfy ") + \ + colorize("INFORM", xinfo) + \ + colorize("BAD", " have been masked.") print "!!! One of the following masked packages is required to comple= te your request:" have_eapi_mask =3D show_masked_packages(masked_packages) if have_eapi_mask: @@ -10877,6 +10880,7 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval): =20 if os.path.exists("/usr/bin/install-info"): + out =3D portage.output.EOutput() regen_infodirs=3D[] for z in infodirs: if z=3D=3D'': @@ -10889,13 +10893,16 @@ regen_infodirs.append(inforoot) =20 if not regen_infodirs: - portage.writemsg_stdout("\n "+green("*")+" GNU info directory index i= s up-to-date.\n") + portage.writemsg_stdout("\n") + out.einfo("GNU info directory index is up-to-date.") else: - portage.writemsg_stdout("\n "+green("*")+" Regenerating GNU info dire= ctory index...\n") + portage.writemsg_stdout("\n") + out.einfo("Regenerating GNU info directory index...") =20 dir_extensions =3D ("", ".gz", ".bz2") icount=3D0 badcount=3D0 + errmsg =3D "" for inforoot in regen_infodirs: if inforoot=3D=3D'': continue @@ -10903,7 +10910,7 @@ if not os.path.isdir(inforoot) or \ not os.access(inforoot, os.W_OK): continue - errmsg =3D "" + file_list =3D os.listdir(inforoot) file_list.sort() dir_file =3D os.path.join(inforoot, "dir") @@ -10973,11 +10980,12 @@ prev_mtimes[inforoot] =3D long(os.stat(inforoot).st_mtime) =20 if badcount: - print " "+yellow("*")+" Processed",icount,"info files;",badcount,"er= rors." - print errmsg + out.eerror("Processed %d info files; %d errors." % \ + (icount, badcount)) + writemsg_level(errmsg, level=3Dlogging.ERROR, noiselevel=3D-1) else: if icount > 0: - print " "+green("*")+" Processed",icount,"info files." + out.einfo("Processed %d info files." % (icount,)) =20 =20 def display_news_notification(root_config, myopts): @@ -11212,6 +11220,7 @@ xterm_titles =3D "notitles" not in settings.features emergelog(xterm_titles, " =3D=3D=3D sync") myportdir =3D settings.get("PORTDIR", None) + out =3D portage.output.EOutput() if not myportdir: sys.stderr.write("!!! PORTDIR is undefined. Is /etc/make.globals miss= ing?\n") sys.exit(1) @@ -11541,26 +11550,27 @@ ">>> Exceeded PORTAGE_RSYNC_RETRIES: %s\n" % maxretries) sys.exit(1) elif (exitcode>0): - print + msg =3D [] if exitcode=3D=3D1: - print darkred("!!!")+green(" Rsync has reported that there is a synt= ax error. Please ensure") - print darkred("!!!")+green(" that your SYNC statement is proper.") - print darkred("!!!")+green(" SYNC=3D"+settings["SYNC"]) + msg.append("Rsync has reported that there is a syntax error. Please = ensure") + msg.append("that your SYNC statement is proper.") + msg.append("SYNC=3D" + settings["SYNC"]) elif exitcode=3D=3D11: - 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 b= e caused by corruption") - print darkred("!!!")+green(" on the filesystem that contains PORTDIR= . Please investigate") - print darkred("!!!")+green(" and try again after the problem has bee= n fixed.") - print darkred("!!!")+green(" PORTDIR=3D"+settings["PORTDIR"]) + msg.append("Rsync has reported that there is a File IO error. Normal= ly") + msg.append("this means your disk is full, but can be caused by corru= ption") + msg.append("on the filesystem that contains PORTDIR. Please investig= ate") + msg.append("and try again after the problem has been fixed.") + msg.append("PORTDIR=3D" + settings["PORTDIR"]) elif exitcode=3D=3D20: - print darkred("!!!")+green(" Rsync was killed before it finished.") + msg.append("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-webr= sync' option if you are unable") - print darkred("!!!")+green(" to use rsync due to firewall or other r= estrictions. 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 + msg.append("Rsync has not successfully finished. It is recommended t= hat you keep") + msg.append("trying or that you use the 'emerge-webrsync' option if y= ou are unable") + msg.append("to use rsync due to firewall or other restrictions. This= should be a") + msg.append("temporary problem unless complications exist with your n= etwork") + msg.append("(and possibly your system's filesystem) configuration.") + for line in msg: + out.eerror(line) sys.exit(exitcode) elif syncuri[:6]=3D=3D"cvs://": if not os.path.exists("/usr/bin/cvs"):