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)
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 \
"$@" \
${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 \
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
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
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:
# 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)"
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
}
# 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
# 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}
# 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}"
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
# '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.
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
# 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:
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):