for x in pkgs:
if not isvalidatom(x):
del(pkgs[x])
- writemsg("--- Invalid atom in %s: %s\n" % (myfilename, x))
+ writemsg("--- Invalid atom in %s: %s\n" % (myfilename, x),
+ noiselevel=-1)
return pkgs
def grabfile_package(myfilename, compatlevel=0, recursive=0):
if pkg[0] == "*": # Kill this so we can deal the "packages" file too
pkg = pkg[1:]
if not isvalidatom(pkg):
- writemsg("--- Invalid atom in %s: %s\n" % (myfilename, pkgs[x]))
+ writemsg("--- Invalid atom in %s: %s\n" % (myfilename, pkgs[x]),
+ noiselevel=-1)
del(pkgs[x])
return pkgs
#unexpected end of file
#lex.error_leader(self.filename,lex.lineno)
if not tolerant:
- writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n")
+ writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n",
+ noiselevel=-1)
raise Exception("ParseError: Unexpected EOF: "+str(mycfg)+": on/before line "+str(lex.lineno))
else:
return mykeys
#invalid token
#lex.error_leader(self.filename,lex.lineno)
if not tolerant:
- writemsg("!!! Invalid token (not \"=\") "+str(equ)+"\n")
+ writemsg("!!! Invalid token (not \"=\") "+str(equ)+"\n",
+ noiselevel=-1)
raise Exception("ParseError: Invalid token (not '='): "+str(mycfg)+": line "+str(lex.lineno))
else:
return mykeys
#unexpected end of file
#lex.error_leader(self.filename,lex.lineno)
if not tolerant:
- writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n")
+ writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n",
+ noiselevel=-1)
raise portage_exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno))
else:
return mykeys
# go unnoticed. Callers can pass in a quiet instance.
def onerror(e):
if isinstance(e, OperationNotPermitted):
- writemsg("Operation Not Permitted: %s\n" % str(e))
+ writemsg("Operation Not Permitted: %s\n" % str(e),
+ noiselevel=-1)
elif isinstance(e, FileNotFound):
- writemsg("File Not Found: '%s'\n" % str(e))
+ writemsg("File Not Found: '%s'\n" % str(e), noiselevel=-1)
else:
raise
except (OSError, IOError), e:
if canonical_path == filename:
raise
- writemsg("!!! Failed to open file: '%s'\n" % tmp_name)
- writemsg("!!! %s\n" % str(e))
+ writemsg("!!! Failed to open file: '%s'\n" % tmp_name,
+ noiselevel=-1)
+ writemsg("!!! %s\n" % str(e), noiselevel=-1)
self._real_name = filename
tmp_name = "%s.%i" % (filename, os.getpid())