s=${s%usr/*}${s##*/usr/}
if [[ -e ${s} ]] ; then
vecho -ne '\a\n'
- vecho "QA Notice: missing gen_usr_ldscript for ${s##*/}\a"
+ vecho "QA Notice: missing gen_usr_ldscript for ${s##*/}"
abort="yes"
fi
fi
f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
vecho -ne '\a\n'
- vecho "QA Notice: excessive files found in the / partition\a"
+ vecho "QA Notice: excessive files found in the / partition"
vecho "${f}"
vecho -ne '\a\n'
die "static archives (*.a) and libtool library files (*.la) do not belong in /"
i=0
while [[ -n ${msgs[${i}]} ]] ; do
m=${msgs[$((i++))]}
- f=$(grep "${m}" "${PORTAGE_LOG_FILE}")
+ # force C locale to work around slow unicode locales #160234
+ f=$(LC_ALL=C grep "${m}" "${PORTAGE_LOG_FILE}")
if [[ -n ${f} ]] ; then
vecho -ne '\a\n'
vecho "QA Notice: Package has poor programming practices which may compile"
while "--ignore-masked" in myoptions:
myoptions.remove("--ignore-masked")
+from portage import normalize_path
isCvs=False
myreporoot=None
if os.path.isdir("CVS"):
def have_profile_dir(path, maxdepth=3):
while path != "/" and maxdepth:
if os.path.exists(path + "/profiles/package.mask"):
- return path
- path = os.path.normpath(path + "/..")
+ return normalize_path(path)
+ path = normalize_path(path + "/..")
maxdepth -= 1
portdir=None
# orient itself if the user has symlinks in their portage tree structure.
# We use os.environ["PWD"], if available, to get the non-canonical path of
# the current working directory (from the shell).
- mydir = os.path.normpath(os.environ["PWD"])
+ mydir = os.environ["PWD"]
+mydir = normalize_path(mydir)
if mydir[-1] != "/":
mydir += "/"
if not portdir:
portdir = repoman_settings["PORTDIR"]
-if portdir[-1] == "/":
- portdir = portdir[:-1]
-if portdir_overlay[-1] == "/":
- portdir_overlay = portdir_overlay[:-1]
+portdir = normalize_path(portdir)
+portdir_overlay = normalize_path(portdir_overlay)
os.environ["PORTDIR"] = portdir
if portdir_overlay != portdir:
leading_spaces = re.compile(r'^[\S\t]')
trailing_whitespace = re.compile(r'.*([\S]$)')
readonly_assignment = re.compile(r'^\s*(export\s+)?(A|CATEGORY|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR|FEATURES|USE)=')
- continuation_symbol = re.compile(r'(.*[ ]+[\\][ ].*)')
- line_continuation_quoted = re.compile(r'(\"|\')(([\w ,:;#\[\]\.`=/|\$\^\*{}()\'-])|(\\.))*\1')
line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
linenum=0
previous_line = None
myerrormsg = "Readonly variable assignment to %s on line %d" % (match.group(2), linenum)
stats["variable.readonly"] += 1
fails["variable.readonly"].append(x+"/"+y+".ebuild: %s" % myerrormsg)
- # Line continuation check
- match = continuation_symbol.match(line)
- if match:
- #Excluded lines not even containing a " \" match. Good!
- line = re.sub(line_continuation_quoted,"\"\"",line)
- #line has been edited to collapsed "" and '' quotes to "". Good!
- match = continuation_symbol.match(line)
- if match:
- #Again exclude lines not even containing a " \" match. Good!
- #This repetition is done for a slight performance increase
- match = line_continuation.match(line)
- if not match:
- #Line has a line continuation error. Bad!
- myerrormsg = "Line continuation (\"\\\") Syntax Error. Line %d" % linenum
- stats["ebuild.majorsyn"] +=1
- fails["ebuild.majorsyn"].append(x+"/"+y+".ebuild: %s" % myerrormsg)
previous_line = line
del previous_line
userpriv_groups = [portage_gid]
if secpass >= 2:
- for g in grp.getgrall():
- if "portage" in g[3]:
- userpriv_groups.append(g[2])
- userpriv_groups = list(set(userpriv_groups))
+ # Get a list of group IDs for the portage user. Do not use grp.getgrall()
+ # since it is known to trigger spurious SIGPIPE problems with nss_ldap.
+ from commands import getstatusoutput
+ mystatus, myoutput = getstatusoutput("id -G " + portage_const.portageuser)
+ if mystatus == os.EX_OK:
+ for x in myoutput.split():
+ try:
+ userpriv_groups.append(int(x))
+ except ValueError:
+ pass
+ del x
+ userpriv_groups = list(set(userpriv_groups))
+ del getstatusoutput, mystatus, myoutput