Merged from trunk 9234:9264
authorFabian Groffen <grobian@gentoo.org>
Fri, 1 Feb 2008 19:33:43 +0000 (19:33 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 1 Feb 2008 19:33:43 +0000 (19:33 -0000)
   | 9235    | - Remove ebuild.autotools repoman check since it produces    |
   | zmedico | lots of false positives (bug #207104) and its hard to parse  |
   |         | bash - Use QA_INTERCEPTORS in ebuild.sh to implement a       |
   |         | runtime 'QA Notice' when autotools is called directly        |

   | 9236    | Remove the last traces of the ebuild.autotools check.        |
   | zmedico |                                                              |

   | 9238    | * Bug #205966 - Don't show binhost password when displaying  |
   | zmedico | the uri. * Fix a cpv variable name typo.                     |

   | 9241    | Add 'local' to the list of non_category_dirs since it's      |
   | zmedico | commonly used for layman overlays.                           |

   | 9249    | Make the autotools.eclass functions exempt from the          |
   | zmedico | autotools QA Notice.                                         |

   | 9252    | Unconditionally disable manifest1 compatibility since it's   |
   | zmedico | been dropped from the main tree and nobody needs it anymore. |

   | 9254    | Disable manifest1_compat for ebuild --force digest.          |
   | zmedico |                                                              |

   | 9256    | Bug #205718 - Fix quoting of ${INSTALL_MASK} where           |
   | zmedico | appropriate. Thanks to Ed Catmur <ed@catmur.co.uk> for this  |
   |         | patch.                                                       |

   | 9258    | Make the manifest1_compat constructor parameter default to   |
   | zmedico | False to prevent potential interference from stale old       |
   |         | digest files in overlays.                                    |

   | 9260    | Remove the manifest1 digest filter from PORTAGE_RSYNC_OPTS   |
   | zmedico | since it's no longer needed.                                 |

   | 9262    | Remove the manifest1 digest file removal code since it's no  |
   | zmedico | longer needed.                                               |

   | 9264    | portage-2.1.4.1 ================================== * If you  |
   | zmedico | have an overlay then you should remove **/files/digest-*     |
   |         | files (Manifest1) because they are no longer supported. * If |
   |         | earlier versions of portage will be used to generate         |
   |         | manifests for your overlay then you should add a file named  |
   |         | manifest1_obsolete to the root of the repository in order to |
   |         | disable generation of the Manifest1 digest files.            |

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

13 files changed:
RELEASE-NOTES
bin/ebuild
bin/ebuild.sh
bin/isolated-functions.sh
bin/misc-functions.sh
bin/repoman
cnf/make.globals
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/bintree.py
pym/portage/dbapi/porttree.py
pym/portage/manifest.py
pym/repoman/checks.py

index 6cd820756f1bb02bce53bccbbe68cdb0103dad45..e68670f77323a766d5f28f4ad5c8448d44c7afc0 100644 (file)
@@ -28,6 +28,16 @@ portage-2.2
        atoms in a set will be unmerged even if they are depended upon by other 
        packages
 
+portage-2.1.4.1
+==================================
+
+* If you have an overlay then you should remove **/files/digest-*
+  files (Manifest1) because they are no longer supported.
+* If earlier versions of portage will be used to generate manifests
+  for your overlay then you should add a file named manifest1_obsolete
+  to the root of the repository in order to disable generation of the
+  Manifest1 digest files.
+
 portage-2.1.4
 ==================================
 
index c3dcd8a32dd45569ca7bc810bfbbf40f51d4ab79..e106fdcbcf7566fc2e351c1d80d86a5dadd62884 100755 (executable)
@@ -122,7 +122,7 @@ def discard_digests(myebuild, mysettings, mydbapi):
                cpv = cat + "/" + os.path.basename(myebuild)[:-7]
                from portage.manifest import Manifest
                mf = Manifest(pkgdir, mysettings["DISTDIR"],
-                       fetchlist_dict=fetchlist_dict)
+                       fetchlist_dict=fetchlist_dict, manifest1_compat=False)
                mf.create(requiredDistfiles=None,
                        assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
                distfiles = fetchlist_dict[cpv]
index 74d79cffbe13ec2696fcabfa89975bf34e31dc38..d90b6f4076cc0cad48705e626e574baac9ac3a84 100755 (executable)
@@ -1600,9 +1600,17 @@ unset E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
 # Turn of extended glob matching so that g++ doesn't get incorrectly matched.
 shopt -u extglob
 
-QA_INTERCEPTORS="javac java-config python python-config perl grep egrep fgrep sed gcc g++ cc bash awk nawk gawk pkg-config"
+if [[ ${EBUILD_PHASE} == depend ]] ; then
+       QA_INTERCEPTORS="awk bash cc egrep fgrep g++
+               gawk gcc grep javac java-config nawk perl
+               pkg-config python python-config sed"
+elif [[ ${EBUILD_PHASE} == clean* ]] ; then
+       unset QA_INTERCEPTORS
+else
+       QA_INTERCEPTORS="autoconf automake aclocal libtoolize"
+fi
 # level the QA interceptors if we're in depend
-if hasq "depend" "${EBUILD_SH_ARGS}"; then
+if [[ -n ${QA_INTERCEPTORS} ]] ; then
        for BIN in ${QA_INTERCEPTORS}; do
                BIN_PATH=$(type -Pf ${BIN})
                if [ "$?" != "0" ]; then
@@ -1610,14 +1618,32 @@ if hasq "depend" "${EBUILD_SH_ARGS}"; then
                else
                        BODY="${BIN_PATH} \"\$@\"; return \$?"
                fi
-               FUNC_SRC="${BIN}() {
-               if [ \$ECLASS_DEPTH -gt 0 ]; then
-                       eqawarn \"QA Notice: '${BIN}' called in global scope: eclass \${ECLASS}\"
+               if [[ ${EBUILD_PHASE} == depend ]] ; then
+                       FUNC_SRC="${BIN}() {
+                               if [ \$ECLASS_DEPTH -gt 0 ]; then
+                                       eqawarn \"QA Notice: '${BIN}' called in global scope: eclass \${ECLASS}\"
+                               else
+                                       eqawarn \"QA Notice: '${BIN}' called in global scope: \${CATEGORY}/\${PF}\"
+                               fi
+                       ${BODY}
+                       }"
+               elif hasq ${BIN} autoconf automake aclocal libtoolize ; then
+                       FUNC_SRC="${BIN}() {
+                               if ! hasq \${FUNCNAME[1]} eautoreconf eaclocal _elibtoolize \\
+                                       eautoheader eautoconf eautomake autotools_run_tool \\
+                                       autotools_check_macro autotools_get_subdirs \\
+                                       autotools_get_auxdir ; then
+                                       eqawarn \"QA Notice: '${BIN}' called by \${FUNCNAME[1]}: \${CATEGORY}/\${PF}\"
+                                       eqawarn \"Use autotools.eclass instead of calling '${BIN}' directly.\"
+                               fi
+                       ${BODY}
+                       }"
                else
