From 637aed8ce4bb9ff260a0ebaaa316cbb7b3c0afae Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 11 Jan 2009 14:24:06 +0000 Subject: [PATCH] Merged from trunk -r12396:12404 | 12397 | Bug #253745 - Note that you need to ensure that neither | | zmedico | protect-owned nor collision-protect are enabled if you want | | | to disable collision protection completely. | | 12398 | Bug #253800 - Fix FETCHCOMMAND examples for SRC_URI arrow | | zmedico | compatibility. | | 12399 | Bug #253745 - Remove collision-protect from the sample | | zmedico | FEATURES list since protect-owned is enabled by default now. | | 12400 | Add some blank lines around the messages that suggest | | zmedico | --without-mask and --include-dev. Thanks to Ryan Hill | | | for the suggestion. | | 12401 | Bug #253563 - Replace hardcoded green/red color strings with | | zmedico | GOOD/BAD. Thanks to Vsevolod Kozlov for | | | the initial patch. | | 12402 | Make die() to show a message indicating the repository that | | zmedico | an ebuild came from, and do it during any phase for both | | | ebuilds and binary packages. Now PORTAGE_REPO_NAME is | | | initialized inside config.setcpv() for both ebuilds and | | | binary packages, so it's always available inside ebuild.sh. | | 12403 | When merging a package from an overlay, append 'from | | zmedico | $repository' to the '>>> Emerging' message (where | | | $repository is the repo_name of the source repository). | | | Thanks to Jeroen Roovers for the suggestion. | | 12404 | Don't assume that the package metadata contains a | | zmedico | "repository" key. | svn path=/main/branches/prefix/; revision=12423 --- RELEASE-NOTES | 5 ++++- bin/isolated-functions.sh | 14 +++++++++++- bin/repoman | 21 +++++++++++++----- cnf/make.conf | 17 +++++++------- pym/_emerge/__init__.py | 15 ++++++++++--- pym/portage/__init__.py | 42 ++++++++++++++++------------------- pym/portage/data.py | 15 +++++++++++-- pym/portage/dbapi/__init__.py | 5 +++-- pym/portage/dbapi/bintree.py | 4 ++-- pym/portage/dbapi/vartree.py | 20 ++++------------- pym/portage/getbinpkg.py | 25 +++++++++++++-------- 11 files changed, 111 insertions(+), 72 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 88da034d4..b68c02d90 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -32,7 +32,10 @@ portage-2.1.6 * File collision protection is now enabled by default via make.globals with FEATURES=protect-owned. In order to protect files from be overwritten or removed a inappropriate times, it is recommended to leave protect-owned - (or the similar collision-protect feature) enabled at all times. + (or the similar collision-protect feature) enabled at all times. If you + want to disable collision protection completely (not recommended), then + you need to ensure that neither protect-owned nor collision-protect are + enabled. * The python namespace for portage has been sanitized, all portage related code is now contained within the portage namespace. External script should be updated accordingly, though links exist for backward compability. diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index b1a673aab..e85e094dc 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -118,7 +118,19 @@ die() { local overlay=${EBUILD%/*} overlay=${overlay%/*} overlay=${overlay%/*} - eerror "This ebuild is from an overlay: '${overlay}/'" + if [[ -n $PORTAGE_REPO_NAME ]] ; then + eerror "This ebuild is from an overlay named" \ + "'$PORTAGE_REPO_NAME': '${overlay}/'" + else + eerror "This ebuild is from an overlay: '${overlay}/'" + fi + elif [[ -n $PORTAGE_REPO_NAME && -f "$PORTDIR"/profiles/repo_name ]] ; then + local portdir_repo_name=$(<"$PORTDIR"/profiles/repo_name) + if [[ -n $portdir_repo_name && \ + $portdir_repo_name != $PORTAGE_REPO_NAME ]] ; then + eerror "This ebuild is from a repository" \ + "named '$PORTAGE_REPO_NAME'" + fi fi if [[ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]] ; then diff --git a/bin/repoman b/bin/repoman index 94e7275c7..8c253d24f 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1634,13 +1634,24 @@ def grouplist(mylist,seperator="/"): mygroups[xs[0]]+=[seperator.join(xs[1:])] return mygroups -if have_pmasked and not (options.without_mask or options.ignore_masked): - print bold("Note: use --without-mask to check " + \ - "KEYWORDS on dependencies of masked packages") +suggest_ignore_masked = False +suggest_include_dev = False +if have_pmasked and not (options.without_mask or options.ignore_masked): + suggest_ignore_masked = True if have_dev_keywords and not options.include_dev: - print bold("Note: use --include-dev (-d) to check " + \ - "dependencies for 'dev' profiles") + suggest_include_dev = True + +if suggest_ignore_masked or suggest_include_dev: + print + if suggest_ignore_masked: + print bold("Note: use --without-mask to check " + \ + "KEYWORDS on dependencies of masked packages") + + if suggest_include_dev: + print bold("Note: use --include-dev (-d) to check " + \ + "dependencies for 'dev' profiles") + print if options.mode != 'commit': if dofull: diff --git a/cnf/make.conf b/cnf/make.conf index fb4c258d5..64a8ecff2 100644 --- a/cnf/make.conf +++ b/cnf/make.conf @@ -126,23 +126,24 @@ # # Portage uses wget by default. Here are some settings for some alternate # downloaders -- note that you need to merge these programs first before they -# will be available. +# will be available. The command should be written to place the fetched file +# at \${DISTDIR}/\${FILE}. # # Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}" +#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" +#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" # # Using wget, ratelimiting downloads -#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" +#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" +#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" # # curl groks urls #FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}" #RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}" # # Lukemftp (BSD ftp): -#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" +#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" +#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" # # Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. # The list is a space separated list which is read left to right. If you use @@ -250,7 +251,7 @@ # FEATURES defines actions portage takes by default. This is an incremental # variable. See the make.conf(5) man page for a complete list of supported # values and their respective meanings. -#FEATURES="ccache collision-protect distcc installsources \ +#FEATURES="ccache distcc installsources \ # splitdebug test userpriv usersandbox" # CCACHE_SIZE and CCACHE_DIR are used to control the behavior of ccache, and diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index af9cdee6f..a95eb995c 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2548,9 +2548,8 @@ class EbuildBuild(CompositeTask): tree = "porttree" self._tree = tree portdb = root_config.trees[tree].dbapi - settings["EMERGE_FROM"] = pkg.type_name - settings.backup_changes("EMERGE_FROM") - settings.reset() + settings.setcpv(pkg) + settings.configdict["pkg"]["EMERGE_FROM"] = pkg.type_name ebuild_path = portdb.findname(self.pkg.cpv) self._ebuild_path = ebuild_path @@ -3233,6 +3232,7 @@ class Binpkg(CompositeTask): debug = settings.get("PORTAGE_DEBUG") == "1" portage.doebuild_environment(self._ebuild_path, "setup", settings["ROOT"], settings, debug, 1, self._bintree.dbapi) + settings.configdict["pkg"]["EMERGE_FROM"] = pkg.type_name # The prefetcher has already completed or it # could be running now. If it's running now, @@ -3776,6 +3776,15 @@ class MergeListItem(CompositeTask): colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)), colorize("GOOD", pkg.cpv)) + portdb = pkg.root_config.trees["porttree"].dbapi + portdir_repo_name = portdb._repository_map.get(portdb.porttree_root) + if portdir_repo_name: + pkg_repo_name = pkg.metadata.get("repository") + if pkg_repo_name != portdir_repo_name: + if not pkg_repo_name: + pkg_repo_name = "unknown repo" + msg += " from %s" % pkg_repo_name + if pkg.root != "/": msg += " %s %s" % (preposition, pkg.root) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index d8ddbccb2..f205a83a3 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -918,7 +918,7 @@ class config(object): _env_blacklist = [ "A", "AA", "CATEGORY", "EBUILD_PHASE", "EMERGE_FROM", "PF", "PKGUSE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE", - "PORTAGE_USE", "ROOT", "EPREFIX", "EROOT" + "PORTAGE_REPO_NAME", "PORTAGE_USE", "ROOT", "EPREFIX", "EROOT" ] _environ_whitelist = [] @@ -1936,8 +1936,12 @@ class config(object): else: aux_keys = [k for k in auxdbkeys \ if not k.startswith("UNUSED_")] + aux_keys.append("repository") for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)): pkg_configdict[k] = v + repository = pkg_configdict.pop("repository", None) + if repository is not None: + pkg_configdict["PORTAGE_REPO_NAME"] = repository for k in pkg_configdict: if k != "USE": env_configdict.pop(k, None) @@ -2545,8 +2549,9 @@ class config(object): if x[0]=="+": # Not legal. People assume too much. Complain. - writemsg(red("USE flags should not start with a '+': %s\n" % x), - noiselevel=-1) + writemsg(colorize("BAD", + "USE flags should not start with a '+': %s" % x) \ + + "\n", noiselevel=-1) x=x[1:] if not x: continue @@ -3442,7 +3447,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", if not os.access(mysettings["DISTDIR"],os.W_OK) and fetch_to_ro: if use_locks: - writemsg(red("!!! For fetching to a read-only filesystem, " + \ + writemsg(colorize("BAD", + "!!! For fetching to a read-only filesystem, " + \ "locking should be turned off.\n"), noiselevel=-1) writemsg("!!! This can be done by adding -distlocks to " + \ "FEATURES in /etc/make.conf\n", noiselevel=-1) @@ -4805,17 +4811,6 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m mysettings["ROOT"] = myroot mysettings["EROOT"] = myroot + mysettings["EPREFIX"].lstrip(os.path.sep) + os.path.sep mysettings["STARTDIR"] = getcwd() - - mysettings["PORTAGE_REPO_NAME"] = "" - # bindbapi has no getRepositories() method - if mydbapi and hasattr(mydbapi, "getRepositories"): - # do we have a origin repository name for the current package - repopath = os.sep.join(pkg_dir.split(os.path.sep)[:-2]) - for reponame in mydbapi.getRepositories(): - if mydbapi.getRepositoryPath(reponame) == repopath: - mysettings["PORTAGE_REPO_NAME"] = reponame - break - mysettings["EBUILD"] = ebuild_path mysettings["O"] = pkg_dir mysettings.configdict["pkg"]["CATEGORY"] = cat @@ -7299,16 +7294,16 @@ def deprecated_profile_check(settings=None): deprecatedfile = open(deprecated_profile_file, "r") dcontent = deprecatedfile.readlines() deprecatedfile.close() - writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n"), - noiselevel=-1) + writemsg(colorize("BAD", "\n!!! Your current profile is " + \ + "deprecated and not supported anymore.") + "\n", noiselevel=-1) if not dcontent: - writemsg(red("!!! Please refer to the Gentoo Upgrading Guide.\n"), - noiselevel=-1) + writemsg(colorize("BAD","!!! Please refer to the " + \ + "Gentoo Upgrading Guide.") + "\n", noiselevel=-1) return True newprofile = dcontent[0] - writemsg(red("!!! Please upgrade to the following profile if possible:\n"), - noiselevel=-1) - writemsg(8*" "+green(newprofile)+"\n", noiselevel=-1) + writemsg(colorize("BAD", "!!! Please upgrade to the " + \ + "following profile if possible:") + "\n", noiselevel=-1) + writemsg(8*" " + colorize("GOOD", newprofile) + "\n", noiselevel=-1) if len(dcontent) > 1: writemsg("To upgrade do the following steps:\n", noiselevel=-1) for myline in dcontent[1:]: @@ -7388,7 +7383,8 @@ def _global_updates(trees, prev_mtimes): timestamps = {} for mykey, mystat, mycontent in update_data: writemsg_stdout("\n\n") - writemsg_stdout(green("Performing Global Updates: ")+bold(mykey)+"\n") + writemsg_stdout(colorize("GOOD", + "Performing Global Updates: ")+bold(mykey)+"\n") writemsg_stdout("(Could take a couple of minutes if you have a lot of binary packages.)\n") writemsg_stdout(" " + bold(".") + "='update pass' " + \ bold("*") + "='binary update' " + bold("#") + \ diff --git a/pym/portage/data.py b/pym/portage/data.py index 28e3f2eee..c78255d8c 100644 --- a/pym/portage/data.py +++ b/pym/portage/data.py @@ -6,7 +6,7 @@ import os, sys, pwd, grp, platform from portage.util import writemsg from portage.const import rootuid, portageuser, portagegroup, EPREFIX -from portage.output import green,red +from portage.output import colorize from portage.output import create_color_func bad = create_color_func("BAD") @@ -32,7 +32,8 @@ if not lchown: lchown = missingos.lchown except ImportError: def lchown(*pos_args, **key_args): - writemsg(red("!!!") + " It seems that os.lchown does not" + \ + writemsg(colorize("BAD", "!!!") + \ + " It seems that os.lchown does not" + \ " exist. Please rebuild python.\n", noiselevel=-1) lchown() @@ -88,6 +89,16 @@ except KeyError: writemsg( red(" since it means you have thrown away yourself.\n")) writemsg( " Re-add yourself or re-bootstrap Gentoo Prefix.\n") writemsg("\n") + writemsg(colorize("BAD", + "portage: 'portage' user or group missing.") + "\n", noiselevel=-1) + writemsg( + " For the defaults, line 1 goes into passwd, " + \ + "and 2 into group.\n", noiselevel=-1) + writemsg(colorize("GOOD", + " portage:x:250:250:portage:/var/tmp/portage:/bin/false") \ + + "\n", noiselevel=-1) + writemsg(colorize("GOOD", " portage::250:portage") + "\n", + noiselevel=-1) portage_group_warning() userpriv_groups = [portage_gid] diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 435ffebbb..cdae94573 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -8,7 +8,7 @@ import os import re from portage.dep import match_from_list from portage.locks import unlockfile -from portage.output import red +from portage.output import colorize from portage.util import writemsg from portage import auxdbkeys, dep_expand from portage.versions import catpkgsplit, pkgcmp @@ -196,7 +196,8 @@ class dbapi(object): pass elif '/-MERGING-' in mypath: if os.path.exists(mypath): - writemsg(red("INCOMPLETE MERGE:")+" "+mypath+"\n", noiselevel=-1) + writemsg(colorize("BAD","INCOMPLETE MERGE:")+" %s\n" % mypath, + noiselevel=-1) else: writemsg("!!! Invalid db entry: %s\n" % mypath, noiselevel=-1) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 532062e2d..f80c3f554 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -9,7 +9,7 @@ from portage.dep import isvalidatom, isjustname, dep_getkey, match_from_list from portage.dbapi.virtual import fakedbapi from portage.exception import InvalidPackageName, \ PermissionDenied, PortageException -from portage.output import green, EOutput +from portage.output import EOutput, colorize from portage.util import ensure_dirs, normalize_path, writemsg, writemsg_stdout from portage.versions import best, catpkgsplit, catsplit from portage.update import update_dbentries @@ -747,7 +747,7 @@ class binarytree(object): chunk_size = 3000 writemsg_stdout("\n") writemsg_stdout( - green("Fetching bininfo from ") + \ + colorize("GOOD", "Fetching bininfo from ") + \ re.sub(r'//(.+):.+@(.+)/', r'//\1:*password*@\2/', base_url) + "\n") self.remotepkgs = portage.getbinpkg.dir_get_metadata( self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 47bc31851..25f600ddd 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -17,7 +17,7 @@ from portage.exception import CommandNotFound, \ InvalidData, InvalidPackageName, \ FileNotFound, PermissionDenied, UnsupportedAPIException from portage.locks import lockdir, unlockdir -from portage.output import bold, red, green +from portage.output import bold, colorize from portage.update import fixdbentries from portage.util import apply_secpass_permissions, ConfigProtect, ensure_dirs, \ writemsg, writemsg_level, write_atomic, atomic_ofstream, writedict, \ @@ -3349,8 +3349,8 @@ class dblink(object): collisions = [] destroot = normalize_path(destroot).rstrip(os.path.sep) + \ os.path.sep - showMessage("%s checking %d files for package collisions\n" % \ - (green("*"), len(mycontents))) + showMessage(" %s checking %d files for package collisions\n" % \ + (colorize("GOOD", "*"), len(mycontents))) for i, f in enumerate(mycontents): if i % 1000 == 0 and i != 0: showMessage("%d files checked ...\n" % i) @@ -3984,7 +3984,6 @@ class dblink(object): showMessage(">>> Original instance of package unmerged safely.\n") if len(others_in_slot) > 1: - from portage.output import colorize showMessage(colorize("WARN", "WARNING:") + " AUTOCLEAN is disabled. This can cause serious" + " problems due to overlapping packages.\n", @@ -4134,18 +4133,7 @@ class dblink(object): # myrealdest is mydest without the $ROOT prefix (makes a difference if ROOT!="/") myrealdest = join(sep, offset, x) # stat file once, test using S_* macros many times (faster that way) - try: - mystat = os.lstat(mysrc) - except OSError, e: - writemsg("\n") - writemsg(red("!!! ERROR: There appears to be ")+bold("FILE SYSTEM CORRUPTION.")+red(" A file that is listed\n")) - writemsg(red("!!! as existing is not capable of being stat'd. If you are using an\n")) - writemsg(red("!!! experimental kernel, please boot into a stable one, force an fsck,\n")) - writemsg(red("!!! and ensure your filesystem is in a sane state. ")+bold("'shutdown -Fr now'\n")) - writemsg(red("!!! File: ")+str(mysrc)+"\n", noiselevel=-1) - writemsg(red("!!! Error: ")+str(e)+"\n", noiselevel=-1) - return 1 - + mystat = os.lstat(mysrc) mymode = mystat[stat.ST_MODE] # handy variables; mydest is the target object on the live filesystems; # mysrc is the source object in the temporary install dir diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index f1eff0df3..6414d0c04 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -from portage.output import red, yellow, green +from portage.output import colorize from portage.cache.mappings import slot_dict_class import portage.xpak import HTMLParser @@ -23,12 +23,12 @@ except ImportError: try: import ftplib except ImportError, e: - sys.stderr.write(red("!!! CANNOT IMPORT FTPLIB: ")+str(e)+"\n") + sys.stderr.write(colorize("BAD","!!! CANNOT IMPORT FTPLIB: ")+str(e)+"\n") try: import httplib except ImportError, e: - sys.stderr.write(red("!!! CANNOT IMPORT HTTPLIB: ")+str(e)+"\n") + sys.stderr.write(colorize("BAD","!!! CANNOT IMPORT HTTPLIB: ")+str(e)+"\n") def make_metadata_dict(data): myid,myglob = data @@ -140,7 +140,9 @@ def create_conn(baseurl,conn=None): if password: conn.login(username,password) else: - sys.stderr.write(yellow(" * No password provided for username")+" '"+str(username)+"'\n\n") + sys.stderr.write(colorize("WARN", + " * No password provided for username")+" '%s'" % \ + (username,) + "\n\n") conn.login(username) conn.set_pasv(passive) conn.set_debuglevel(0) @@ -232,9 +234,12 @@ def make_http_request(conn, address, params={}, headers={}, dest=None): parts = x.split(": ",1) if parts[0] == "Location": if (rc == 301): - sys.stderr.write(red("Location has moved: ")+str(parts[1])+"\n") + sys.stderr.write(colorize("BAD", + "Location has moved: ") + str(parts[1]) + "\n") if (rc == 302): - sys.stderr.write(red("Location has temporarily moved: ")+str(parts[1])+"\n") + sys.stderr.write(colorize("BAD", + "Location has temporarily moved: ") + \ + str(parts[1]) + "\n") address = parts[1] break @@ -588,8 +593,9 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= self.last_update = cur_time self.display() def display(self): - self.out.write("\r"+yellow("cache miss: '"+str(self.misses)+"'")+\ - " --- "+green("cache hit: '"+str(self.hits)+"'")) + self.out.write("\r"+colorize("WARN", + "cache miss: '"+str(self.misses)+"'") + \ + " --- "+colorize("GOOD","cache hit: '"+str(self.hits)+"'")) self.out.flush() cache_stats = CacheStats(out) @@ -631,7 +637,8 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= if myid and myid[0]: metadata[baseurl]["data"][x] = make_metadata_dict(myid) elif verbose: - sys.stderr.write(red("!!! Failed to retrieve metadata on: ")+str(x)+"\n") + sys.stderr.write(colorize("BAD", + "!!! Failed to retrieve metadata on: ")+str(x)+"\n") sys.stderr.flush() else: cache_stats.hits += 1 -- 2.26.2