Merge with trunk - r2616:2636
authorKito <kito@gentoo.org>
Sun, 5 Feb 2006 04:07:14 +0000 (04:07 -0000)
committerKito <kito@gentoo.org>
Sun, 5 Feb 2006 04:07:14 +0000 (04:07 -0000)
svn path=/main/branches/prefix/; revision=2661

21 files changed:
NEWS
bin/ebuild.sh
bin/emerge
bin/emerge-webrsync
bin/prepallinfo
bin/prepallman
bin/prepallstrip
cnf/make.conf
cnf/make.conf.alpha
cnf/make.conf.amd64
cnf/make.conf.arm
cnf/make.conf.hppa
cnf/make.conf.ia64
cnf/make.conf.mips
cnf/make.conf.ppc
cnf/make.conf.ppc64
cnf/make.conf.s390
cnf/make.conf.sparc
cnf/make.conf.x86
man/make.conf.5
pym/portage.py

diff --git a/NEWS b/NEWS
index ca85bd313d13f2779b19accee54c8937a0024a16..7503e007ba9ae16a64cbbbb53ccbe46d4b6794bd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ News (mainly features/major bug fixes)
 portage-2.1 (ongoing via pre releases)
 ------------
 
+* FEATURES="confcache" integration; global caching to speed up configure calls, 
+  requires dev-util/confcache
 * elog framework and accompanying modules for logging ebuild warnings, errors
   and general notices. Collects eerror/ewarn/elog/einfo messages.
 * New elog function (should replace einfo in many cases)
