Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 253563
Collapse All | Expand All

(-)__init__.py.old (-7 / +7 lines)
Lines 2514-2520 Link Here
2514
2514
2515
					if x[0]=="+":
2515
					if x[0]=="+":
2516
						# Not legal. People assume too much. Complain.
2516
						# Not legal. People assume too much. Complain.
2517
						writemsg(red("USE flags should not start with a '+': %s\n" % x),
2517
						writemsg(colorize("BAD","USE flags should not start with a '+': %s\n" % x),
2518
							noiselevel=-1)
2518
							noiselevel=-1)
2519
						x=x[1:]
2519
						x=x[1:]
2520
						if not x:
2520
						if not x:
Lines 3411-3417 Link Here
3411
3411
3412
	if not os.access(mysettings["DISTDIR"],os.W_OK) and fetch_to_ro:
3412
	if not os.access(mysettings["DISTDIR"],os.W_OK) and fetch_to_ro:
3413
		if use_locks:
3413
		if use_locks:
3414
			writemsg(red("!!! For fetching to a read-only filesystem, " + \
3414
			writemsg(colorize("BAD","!!! For fetching to a read-only filesystem, " + \
3415
				"locking should be turned off.\n"), noiselevel=-1)
3415
				"locking should be turned off.\n"), noiselevel=-1)
3416
			writemsg("!!! This can be done by adding -distlocks to " + \
3416
			writemsg("!!! This can be done by adding -distlocks to " + \
3417
				"FEATURES in /etc/make.conf\n", noiselevel=-1)
3417
				"FEATURES in /etc/make.conf\n", noiselevel=-1)
Lines 7200-7215 Link Here
7200
	deprecatedfile = open(deprecated_profile_file, "r")
7200
	deprecatedfile = open(deprecated_profile_file, "r")
7201
	dcontent = deprecatedfile.readlines()
7201
	dcontent = deprecatedfile.readlines()
7202
	deprecatedfile.close()
7202
	deprecatedfile.close()
7203
	writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n"),
7203
	writemsg(colorize("BAD","\n!!! Your current profile is deprecated and not supported anymore.\n"),
7204
		noiselevel=-1)
7204
		noiselevel=-1)
7205
	if not dcontent:
7205
	if not dcontent:
7206
		writemsg(red("!!! Please refer to the Gentoo Upgrading Guide.\n"),
7206
		writemsg(colorize("BAD","!!! Please refer to the Gentoo Upgrading Guide.\n"),
7207
			noiselevel=-1)
7207
			noiselevel=-1)
7208
		return True
7208
		return True
7209
	newprofile = dcontent[0]
7209
	newprofile = dcontent[0]
7210
	writemsg(red("!!! Please upgrade to the following profile if possible:\n"),
7210
	writemsg(colorize("BAD","!!! Please upgrade to the following profile if possible:\n"),
7211
		noiselevel=-1)
7211
		noiselevel=-1)
7212
	writemsg(8*" "+green(newprofile)+"\n", noiselevel=-1)
7212
	writemsg(8*" "+colorize("GOOD",newprofile)+"\n", noiselevel=-1)
7213
	if len(dcontent) > 1:
7213
	if len(dcontent) > 1:
7214
		writemsg("To upgrade do the following steps:\n", noiselevel=-1)
7214
		writemsg("To upgrade do the following steps:\n", noiselevel=-1)
7215
		for myline in dcontent[1:]:
7215
		for myline in dcontent[1:]:
Lines 7289-7295 Link Here
7289
		timestamps = {}
7289
		timestamps = {}
7290
		for mykey, mystat, mycontent in update_data:
7290
		for mykey, mystat, mycontent in update_data:
7291
			writemsg_stdout("\n\n")
7291
			writemsg_stdout("\n\n")
7292
			writemsg_stdout(green("Performing Global Updates: ")+bold(mykey)+"\n")
7292
			writemsg_stdout(colorize("GOOD","Performing Global Updates: ")+bold(mykey)+"\n")
7293
			writemsg_stdout("(Could take a couple of minutes if you have a lot of binary packages.)\n")
7293
			writemsg_stdout("(Could take a couple of minutes if you have a lot of binary packages.)\n")
