Merged from trunk 5460:5471
authorFabian Groffen <grobian@gentoo.org>
Sat, 6 Jan 2007 10:39:59 +0000 (10:39 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 6 Jan 2007 10:39:59 +0000 (10:39 -0000)
As a workaround for bug #147625, spawn `id -g portage` in order to get a list of
groups for the portage user without the need to call grp.getgrall().
(prefix uses portage_const.portageuser instead of hardcoded value)

Use -G instead of -g (typo from the previous commit).

Make repoman use portage.normalize_path instead of os.path.normpath.  This might
solve an issue with incorrect repolevel detection that was reported by drizzt.

For python-2.3 compatibility, don't pass an iterable into dict.update().

For bug #160299, make sure that emerge sees a somewhat valid COUNTER even when
the counter is missing.

Fix shell glob logic that leads to false positives.  Thanks to Flameeyes for
reporting.

Fix one more potential false glob match.

revert previous changes ... ruby.eclass is wrongly polluting env with nullglob (SpankMan)

force C locale for now when parsing gcc log files #160234 (SpankMan)

For bug #160310, allow \ inside `` quotes in order to prevent a false Line
continuation ("\") Syntax Error.

For bug #160310, remove the line continuation syntax check since it's still
possible for it to generate false positives.

svn path=/main/branches/prefix/; revision=5476

bin/emerge
bin/misc-functions.sh
bin/repoman
pym/portage.py
pym/portage_data.py

index a314fb4411d8c5ce0853a9d2afcc9fa9ca324a65..7ea044164f85e51c295824ed032df25de205e9e9 100755 (executable)
@@ -745,6 +745,7 @@ class FakeVartree(portage.vartree):
                                        mycounter = long(metadata["COUNTER"])
                                except ValueError:
                                        mycounter = 0
+                                       metadata["COUNTER"] = str(mycounter)
                                other_counter = slot_counters.get(myslot_atom, None)
                                if other_counter is not None:
                                        if other_counter > mycounter:
index 1975e72e072c840f87b40e5bdc98d602f0b39d61..49f392b5612ce3da1c4e6222565e78da6dfb122e 100644 (file)
@@ -274,7 +274,7 @@ install_qa_check() {
                        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
@@ -285,7 +285,7 @@ install_qa_check() {
        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 /"
@@ -317,7 +317,8 @@ install_qa_check() {
                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"
index 9c95e06cccf6f9c1b8ae0ddc294035dda828fde4..d28fd2849df0716d25693f2d7ec9282a27b8b232 100755 (executable)
@@ -398,6 +398,7 @@ if mymode == "commit":
        while "--ignore-masked" in myoptions:
                myoptions.remove("--ignore-masked")
 
+from portage import normalize_path
 isCvs=False
 myreporoot=None
 if os.path.isdir("CVS"):
@@ -475,8 +476,8 @@ if not "--pretend" in myoptions and not isCvs and not isSvn:
 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
@@ -488,7 +489,8 @@ if "PWD" in os.environ and os.environ["PWD"] != mydir and \
        # 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 += "/"
 
@@ -519,10 +521,8 @@ if not portdir_overlay:
 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:
@@ -1412,8 +1412,6 @@ for x in scanlist:
                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
@@ -1467,22 +1465,6 @@ for x in scanlist:
                                                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
 
index 17ead01380813e5252ec39c84ec93080462e383b..cdac6bda05b2c481730ac06e8ce845197dd09305 100644 (file)
@@ -5144,7 +5144,8 @@ class vardbapi(dbapi):
                if pull_me:
                        # pull any needed data and cache it
                        aux_keys = list(pull_me)
-                       mydata.update(izip(aux_keys, self._aux_get(mycpv, aux_keys)))
+                       for k, v in izip(aux_keys, self._aux_get(mycpv, aux_keys)):
+                               mydata[k] = v
                        if not cache_valid:
                                cache_data = {}
                                for aux_key in self._aux_cache_keys:
index 76316bd2e48a260eb6fc9dff1061755f147a0aff..71aefacf6a6de8ff61864d8d6c812841dabc4793 100644 (file)
@@ -121,7 +121,16 @@ except KeyError:
 
 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