-                       eqawarn \"QA Notice: '${BIN}' called in global scope: \${CATEGORY}/\${PF}\"
+                       FUNC_SRC="${BIN}() {
+                               eqawarn \"QA Notice: '${BIN}' called by \${FUNCNAME[1]}: \${CATEGORY}/\${PF}\"
+                       ${BODY}
+                       }"
                fi
-               ${BODY}
-               }";
                eval "$FUNC_SRC" || echo "error creating QA interceptor ${BIN}" >&2
        done
        unset BIN_PATH BIN BODY FUNC_SRC
@@ -1741,12 +1767,6 @@ fi
 #a reasonable default for $S
 [[ -z ${S} ]] && export S=${WORKDIR}/${P}
 
-#wipe the interceptors.  we don't want saved.
-if hasq "depend" "${EBUILD_SH_ARGS}"; then
-       unset -f $QA_INTERCEPTORS
-       unset QA_INTERCEPTORS
-fi
-
 #some users have $TMP/$TMPDIR to a custom dir in their home ...
 #this will cause sandbox errors with some ./configure
 #scripts, so set it to $T.
index f28d10121deae220e5e9110e2ffcc73798615fa6..e0be5d31edd58dc7a7383145d6d77271b8490037 100755 (executable)
@@ -469,7 +469,8 @@ save_ebuild_env() {
                        debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \
                        newpdepend do_newdepend remove_path_entry killparent \
                        save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
-                       source_all_bashrcs ebuild_phase ebuild_phase_with_hooks
+                       source_all_bashrcs ebuild_phase ebuild_phase_with_hooks \
+                       ${QA_INTERCEPTORS}
 
                # portage config variables and variables set directly by portage
                unset BAD BRACKET BUILD_PREFIX COLS \
index e027095e07bb2b6ca49f61d74d79a04a091906ac..3e281cafec9929b372b5ea614bad5692b46a67a1 100644 (file)
@@ -480,7 +480,7 @@ install_mask() {
                rm -Rf ${root}/${no_inst} >&/dev/null
 
                # we also need to handle globs (*.a, *.h, etc)
-               find "${root}" -path ${no_inst} -exec rm -fR {} \; >/dev/null
+               find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
        done
        # set everything back the way we found it
        set +o noglob
@@ -517,7 +517,7 @@ preinst_mask() {
                fi
        done
 
-       install_mask "${D}" ${INSTALL_MASK}
+       install_mask "${D}" "${INSTALL_MASK}"
 
        # remove share dir if unnessesary
        if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then
@@ -630,7 +630,7 @@ preinst_selinux_labels() {
 
 dyn_package() {
        cd "${PORTAGE_BUILDDIR}/image"
-       install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
+       install_mask "${PORTAGE_BUILDDIR}/image" "${PKG_INSTALL_MASK}"
        local tar_options=""
        [ "${PORTAGE_QUIET}" == "1" ] ||  tar_options="${tar_options} -v"
        # Sandbox is disabled in case the user wants to use a symlink
index 950d9644567d1922163f35ae361c82131fac3910..6ea9f9684802bfaa3d116ff9cfa3b7781c2f2b2f 100755 (executable)
@@ -294,7 +294,6 @@ qahelp={
        "ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully",
        "ebuild.minorsyn":"This ebuild has a minor syntax error that contravenes gentoo coding style",
        "ebuild.badheader":"This ebuild has a malformed header",
-       "ebuild.autotools":"Ebuild calls autotools directly instead of using autotools.eclass",
        "metadata.missing":"Missing metadata.xml files",
        "metadata.bad":"Bad metadata.xml files",
        "virtual.versioned":"PROVIDE contains virtuals with versions",
@@ -312,7 +311,6 @@ qawarnings=[
 "ebuild.notadded",
 "ebuild.nostable",
 "ebuild.allmasked",
-"ebuild.autotools",
 "ebuild.nesteddie",
 "desktop.invalid",
 "digest.assumed",
@@ -544,13 +542,10 @@ if not kwlist:
        logging.fatal("Couldn't read KEYWORDS from arch.list")
        sys.exit(1)
 
-manifest1_compat = not os.path.exists(
-       os.path.join(portdir, "manifest1_obsolete"))
+manifest1_compat = False
 if portdir_overlay != portdir:
        kwlist.update(portage.grabfile(
                os.path.join(portdir_overlay, "profiles", "arch.list")))
-       manifest1_compat = not os.path.exists(
-               os.path.join(portdir_overlay, "manifest1_obsolete"))
 
 scanlist = utilities.FindPackagesToScan(repoman_settings, startdir, reposplit)
 scanlist.sort()
@@ -1705,52 +1700,6 @@ else:
        if options.force:
                commitmessage += ", RepoMan options: --force"
        commitmessage += ")"
-       if not manifest1_compat:
-               myfiles = myupdates + myremoved + mymanifests
-               filesdirs = set()
-               if repolevel == 3:
-                       filesdirs.add(os.path.join(".", "files"))
-               elif repolevel in (1, 2):
-                       for x in myfiles:
-                               xs = x.split(os.path.sep)
-                               if len(xs) < 4-repolevel:
-                                       continue
-                               xs = xs[0:4-repolevel]
-                               xs.append("files")
-                               filesdirs.add(os.path.join(*xs))
-               else:
-                       raise AssertionError("repolevel=%s" % str(repolevel))
-               digest_files = []
-               for x in filesdirs:
-                       dir_path = os.path.join(startdir, x)
-                       if not os.path.isdir(dir_path):
-                               continue
-                       for y in os.listdir(dir_path):
-                               if y.startswith("digest-"):
-                                       digest_files.append(os.path.join(x, y))
-               if digest_files:
-                       digest_files.sort()
-                       if options.pretend:
-                               if vcs == "cvs":
-                                       print "(rm %s)" % " ".join(digest_files)
-                                       print "(cvs remove %s)" % " ".join(digest_files)
-                               elif vcs == "svn":
-                                       print "(svn remove %s)" % " ".join(digest_files)
-                       else:
-                               if vcs == "cvs":
-                                       for x in digest_files:
-                                               os.unlink(os.path.join(startdir, x))
-                                       retval = spawn(["cvs", "remove"] + digest_files,
-                                                       env=os.environ)
-                               elif vcs == "svn":
-                                       retval = spawn(["svn", "remove"] + digest_files,
-                                                       env=os.environ)
-                               if retval != os.EX_OK:
-                                       print "!!! Exiting on vcs (shell) error code:",retval
-                                       sys.exit(retval)
-                       myremoved.extend(digest_files)
-                       myremoved = list(set(myremoved))
-                       myremoved.sort()
 
        if myupdates or myremoved:
                myfiles = myupdates + myremoved
index 9d1179c8e7c67cef11e5e31c1d0798503ca2c643..4fe1727aee8b1d74d3fc52700c29a79f56d79fa2 100644 (file)
@@ -57,7 +57,7 @@ PORTAGE_RSYNC_RETRIES="3"
 # Number of seconds rsync will wait before timing out.
 #RSYNC_TIMEOUT="180"
 
-PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
+PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
 
 # Minimal CONFIG_PROTECT
 CONFIG_PROTECT="/etc"
index d29cf612e7f463f2d3bda4273ae7749edda3adf3..00ab1cd22802cb899928f7aeea6c5dfdace75765 100644 (file)
@@ -5390,7 +5390,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                "--exclude=/distfiles",   # Exclude distfiles from consideration
                                "--exclude=/local",       # Exclude local     from consideration
                                "--exclude=/packages",    # Exclude packages  from consideration
-                               "--filter=H_**/files/digest-*", # Exclude manifest1 digests and delete on the receiving side
                        ])
 
                else:
index f39f6660560691c64a8789b1b9cf1db4d4eadb14..be28ee53f52baec00f90a8d41be3e95745afcfc3 100644 (file)
@@ -3549,8 +3549,7 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None
                                del e
                                return 0
                mytree = os.path.dirname(os.path.dirname(mysettings["O"]))
-               manifest1_compat = not os.path.exists(
-                       os.path.join(mytree, "manifest1_obsolete"))
+               manifest1_compat = False
                mf = Manifest(mysettings["O"], mysettings["DISTDIR"],
                        fetchlist_dict=fetchlist_dict, manifest1_compat=manifest1_compat)
                # Don't require all hashes since that can trigger excessive
index d48bd8541350afc332b3d0612548ee34c6728ee1..a5ff09c5e67b32f492abf63139c98b418f46a29a 100644 (file)
@@ -16,6 +16,7 @@ from portage import dep_expand, listdir, _movefile
 import portage.xpak, portage.getbinpkg
 
 import os, errno, stat
+import re
 from itertools import izip
 
 class bindbapi(fakedbapi):
@@ -536,7 +537,7 @@ class binarytree(object):
                                        except portage.exception.InvalidDependString:
                                                writemsg("!!! Invalid binary package: '%s'\n" % \
                                                        self.getname(mycpv), noiselevel=-1)
-                                               self.dbapi.cpv_remove(cpv)
+                                               self.dbapi.cpv_remove(mycpv)
                                                del pkg_paths[mycpv]
 
                                        # record location if it's non-default
@@ -648,7 +649,9 @@ class binarytree(object):
                        except (ValueError, KeyError):
                                chunk_size = 3000
                        writemsg_stdout("\n")
-                       writemsg_stdout(green("Fetching bininfo from ")+base_url+"\n")
+                       writemsg_stdout(
+                               green("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)
                        #writemsg(green("  -- DONE!\n\n"))
index 813d9229d734fda9101832a07f02624c3cd4f41c..e9fad09566996d3ea7600f9b42afb1fb3e8d22c4 100644 (file)
@@ -28,7 +28,7 @@ class portdbapi(dbapi):
        """this tree will scan a portage directory located at root (passed to init)"""
        portdbapi_instances = []
        _non_category_dirs = ["distfiles", "eclass", "licenses",
-               "metadata", "packages", "profiles", "scripts"]
+               "local", "metadata", "packages", "profiles", "scripts"]
        _non_category_dirs = re.compile(r'^(%s)$' % "|".join(_non_category_dirs))
        def __init__(self, porttree_root, mysettings=None):
                portdbapi.portdbapi_instances.append(self)
index 7f7be0fdddb6d5d601fd7d0632581f2ff348ad4a..68e50cc971e1d023d0bddf001e25caf2e8396e12 100644 (file)
@@ -99,7 +99,7 @@ class Manifest2Entry(ManifestEntry):
 class Manifest(object):
        parsers = (parseManifest2, parseManifest1)
        def __init__(self, pkgdir, distdir, fetchlist_dict=None,
-               manifest1_compat=True, from_scratch=False):
+               manifest1_compat=False, from_scratch=False):
                """ create new Manifest instance for package in pkgdir
                    and add compability entries for old portage versions if manifest1_compat == True.
                    Do not parse Manifest file if from_scratch == True (only for internal use)
index 26910198163bfcacafb0911eb25215aac76af7d4..462199722db04c43c87f902c167d635b103b544c 100644 (file)
@@ -185,19 +185,6 @@ class EbuildUselessCdS(LineCheck):
                        self.check_next_line = True
 
 
-class Autotools(LineCheck):
-       """Check for direct calls to autotools"""
-       repoman_check_name = 'ebuild.autotools'
-       re = re.compile(r'^[^#]*([^e]|^)(autoconf|automake|aclocal|libtoolize)')
-
-       def check(self, num, line):
-               """Run the check on line and return error if there is one"""
-               autotools_match = self.re.match(line)
-               if autotools_match is not None:
-                       return ("Direct calls to '%s'" % autotools_match.group(2)) + \
-                               " instead of using autotools.eclass on line: %d"
-
-
 class EbuildQuotedA(LineCheck):
        """Ensure ebuilds have no quoting around ${A}"""
 
@@ -209,7 +196,7 @@ class EbuildQuotedA(LineCheck):
                if match:
                        return "Quoted \"${A}\" on line: %d"
 
-_constant_checks = tuple((c() for c in (Autotools,
+_constant_checks = tuple((c() for c in (
        EbuildWhitespace, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
        EbuildUselessCdS, EbuildNestedDie, EbuildQuotedA)))