# variables out and discards them. See bug #190128.
filter_readonly_variables() {
local x filtered_vars
- local readonly_bash_vars="BASHPID DIRSTACK EUID FUNCNAME
- GROUPS PIPESTATUS PPID SHELLOPTS UID"
+ local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
from urllib.parse import urlparse as urllib_parse_urlparse
except ImportError:
from urlparse import urlparse as urllib_parse_urlparse
+import stat
import sys
import portage
from portage import os
pass
else:
try:
- local_mtime = long(os.stat(self.pkg_path).st_mtime)
+ local_mtime = os.stat(self.pkg_path)[stat.ST_MTIME]
except OSError:
pass
else:
False otherwise.
"""
- term_type = os.environ.get("TERM", "vt100")
+ term_type = os.environ.get("TERM", "").strip()
+ if not term_type:
+ return False
tigetstr = None
try:
if ec in updated_ec_mtimes:
continue
ec_path = os.path.join(ec_dir, ec + ".eclass")
- current_mtime = long(os.stat(ec_path).st_mtime)
+ current_mtime = os.stat(ec_path)[stat.ST_MTIME]
if current_mtime != ec_mtime:
os.utime(ec_path, (ec_mtime, ec_mtime))
updated_ec_mtimes[ec] = ec_mtime
import logging
import signal
+import stat
import sys
import textwrap
import platform
continue
inforoot=normpath(root+z)
if os.path.isdir(inforoot):
- infomtime = long(os.stat(inforoot).st_mtime)
+ infomtime = os.stat(inforoot)[stat.ST_MTIME]
if inforoot not in prev_mtimes or \
prev_mtimes[inforoot] != infomtime:
regen_infodirs.append(inforoot)
del e
#update mtime so we can potentially avoid regenerating.
- prev_mtimes[inforoot] = long(os.stat(inforoot).st_mtime)
+ prev_mtimes[inforoot] = os.stat(inforoot)[stat.ST_MTIME]
if badcount:
out.eerror("Processed %d info files; %d errors." % \
for lib_dir in portage.util.unique_array(specials["LDPATH"]+['usr/lib','usr/lib64','usr/lib32','lib','lib64','lib32']):
x = os.path.join(target_root, lib_dir.lstrip(os.sep))
try:
- newldpathtime = long(os.stat(x).st_mtime)
+ newldpathtime = os.stat(x)[stat.ST_MTIME]
lib_dirs.add(normalize_path(x))
except OSError as oe:
if oe.errno == errno.ENOENT:
if len(errors) == 0:
# Update our internal mtime since we
# processed all of our directives.
- timestamps[mykey] = long(mystat.st_mtime)
+ timestamps[mykey] = mystat[stat.ST_MTIME]
else:
for msg in errors:
writemsg("%s\n" % msg, noiselevel=-1)
if '_mtime_' not in d:
# Backward compatibility with old cache
# that uses mtime mangling.
- d['_mtime_'] = long(_os.fstat(myf.fileno()).st_mtime)
+ d['_mtime_'] = _os.fstat(myf.fileno())[stat.ST_MTIME]
return d
finally:
myf.close()
raise cache_errors.CacheCorruption(cpv, e)
try:
- d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
+ d["_mtime_"] = os.fstat(myf.fileno())[stat.ST_MTIME]
except OSError as e:
myf.close()
raise cache_errors.CacheCorruption(cpv, e)
import errno
import re
+import stat
import sys
from portage import os
from portage import _encodings
except EnvironmentError:
pass
else:
- existing_mtime = long(existing_st.st_mtime)
+ existing_mtime = existing_st[stat.ST_MTIME]
if values['_mtime_'] == existing_mtime and \
existing_content == new_content:
return
import codecs
import re
+import stat
import sys
import time
for file in apply_cvsignore_filter(os.listdir(mydir)):
if file=="CVS":
continue
- if file=="digest-framerd-2.4.3":
- print(mydir,file)
if os.path.isdir(mydir+"/"+file):
if file not in entries["dirs"]:
entries["dirs"][file]={"dirs":{},"files":{}}
else:
entries["dirs"][file]["status"]=["exists"]
elif os.path.isfile(mydir+"/"+file):
- if file=="digest-framerd-2.4.3":
- print("isfile")
if file not in entries["files"]:
entries["files"][file]={"revision":"","date":"","flags":"","tags":""}
if "status" in entries["files"][file]:
- if file=="digest-framerd-2.4.3":
- print("has status")
if "exists" not in entries["files"][file]["status"]:
- if file=="digest-framerd-2.4.3":
- print("no exists in status")
entries["files"][file]["status"]+=["exists"]
else:
- if file=="digest-framerd-2.4.3":
- print("no status")
entries["files"][file]["status"]=["exists"]
try:
- if file=="digest-framerd-2.4.3":
- print("stat'ing")
mystat=os.stat(mydir+"/"+file)
- mytime = time.asctime(time.gmtime(long(mystat.st_mtime)))
+ mytime = time.asctime(time.gmtime(mystat[stat.ST_MTIME]))
if "status" not in entries["files"][file]:
- if file=="digest-framerd-2.4.3":
- print("status not set")
entries["files"][file]["status"]=[]
- if file=="digest-framerd-2.4.3":
- print("date:",entries["files"][file]["date"])
- print("sdate:",mytime)
if mytime==entries["files"][file]["date"]:
entries["files"][file]["status"]+=["current"]
- if file=="digest-framerd-2.4.3":
- print("stat done")
-
- del mystat
except SystemExit as e:
raise
except Exception as e:
match = None
for d in possibilities:
try:
- if long(d["MTIME"]) != long(s.st_mtime):
+ if long(d["MTIME"]) != s[stat.ST_MTIME]:
continue
except (KeyError, ValueError):
continue
d = metadata.get(mycpv, {})
if d:
try:
- if long(d["MTIME"]) != long(s.st_mtime):
+ if long(d["MTIME"]) != s[stat.ST_MTIME]:
d.clear()
except (KeyError, ValueError):
d.clear()
d["CPV"] = mycpv
d["SLOT"] = slot
- d["MTIME"] = str(long(s.st_mtime))
+ d["MTIME"] = str(s[stat.ST_MTIME])
d["SIZE"] = str(s.st_size)
d.update(zip(self._pkgindex_aux_keys,
d["CPV"] = cpv
st = os.stat(pkg_path)
- d["MTIME"] = str(long(st.st_mtime))
+ d["MTIME"] = str(st[stat.ST_MTIME])
d["SIZE"] = str(st.st_size)
rel_path = self._pkg_paths[cpv]
mydata["repository"] = self._repository_map.get(mylocation, "")
mydata["INHERITED"] = ' '.join(mydata.get("_eclasses_", []))
- mydata["_mtime_"] = long(st.st_mtime)
+ mydata["_mtime_"] = st[stat.ST_MTIME]
eapi = mydata.get("EAPI")
if not eapi:
import re, shutil, stat, errno, copy, subprocess
import logging
import os as _os
+import stat
import sys
import time
import warnings
if mysplit[0] == '*':
mysplit[0] = mysplit[0][1:]
try:
- mystat = os.stat(self.getpath(mysplit[0]))[stat.ST_MTIME]
+ mystat = os.stat(self.getpath(mysplit[0])).st_mtime
except OSError:
mystat = 0
if use_cache and mycp in self.cpcache:
if e.errno != errno.ENOENT:
raise
raise KeyError(mycpv)
- mydir_mtime = long(mydir_stat.st_mtime)
+ mydir_mtime = mydir_stat[stat.ST_MTIME]
pkg_data = self._aux_cache["packages"].get(mycpv)
pull_me = cache_these.union(wants)
mydata = {"_mtime_" : mydir_mtime}
results = []
for x in wants:
if x == "_mtime_":
- results.append(long(st.st_mtime))
+ results.append(st[stat.ST_MTIME])
continue
try:
myf = codecs.open(
cfgprot = cfgfiledict["IGNORE"]
if not moveme:
zing = "---"
- mymtime = long(mystat.st_mtime)
+ mymtime = mystat[stat.ST_MTIME]
else:
moveme = 1
cfgprot = 1
__all__ = ["cache"]
+import stat
import sys
import warnings
from portage.util import normalize_path
if not y.endswith(".eclass"):
continue
try:
- mtime = long(os.stat(os.path.join(x, y)).st_mtime)
+ mtime = os.stat(os.path.join(x, y))[stat.ST_MTIME]
except OSError:
continue
ys=y[:-eclass_len]
import codecs
import errno
import re
+import stat
import sys
from portage import os
file_path = os.path.join(updpath, myfile)
mystat = os.stat(file_path)
if file_path not in prev_mtimes or \
- long(prev_mtimes[file_path]) != long(mystat.st_mtime):
+ long(prev_mtimes[file_path]) != mystat[stat.ST_MTIME]:
content = codecs.open(_unicode_encode(file_path,
encoding=_encodings['fs'], errors='strict'),
mode='r', encoding=_encodings['repo.content'], errors='replace'
re = re.compile(r'^\s*MAKEOPTS=(\'|")?.*-j\s*1\b')
error = errors.EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS
+class NoAsNeeded(LineCheck):
+ """Check for calls to the no-as-needed function."""
+ repoman_check_name = 'upstream.workaround'
+ re = re.compile(r'.*\$\(no-as-needed\)')
+ error = errors.NO_AS_NEEDED
+
class DeprecatedBindnowFlags(LineCheck):
"""Check for calls to the deprecated bindnow-flags function."""
repoman_check_name = 'ebuild.minorsyn'
EbuildUselessCdS, EbuildNestedDie,
EbuildPatches, EbuildQuotedA, EapiDefinition,
IUseUndefined, InheritAutotools,
- EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
+ EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars)))
EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEOPTS=-j1 on line: %d)'
DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'
EAPI_DEFINED_AFTER_INHERIT = 'EAPI defined after inherit on line: %d'
+NO_AS_NEEDED = 'Upstream asneeded linking bug (no-as-needed on line: %d)'