From 87a9554206c3b95ea82f31add1a21e985c4864b8 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 1 Feb 2008 19:33:43 +0000 Subject: [PATCH] Merged from trunk 9234:9264 | 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 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 --- RELEASE-NOTES | 10 +++++++ bin/ebuild | 2 +- bin/ebuild.sh | 48 ++++++++++++++++++++++--------- bin/isolated-functions.sh | 3 +- bin/misc-functions.sh | 6 ++-- bin/repoman | 53 +---------------------------------- cnf/make.globals | 2 +- pym/_emerge/__init__.py | 1 - pym/portage/__init__.py | 3 +- pym/portage/dbapi/bintree.py | 7 +++-- pym/portage/dbapi/porttree.py | 2 +- pym/portage/manifest.py | 2 +- pym/repoman/checks.py | 15 +--------- 13 files changed, 61 insertions(+), 93 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6cd820756..e68670f77 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 ================================== diff --git a/bin/ebuild b/bin/ebuild index c3dcd8a32..e106fdcbc 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -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] diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 74d79cffb..d90b6f407 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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. diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index f28d10121..e0be5d31e 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -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 \ diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index e027095e0..3e281cafe 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -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 diff --git a/bin/repoman b/bin/repoman index 950d96445..6ea9f9684 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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 diff --git a/cnf/make.globals b/cnf/make.globals index 9d1179c8e..4fe1727ae 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -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" diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d29cf612e..00ab1cd22 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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: diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index f39f66605..be28ee53f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index d48bd8541..a5ff09c5e 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -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")) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 813d9229d..e9fad0956 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -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) diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 7f7be0fdd..68e50cc97 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -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) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 269101981..462199722 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -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))) -- 2.26.2