7294
			writemsg_stdout("  " + bold(".") + "='update pass'  " + \
7294
			writemsg_stdout("  " + bold(".") + "='update pass'  " + \
7295
				bold("*") + "='binary update'  " + bold("#") + \
7295
				bold("*") + "='binary update'  " + bold("#") + \
(-)data.py.old (-6 / +6 lines)
Lines 28-34 Link Here
28
			lchown = missingos.lchown
28
			lchown = missingos.lchown
29
		except ImportError:
29
		except ImportError:
30
			def lchown(*pos_args, **key_args):
30
			def lchown(*pos_args, **key_args):
31
				writemsg(red("!!!") + " It seems that os.lchown does not" + \
31
				writemsg(colorize("BAD", "!!!") + " It seems that os.lchown does not" + \
32
					" exist.  Please rebuild python.\n", noiselevel=-1)
32
					" exist.  Please rebuild python.\n", noiselevel=-1)
33
			lchown()
33
			lchown()
34
34
Lines 79-93 Link Here
79
	portage_uid=0
79
	portage_uid=0
80
	portage_gid=0
80
	portage_gid=0
81
	writemsg("\n")
81
	writemsg("\n")
82
	writemsg(  red("portage: 'portage' user or group missing. Please update baselayout\n"))
82
	writemsg(  colorize("BAD","portage: 'portage' user or group missing. Please update baselayout\n"))
83
	writemsg(  red("         and merge portage user(250) and group(250) into your passwd\n"))
83
	writemsg(  colorize("BAD","         and merge portage user(250) and group(250) into your passwd\n"))
84
	writemsg(  red("         and group files. Non-root compilation is disabled until then.\n"))
84
	writemsg(  colorize("BAD","         and group files. Non-root compilation is disabled until then.\n"))
85
	writemsg(      "         Also note that non-root/wheel users will need to be added to\n")
85
	writemsg(      "         Also note that non-root/wheel users will need to be added to\n")
86
	writemsg(      "         the portage group to do portage commands.\n")
86
	writemsg(      "         the portage group to do portage commands.\n")
87
	writemsg("\n")
87
	writemsg("\n")
88
	writemsg(      "         For the defaults, line 1 goes into passwd, and 2 into group.\n")
88
	writemsg(      "         For the defaults, line 1 goes into passwd, and 2 into group.\n")
89
	writemsg(green("         portage:x:250:250:portage:/var/tmp/portage:/bin/false\n"))
89
	writemsg(colorize("GOOD","         portage:x:250:250:portage:/var/tmp/portage:/bin/false\n"))
90
	writemsg(green("         portage::250:portage\n"))
90
	writemsg(colorize("GOOD","         portage::250:portage\n"))
91
	writemsg("\n")
91
	writemsg("\n")
92
	portage_group_warning()
92
	portage_group_warning()
93
93
(-)dbapi/__init__.py.old (-2 / +2 lines)
Lines 8-14 Link Here
8
import re
8
import re
9
from portage.dep import match_from_list
9
from portage.dep import match_from_list
10
from portage.locks import unlockfile
10
from portage.locks import unlockfile
11
from portage.output import red
11
from portage.output import red, colorize
12
from portage.util import writemsg
12
from portage.util import writemsg
13
from portage import auxdbkeys, dep_expand
13
from portage import auxdbkeys, dep_expand
14
from portage.versions import catpkgsplit, pkgcmp
14
from portage.versions import catpkgsplit, pkgcmp
Lines 196-202 Link Here
196
				pass
196
				pass
197
		elif '/-MERGING-' in mypath:
197
		elif '/-MERGING-' in mypath:
198
			if os.path.exists(mypath):
198
			if os.path.exists(mypath):
199
				writemsg(red("INCOMPLETE MERGE:")+" "+mypath+"\n", noiselevel=-1)
199
				writemsg(colorize("BAD","INCOMPLETE MERGE:")+" "+mypath+"\n", noiselevel=-1)
200
		else:
200
		else:
201
			writemsg("!!! Invalid db entry: %s\n" % mypath, noiselevel=-1)
201
			writemsg("!!! Invalid db entry: %s\n" % mypath, noiselevel=-1)
202
202
(-)dbapi/bintree.py.old (-2 / +2 lines)
Lines 9-15 Link Here
9
from portage.dbapi.virtual import fakedbapi
9
from portage.dbapi.virtual import fakedbapi
10
from portage.exception import InvalidPackageName, \
10
from portage.exception import InvalidPackageName, \
11
	PermissionDenied, PortageException
11
	PermissionDenied, PortageException
12
from portage.output import green, EOutput
12
from portage.output import green, EOutput, colorize
13
from portage.util import ensure_dirs, normalize_path, writemsg, writemsg_stdout
13
from portage.util import ensure_dirs, normalize_path, writemsg, writemsg_stdout
14
from portage.versions import best, catpkgsplit, catsplit
14
from portage.versions import best, catpkgsplit, catsplit
15
from portage.update import update_dbentries
15
from portage.update import update_dbentries
Lines 737-743 Link Here
737
				chunk_size = 3000
737
				chunk_size = 3000
738
			writemsg_stdout("\n")
738
			writemsg_stdout("\n")
739
			writemsg_stdout(
739
			writemsg_stdout(
740
				green("Fetching bininfo from ") + \
740
				colorize("GOOD", "Fetching bininfo from ") + \
741
				re.sub(r'//(.+):.+@(.+)/', r'//\1:*password*@\2/', base_url) + "\n")
741
				re.sub(r'//(.+):.+@(.+)/', r'//\1:*password*@\2/', base_url) + "\n")
742
			self.remotepkgs = portage.getbinpkg.dir_get_metadata(
742
			self.remotepkgs = portage.getbinpkg.dir_get_metadata(
743
				self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
743
				self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
(-)dbapi/vartree.py.old (-10 / +9 lines)
Lines 17-23 Link Here
17
	InvalidData, InvalidPackageName, \
17
	InvalidData, InvalidPackageName, \
18
	FileNotFound, PermissionDenied, UnsupportedAPIException
18
	FileNotFound, PermissionDenied, UnsupportedAPIException
19
from portage.locks import lockdir, unlockdir
19
from portage.locks import lockdir, unlockdir
20
from portage.output import bold, red, green
20
from portage.output import bold, red, green, colorize
21
from portage.update import fixdbentries
21
from portage.update import fixdbentries
22
from portage.util import apply_secpass_permissions, ConfigProtect, ensure_dirs, \
22
from portage.util import apply_secpass_permissions, ConfigProtect, ensure_dirs, \
23
	writemsg, writemsg_level, write_atomic, atomic_ofstream, writedict, \
23
	writemsg, writemsg_level, write_atomic, atomic_ofstream, writedict, \
Lines 1816-1823 Link Here
1816
			collisions = []
1816
			collisions = []
1817
			destroot = normalize_path(destroot).rstrip(os.path.sep) + \
1817
			destroot = normalize_path(destroot).rstrip(os.path.sep) + \
1818
				os.path.sep
1818
				os.path.sep
1819
			showMessage("%s checking %d files for package collisions\n" % \
1819
			showMessage(" %s checking %d files for package collisions\n" % \
1820
				(green("*"), len(mycontents)))
1820
				(colorize("GOOD", "*"), len(mycontents)))
1821
			for i, f in enumerate(mycontents):
1821
			for i, f in enumerate(mycontents):
1822
				if i % 1000 == 0 and i != 0:
1822
				if i % 1000 == 0 and i != 0:
1823
					showMessage("%d files checked ...\n" % i)
1823
					showMessage("%d files checked ...\n" % i)
Lines 2427-2433 Link Here
2427
			showMessage(">>> Original instance of package unmerged safely.\n")
2427
			showMessage(">>> Original instance of package unmerged safely.\n")
2428
2428
2429
		if len(others_in_slot) > 1:
2429
		if len(others_in_slot) > 1:
2430
			from portage.output import colorize
2431
			showMessage(colorize("WARN", "WARNING:")
2430
			showMessage(colorize("WARN", "WARNING:")
2432
				+ " AUTOCLEAN is disabled.  This can cause serious"
2431
				+ " AUTOCLEAN is disabled.  This can cause serious"
2433
				+ " problems due to overlapping packages.\n",
2432
				+ " problems due to overlapping packages.\n",
Lines 2547-2558 Link Here
2547
				mystat = os.lstat(mysrc)
2546
				mystat = os.lstat(mysrc)
2548
			except OSError, e:
2547
			except OSError, e:
2549
				writemsg("\n")
2548
				writemsg("\n")
2550
				writemsg(red("!!! ERROR: There appears to be ")+bold("FILE SYSTEM CORRUPTION.")+red(" A file that is listed\n"))
2549
				writemsg(colorize("BAD","!!! ERROR: There appears to be ")+bold("FILE SYSTEM CORRUPTION.")+colorize("BAD"," A file that is listed\n"))
2551
				writemsg(red("!!!        as existing is not capable of being stat'd. If you are using an\n"))
2550
				writemsg(colorize("BAD","!!!        as existing is not capable of being stat'd. If you are using an\n"))
2552
				writemsg(red("!!!        experimental kernel, please boot into a stable one, force an fsck,\n"))
2551
				writemsg(colorize("BAD","!!!        experimental kernel, please boot into a stable one, force an fsck,\n"))
2553
				writemsg(red("!!!        and ensure your filesystem is in a sane state. ")+bold("'shutdown -Fr now'\n"))
2552
				writemsg(colorize("BAD","!!!        and ensure your filesystem is in a sane state. ")+bold("'shutdown -Fr now'\n"))
2554
				writemsg(red("!!!        File:  ")+str(mysrc)+"\n", noiselevel=-1)
2553
				writemsg(colorize("BAD","!!!        File:  ")+str(mysrc)+"\n", noiselevel=-1)
2555
				writemsg(red("!!!        Error: ")+str(e)+"\n", noiselevel=-1)
2554
				writemsg(colorize("BAD","!!!        Error: ")+str(e)+"\n", noiselevel=-1)
2556
				return 1
2555
				return 1
2557
2556
2558
			mymode = mystat[stat.ST_MODE]
2557
			mymode = mystat[stat.ST_MODE]
(-)getbinpkg.py.old (-8 / +8 lines)
Lines 22-33 Link Here
22
try:
22
try:
23
	import ftplib
23
	import ftplib
24
except ImportError, e:
24
except ImportError, e:
25
	sys.stderr.write(red("!!! CANNOT IMPORT FTPLIB: ")+str(e)+"\n")
25
	sys.stderr.write(colorize("BAD","!!! CANNOT IMPORT FTPLIB: ")+str(e)+"\n")
26
26
27
try:
27
try:
28
	import httplib
28
	import httplib
29
except ImportError, e:
29
except ImportError, e:
30
	sys.stderr.write(red("!!! CANNOT IMPORT HTTPLIB: ")+str(e)+"\n")
30
	sys.stderr.write(colorize("BAD","!!! CANNOT IMPORT HTTPLIB: ")+str(e)+"\n")
31
31
32
def make_metadata_dict(data):
32
def make_metadata_dict(data):
33
	myid,myglob = data
33
	myid,myglob = data
Lines 139-145 Link Here
139
			if password:
139
			if password:
140
				conn.login(username,password)
140
				conn.login(username,password)
141
			else:
141
			else:
142
				sys.stderr.write(yellow(" * No password provided for username")+" '"+str(username)+"'\n\n")
142
				sys.stderr.write(colorize("WARN"," * No password provided for username")+" '"+str(username)+"'\n\n")
143
				conn.login(username)
143
				conn.login(username)
144
			conn.set_pasv(passive)
144
			conn.set_pasv(passive)
145
			conn.set_debuglevel(0)
145
			conn.set_debuglevel(0)
Lines 231-239 Link Here
231
				parts = x.split(": ",1)
231
				parts = x.split(": ",1)
232
				if parts[0] == "Location":
232
				if parts[0] == "Location":
233
					if (rc == 301):
233
					if (rc == 301):
234
						sys.stderr.write(red("Location has moved: ")+str(parts[1])+"\n")
234
						sys.stderr.write(colorize("BAD","Location has moved: ")+str(parts[1])+"\n")
235
					if (rc == 302):
235
					if (rc == 302):
236
						sys.stderr.write(red("Location has temporarily moved: ")+str(parts[1])+"\n")
236
						sys.stderr.write(colorize("BAD","Location has temporarily moved: ")+str(parts[1])+"\n")
237
					address = parts[1]
237
					address = parts[1]
238
					break
238
					break
239
	
239
	
Lines 587-594 Link Here
587
				self.last_update = cur_time
587
				self.last_update = cur_time
588
				self.display()
588
				self.display()
589
		def display(self):
589
		def display(self):
590
			self.out.write("\r"+yellow("cache miss: '"+str(self.misses)+"'")+\
590
			self.out.write("\r"+colorize("WARN","cache miss: '"+str(self.misses)+"'")+\
591
				" --- "+green("cache hit: '"+str(self.hits)+"'"))
591
				" --- "+colorize("GOOD","cache hit: '"+str(self.hits)+"'"))
592
			self.out.flush()
592
			self.out.flush()
593
593
594
	cache_stats = CacheStats(out)
594
	cache_stats = CacheStats(out)
Lines 630-636 Link Here
630
			if myid and myid[0]:
630
			if myid and myid[0]:
631
				metadata[baseurl]["data"][x] = make_metadata_dict(myid)
631
				metadata[baseurl]["data"][x] = make_metadata_dict(myid)
632
			elif verbose:
632
			elif verbose:
633
				sys.stderr.write(red("!!! Failed to retrieve metadata on: ")+str(x)+"\n")
633
				sys.stderr.write(colorize("BAD","!!! Failed to retrieve metadata on: ")+str(x)+"\n")
634
				sys.stderr.flush()
634
				sys.stderr.flush()
635
		else:
635
		else:
636
			cache_stats.hits += 1
636
			cache_stats.hits += 1

Return to bug 253563