index 2f649acd42b29934999894ba3a8b848323358d1a..3041eab802fa499a2ada32e3a986c6f41875112f 100755 (executable)
@@ -627,7 +627,32 @@ econf() {
                        LOCAL_EXTRA_ECONF="--libdir=${CONF_LIBDIR_RESULT} ${LOCAL_EXTRA_ECONF}"
                fi
 
-               echo "${ECONF_SOURCE}/configure" \
+               local TMP_CONFCACHE_DIR CONFCACHE_ARG
+               if hasq confcache $FEATURES && ! hasq confcache $RESTRICT; then
+                       CONFCACHE="$(type -p confcache)"
+                       if [ -z "${CONFCACHE}" ]; then
+                               ewarn "disabling confcache, binary cannot be found"
+                       else
+                               CONFCACHE="${CONFCACHE/ /\ }"
+                               TMP_CONFCACHE_DIR="${CONFCACHE:+${CONFCACHE_DIR:-${PORTAGE_TMPDIR}/confcache}}"
+                               TMP_CONFCACHE_DIR="${TMP_CONFCACHE_DIR/ /\ }"
+                               CONFCACHE_ARG="--confcache-dir"
+                               local s
+                               if [ -n "$CCACHE_DIR" ]; then
+                                       s="$CCACHE_DIR"
+                               fi
+                               if [ -n "$DISTCC_DIR" ]; then
+                                       s="${s:+${s}:}$DISTCC_DIR"
+                               fi
+                               if [ -n "$s" ]; then
+                                       CONFCACHE_ARG="--confcache-ignore $s $CONFCACHE_ARG"
+                               fi
+                       fi
+               else
+                       CONFCACHE=
+               fi
+
+               echo ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
                        --prefix=${PREFIX}/usr \
                        --host=${CHOST} \
                        --mandir=${PREFIX}/usr/share/man \
@@ -638,7 +663,7 @@ econf() {
                        "$@" \
                        ${LOCAL_EXTRA_ECONF}
 
-               if ! "${ECONF_SOURCE}/configure" \
+               if ! ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
                        --prefix=${PREFIX}/usr \
                        --host=${CHOST} \
                        --mandir=${PREFIX}/usr/share/man \
@@ -1284,6 +1309,16 @@ dyn_install() {
                die "There are ${UNSAFE} unsafe files. Portage will not install them."
        fi
 
+       if [[ -d ${D}/${D} ]] ; then
+               declare -i INSTALLTOD=0
+               for i in $(find "${D}/${D}/"); do
+                       echo "QA Notice: /${i##${D}/${D}} installed in \${D}/\${D}"
+                       ((INSTALLTOD++))
+               done
+               die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D}/${D}"
+               unset INSTALLTOD
+       fi
+
        # dumps perms to stdout.  if error, no perms dumped.
        function stat_perms() {
                local f
@@ -1363,11 +1398,11 @@ dyn_install() {
 
        if hasq multilib-strict ${FEATURES} && [ -x file -a -x find -a \
             -n "${MULTILIB_STRICT_DIRS}" -a -n "${MULTILIB_STRICT_DENY}" ]; then
-               MULTILIB_STRICT_EXEMPT=${MULTILIB_STRICT_EXEMPT:-"(perl5|gcc|gcc-lib|debug)"}
+               MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT:-"(perl5|gcc|gcc-lib|debug)"} | sed -e 's:\([(|)]\):\\\1:g')
                for dir in ${MULTILIB_STRICT_DIRS}; do
                        [ -d "${D}/${dir}" ] || continue
-                       for file in $(find ${D}/${dir} -type f | @EGREP@ -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
-                               file ${file} | @EGREP@ -q "${MULTILIB_STRICT_DENY}" && die "File ${file} matches a file type that is not allowed in ${dir}"
+                       for file in $(find ${D}/${dir} -type f | grep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
+                               file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" && die "File ${file} matches a file type that is not allowed in ${dir}"
                        done
                done
        fi
index 9a943ca67b0839774bfedbcedbec849f2224b8ea..946f676244036ed206c02c2cef091bdc567073b0 100755 (executable)
@@ -3322,8 +3322,7 @@ else:
 
        if ("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts):
                if ("--resume" in myopts):
-                       ### Cut off the first element, since we aren't merging it #121106
-                       mydepgraph.display(portage.mtimedb["resume"]["mergelist"][1:])
+                       mydepgraph.display(portage.mtimedb["resume"]["mergelist"])
                else:
                        mydepgraph.display(mydepgraph.altlist())
        else:
index 49034d007a68946434ac6c4531b4f1f1459cd9cc..fb9a89397201cee2e2b4e2fd57ddfb0634e91d4b 100755 (executable)
@@ -5,6 +5,14 @@
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
 
+if [ -z "$PULLED_NICENESS" ]; then
+       PULLED_NICENESS="$(@PORTAGE_BASE@/bin/portageq envvar PORTAGE_NICENESS)"
+       if [ -n "$PULLED_NICENESS" ]; then
+               export PULLED_NICENESS
+               exec nice -n $PORTAGE_NICENESS "$0" "$@"
+               echo "failed pulling PORTAGE_NICENESS, disabling"
+       fi
+fi
 GENTOO_MIRRORS="${GENTOO_MIRRORS} $(@PORTAGE_BASE@/bin/portageq gentoo_mirrors)"
 PORTDIR="$(@PORTAGE_BASE@/bin/portageq portdir)"
 FETCHCOMMAND="$(@PORTAGE_BASE@/bin/portageq envvar FETCHCOMMAND)"
@@ -42,21 +50,29 @@ fi
 
 sync_local() {
        echo Syncing local tree...
-       if ! tar jxf $FILE; then
-               echo "Tar failed to extract the image. Please review the output."
-               echo "Executed command: tar jxf $FILE"
-               exit 1
+       if type -p tarsync &> /dev/null; then
+               if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o root -g root -e /distfiles -e /packages -e /local; then
+                       echo "tarsync failed; tarball is corrupt?"
+                       exit 1;
+               fi
+               rm "${FILE}"
+       else
+               if ! tar jxf $FILE; then
+                       echo "Tar failed to extract the image. Please review the output."
+                       echo "Executed command: tar jxf $FILE"
+                       exit 1
+               fi
+               rm -f $FILE
+               # Make sure user and group file ownership is root
+               chown -R 0:0 portage
+               cd portage
+               rsync -av --progress --stats --delete --delete-after \
+               --exclude='/distfiles' --exclude='/packages' \
+               --exclude='/local' . ${PORTDIR%%/}
+               cd ..
+               echo "cleaning up"
+               rm -rf portage
        fi
-       rm -f $FILE
-       # Make sure user and group file ownership is root
-       chown -R 0:0 portage
-       cd portage
-       rsync -av --progress --stats --delete --delete-after \
-       --exclude='/distfiles' --exclude='/packages' \
-       --exclude='/local' . ${PORTDIR%%/}
-       cd ..
-       echo "cleaning up"
-       rm -rf portage
        echo "transferring metadata/cache"
        emerge metadata
 }
index 7f587334b54902fe6ff96d1f4b253634e11a8c4c..f7787ea7ac171fc7778af5d2581c3d6858ab75e1 100755 (executable)
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.6 2004/10/04 13:56:50 vapier Exp $
 
-[ ! -d "${D}/usr/share/info" ] && exit 0
+[[ ! -d ${D}/usr/share/info ]] && exit 0
 
 echo "info:"
-prepinfo
+exec prepinfo
index 418cc5f6fc5591b0758dfa6024ffbb0d9befb37d..f9235ce68e751ea84db090e4f9c4723f09dfcadb 100755 (executable)
@@ -3,10 +3,14 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepallman,v 1.10 2004/10/04 13:56:50 vapier Exp $
 
+ret=0
+
 echo "man:"
 for x in "${D}"/opt/*/man "${D}"/usr/share/man "${D}"/usr/local/man "${D}"/usr/X11R6/man ; do
-       if [ -d "${x}" ]
-       then
+       if [[ -d ${x} ]] ; then
                prepman "`echo "${x}" | sed -e "s:${D}::" -e "s:/man[/]*$::"`"
+               ((ret+=$?))
        fi
 done
+
+exit ${ret}
index 3be06084e89367f443a36614844885c9aeffb6d3..e1958a58c2bc6018189af9591b0aaf61e82a77d9 100755 (executable)
@@ -3,9 +3,12 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepallstrip,v 1.12 2004/10/04 13:56:50 vapier Exp $
 
-if [ "${FEATURES//*nostrip*/true}" == "true" ] || [ "${RESTRICT//*nostrip*/true}" == "true" ] ; then
+if [[ " ${FEATURES} " == *" nostrip "* ]] || \
+   [[ " ${RESTRICT} " == *" nostrip "* ]] || \
+   [[ " ${RESTRICT} " == *" strip "* ]]
+then
        exit 0
 fi
 
 echo "prepallstrip:"
-prepstrip "${D}"
+exec prepstrip "${D}"
index 9c23f09d0d7ee43a7c4fb7912d3d1f762b85fdbe..0e9388fe0dec80bc08e2808ba5a97bdf1616dc38 100644 (file)
@@ -265,6 +265,8 @@ CHOST="i686-pc-linux-gnu"
 #  'buildpkg'    causes binary packages to be created of all packages that 
 #                are being merged.
 #  'ccache'      enables ccache support via CC.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
index b08342ba22e5ad616b1483657afaec28f4168e73..ece7998314be17a7eff0c6f4f1908cf34c99edd5 100644 (file)
@@ -254,6 +254,8 @@ CFLAGS="-mcpu=ev5 -O3 -pipe "
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index caff3c59e104a0680e397a5588e72008a46b5724..f5ee4b0488c99b591215395d581d1e8bb915046d 100644 (file)
@@ -265,6 +265,8 @@ CHOST="x86_64-pc-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index 34ca3990a211f3856a4e69e7406cd2ea8485d107..1c1c6c20f1df948d159f7c957ca2a0f43e5cd099 100644 (file)
@@ -262,6 +262,8 @@ CHOST="armv4l-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index 9241bcc3b2acc0db41c64e552f841503f8a96fce..eb526e65f4c42395783ad1b55cfcb8903a893719 100644 (file)
@@ -271,6 +271,8 @@ CHOST="hppa-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index 7de834833ea0fb3b0da585c4081a08f0e35ce2a5..3f6808b8351b2ab48e636c0b1ed75d50b421ff42 100644 (file)
@@ -233,6 +233,8 @@ CHOST="ia64-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index c0834b0198f7a5545b6adf51fffeeeea14ad2220..dc71e33097e4afa1c6c76d3435543ba469a4a7b3 100644 (file)
@@ -251,6 +251,8 @@ CHOST="mips-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index 922536f6df8bf8100526dbf498191bacc47f3896..6c38b1028eb5b00b017e8e3dfb854eda7a38b1c3 100644 (file)
@@ -291,6 +291,8 @@ CHOST="powerpc-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index 2da0e6049ab2fd1aa248f303a90af40b4498dc43..a636928a7e88c35099ae693705ed114cae7769a8 100644 (file)
@@ -269,6 +269,8 @@ CHOST="powerpc64-unknown-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index ad8097d2e93474bc8289fd6100a9411d575ece3d..fe2f8bccea98b6e0795a06085542bb0125904fce 100644 (file)
@@ -233,6 +233,8 @@ CHOST="s390-ibm-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index e1ab499d6773f3a192e24cf1eaa065bb3e62cad2..f58ba4bb6ff5c25453f2269686e7e8a68ce43355 100644 (file)
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index d98231edaf610fa1729c6a1e9947fb2a40956a08..98ba6a957a7d8a258546213b6996e396bb98d4f5 100644 (file)
@@ -268,6 +268,8 @@ CHOST="i686-pc-linux-gnu"
 #  'collision-protect'
 #                prevents packages from overwriting files that are owned by
 #                another package or by no package at all.
+#  'confcache'   enable confcache support; speeds up autotool based configure
+#                calls
 #  'cvs'         causes portage to enable all cvs features (commits, adds),
 #                and to apply all USE flags in SRC_URI for digests -- for
 #                developers only.
index f955d2b8e1e1b02e4c534f62512cf9bd8c912e21..fdcbd2d8c9b838a582ff10901d15ed9d4e738c99 100644 (file)
@@ -129,6 +129,10 @@ Enable portage support for the ccache package.  If the ccache dir is not
 present in the user's environment, then portage will default to 
 ${PORTAGE_TMPDIR}/ccache (with \fIuserpriv\fR) and to /root/.ccache otherwise.
 .TP
+.B confcache
+Enable confcache support; global configure caching, speeds up autotool based configure 
+calls.
+.TP
 .B collision\-protect
 A QA\-feature to ensure that a package doesn't overwrite files it doesn't own.
 .TP
index 25ae6334ab6ca1a4ff5d34f2dbb5261cc86a8e69..f12209525f921f08a18566bea17734d4b7826a7d 100644 (file)
@@ -462,7 +462,7 @@ def elog_process(cpv, mysettings):
        # shortcut for packages without any messages
        if len(mylogfiles) == 0:
                return
-       # exploit listdir() file order so we process log entries in cronological order
+       # exploit listdir() file order so we process log entries in chronological order
        mylogfiles.reverse()
        mylogentries = {}
        for f in mylogfiles:
@@ -2669,7 +2669,38 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
                        print "!!! Perhaps: rm -Rf",mysettings["BUILD_PREFIX"]
                        print "!!!",str(e)
                        return 1
-
+               try:
+                       if "confcache" in features:
+                               if not mysettings.has_key("CONFCACHE_DIR"):
+                                       mysettings["CONFCACHE_DIR"] = os.path.join(mysettings["PORTAGE_TMPDIR"], "confcache")
+                               if not os.path.exists(mysettings["CONFCACHE_DIR"]):
+                                       if not os.getuid() == 0:
+                                               # we're boned.
+                                               features.remove("confcache")
+                                               mysettings["FEATURES"] = " ".join(features)
+                                       else:
+                                               os.makedirs(mysettings["CONFCACHE_DIR"], mode=0775)
+                                               os.chown(mysettings["CONFCACHE_DIR"], -1, portage_gid)
+                               else:
+                                       st = os.stat(mysettings["CONFCACHE_DIR"])
+                                       if not (st.st_mode & 07777)  == 0775:
+                                               os.chmod(mysettings["CONFCACHE_DIR"], 0775)
+                                       if not st.st_gid == portage_gid:
+                                               os.chown(mysettings["CONFCACHE_DIR"], -1, portage_gid)
+
+                       # check again, since it may have been disabled.
+                       if "confcache" in features:
+                               for x in listdir(mysettings["CONFCACHE_DIR"]):
+                                       p = os.path.join(mysettings["CONFCACHE_DIR"], x)
+                                       st = os.stat(p)
+                                       if not (st.st_mode & 07777) & 07600 == 0600:
+                                               os.chmod(p, (st.st_mode & 0777) | 0600)
+                                       if not st.st_gid == portage_gid:
+                                               os.chown(p, -1, portage_gid)
+                                       
+               except OSError, e:
+                       print "!!! Failed resetting perms on confcachedir %s" % mysettings["CONFCACHE_DIR"]
+                       return 1                                                
                #try:
                #       mystat=os.stat(mysettings["CCACHE_DIR"])
                #       if (mystat[stat.ST_GID]!=portage_gid) or ((mystat[stat.ST_MODE]&02070)!=02070):