From 9f9cfa619ae081cab43e159164e411074e2939de Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 14 Apr 2007 07:56:43 +0000 Subject: [PATCH] Merged from trunk 6382:6397 +------------------------------------------------------------------------+ | 6383 | Use a config instance that's not locked/immutable. | | zmedico | | |----------+-------------------------------------------------------------| | 6384 | Use catpkgsplit instead of pkgsplit for consistency with | | zmedico | usage elsewhere. | |----------+-------------------------------------------------------------| | 6386 | Add CATEGORY to blacklisted variables since it can | | zmedico | interfere with CATEGORY guessing inside doebuild. | |----------+-------------------------------------------------------------| | 6388 | Use relative paths inside ecompressdir in order to avoid | | zmedico | 'Argument list too long' errors with large file sets | | | (observed when installing sys-apps/man-pages). | |----------+-------------------------------------------------------------| | 6392 | simplify unsafe file checking so files/paths with spaces | | SpankMan | dont cause troubles | |----------+-------------------------------------------------------------| | 6394 | create leading directories to match behavior of other do* | | SpankMan | programs | |----------+-------------------------------------------------------------| | 6395 | document new version suffix style #166522 | | SpankMan | | |----------+-------------------------------------------------------------| | 6396 | Prefix the hardlink source with ${D} like we always have. | | zmedico | | +------------------------------------------------------------------------+ svn path=/main/branches/prefix/; revision=6399 --- bin/dohard | 11 ++++++----- bin/ecompressdir | 5 ++++- bin/misc-functions.sh | 19 +++++-------------- man/ebuild.5 | 15 ++++++++------- pym/portage/__init__.py | 13 +++++-------- pym/portage/dbapi/porttree.py | 4 ++-- 6 files changed, 30 insertions(+), 37 deletions(-) diff --git a/bin/dohard b/bin/dohard index 44b5a0ffd..52ffae087 100755 --- a/bin/dohard +++ b/bin/dohard @@ -1,13 +1,14 @@ #!@BASH@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Id: /var/cvsroot/gentoo-src/portage/bin/dohard,v 1.6 2004/10/04 13:56:50 vapier Exp $ +# $Id: $ if [[ $# -ne 2 ]] ; then echo "$0: two arguments needed" 1>&2 exit 1 fi -target=$1 -linkname=$2 -exec ln -f "${ED}${target}" "${ED}${linkname}" +destdir=${2%/*} +[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}" + +exec ln -f "${ED}$1" "${ED}$2" diff --git a/bin/ecompressdir b/bin/ecompressdir index 9cbf1d162..9befd84b0 100755 --- a/bin/ecompressdir +++ b/bin/ecompressdir @@ -102,6 +102,9 @@ for dir in "$@" ; do vecho "${0##*/}: ${dir#${ED}} does not exist!" continue fi + cd "${dir}" + actual_dir=${dir} + dir=. # use relative path to avoid 'Argument list too long' errors # hide all the stuff we want to skip hide_skip_dirs "${dir}" @@ -122,7 +125,7 @@ for dir in "$@" ; do # now lets do our work [[ -z ${suffix} ]] && continue - vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}" + vecho "${0##*/}: $(ecompress --bin) ${actual_dir#${D}}" funk_up_dir "compress" "${suffix}" "ecompress" # finally, restore the skipped stuff diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 58ee30c40..8ef23c6dc 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -45,18 +45,6 @@ install_qa_check() { cd "${ED}" || die "cd failed" prepall - declare -i UNSAFE=0 - for i in $(find "${ED}/" -type f -perm -2002); do - ((UNSAFE++)) - vecho "UNSAFE SetGID: $i" - chmod -s,o-w "$i" - done - for i in $(find "${ED}/" -type f -perm -4002); do - ((UNSAFE++)) - vecho "UNSAFE SetUID: $i" - chmod -s,o-w "$i" - done - # Now we look for all world writable files. for i in $(find "${ED}/" -type f -perm -2); do vecho -ne '\a' @@ -199,8 +187,11 @@ install_qa_check() { PORTAGE_QUIET=${tmp_quiet} fi - if [[ ${UNSAFE} > 0 ]] ; then - die "There are ${UNSAFE} unsafe files. Portage will not install them." + local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')') + if [[ -n ${unsafe_files} ]] ; then + eqawarn "QA Notice: Unsafe files detected (set*id and world writable)" + eqawarn "${unsafe_files}" + die "Unsafe files found in \${ED}. Portage will not install them." fi if [[ -d ${ED}/${D} ]] ; then diff --git a/man/ebuild.5 b/man/ebuild.5 index 1d16a7e29..6eafaf177 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -185,8 +185,8 @@ The base atom is just a full category/packagename. Hence, these are base atoms: .TP .B Atom Versions It is nice to be more specific and say that only certain versions of atoms are -acceptable. Note that versions must be combined with a prefix (see below). Hence -you may add a version number as a postfix to the base: +acceptable. Note that versions must be combined with a prefix (see below). +Hence you may add a version number as a postfix to the base: .nf sys\-apps/sed\fI\-4.0.5\fR @@ -195,11 +195,12 @@ net\-misc/dhcp\fI\-3.0_p2\fR .fi Versions are normally made up of two or three numbers separated by periods, such -as 1.2 or 4.5.2. This string may be followed by a character such as 1.2a or 4.5.2z. -Note that this letter is \fBnot\fR meant to indicate alpha, beta, etc... status. -For that, use the optional suffix; either _alpha, _beta, _pre (pre\-release), _rc -(release candidate), or _p (patch). This means for the 3rd pre\-release of a package, -you would use something like 1.2_pre3. +as 1.2 or 4.5.2. This string may be followed by a character such as 1.2a or +4.5.2z. Note that this letter is \fBnot\fR meant to indicate alpha, beta, +etc... status. For that, use the optional suffix; either _alpha, _beta, _pre +(pre\-release), _rc (release candidate), or _p (patch). This means for the +3rd pre\-release of a package, you would use something like 1.2_pre3. The +suffixes here can be arbitrarily chained without limitation. .TP .B Atom Prefix Operators [> >= = <= <] Sometimes you want to be able to depend on general versions rather than specifying diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 0e354d439..fe615442a 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1163,13 +1163,10 @@ class config: self.lookuplist.reverse() # Blacklist vars that could interfere with portage internals. - for blacklisted in ["PKGUSE", "PORTAGE_CONFIGROOT", "ROOT", - "EPREFIX", "EROOT"]: + for blacklisted in "CATEGORY", "PKGUSE", "PORTAGE_CONFIGROOT", \ + "ROOT", "EPREFIX", "EROOT": for cfg in self.lookuplist: - try: - del cfg[blacklisted] - except KeyError: - pass + cfg.pop(blacklisted, None) del blacklisted, cfg if target_root is None: @@ -4098,7 +4095,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", for cpv in portdb.match(match_atom): # only use new-style matches if cpv.startswith("virtual/"): - pkgs[cpv] = (cpv, pkgsplit(cpv), portdb) + pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], portdb) if kwargs["use_binaries"] and "vartree" in trees[myroot]: vardb = trees[myroot]["vartree"].dbapi for cpv in vardb.match(match_atom): @@ -4106,7 +4103,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", if cpv.startswith("virtual/"): if cpv in pkgs: continue - pkgs[cpv] = (cpv, pkgsplit(cpv), vardb) + pkgs[cpv] = (cpv, catpkgsplit(cpv)[1:], vardb) if not (pkgs or mychoices): # This one couldn't be expanded as a new-style virtual. Old-style # virtuals have already been expanded by dep_virtual, so this one diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 11182d1c1..ad6ccc45a 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -700,8 +700,8 @@ class portdbapi(dbapi): match=1 uselist = [] if "?" in licenses: - self.mysettings.setcpv(mycpv, mydb=self) - uselist = self.mysettings.get("USE", "").split() + self.doebuild_settings.setcpv(mycpv, mydb=self) + uselist = self.doebuild_settings.get("USE", "").split() try: if self.mysettings.getMissingLicenses( licenses, mycpv, uselist): -- 2.26.2