- packages won't be unmerged if they are referenced by an installed package
set (with the exception of the world set, and installed being determined
by the world_sets file).
-* "world" does no longer include "system" unconditionally, but you can add
+* "world" no longer includes "system" unconditionally, but you can add
"@system" to the world_sets file to restore the old state.
portage-2.1.6
_sb_append_var() {
local _v=$1 ; shift
local var="SANDBOX_${_v}"
- [[ -z $1 || -n $2 ]] && die "Usage: add$(echo ${_v} | LC_ALL=C tr :upper: :lower:) <colon-delimited list of paths>"
+ [[ -z $1 || -n $2 ]] && die "Usage: add$(echo ${_v} | \
+ LC_ALL=C tr [:upper:] [:lower:]) <colon-delimited list of paths>"
export ${var}="${!var:+${!var}:}$1"
}
# bash-4 version:
ebuild_phase_with_hooks() {
local x phase_name=${1}
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
for x in {pre_,,post_}${phase_name} ; do
ebuild_phase ${x}
done
if [ ! -d "${WORKDIR}" ]; then
install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
fi
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
ebuild_phase pre_src_unpack
vecho ">>> Unpacking source..."
trap abort_prepare SIGINT SIGQUIT
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
ebuild_phase pre_src_prepare
vecho ">>> Preparing source in $srcdir ..."
ebuild_phase src_prepare
trap abort_configure SIGINT SIGQUIT
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
ebuild_phase pre_src_configure
vecho ">>> Configuring source in $srcdir ..."
trap abort_compile SIGINT SIGQUIT
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
ebuild_phase pre_src_compile
vecho ">>> Compiling source in ${srcdir} ..."
else
local save_sp=${SANDBOX_PREDICT}
addpredict /
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
ebuild_phase pre_src_test
ebuild_phase src_test
touch "$PORTAGE_BUILDDIR/.tested" || \
return 0
fi
trap "abort_install" SIGINT SIGQUIT
+ [ -n "$EBUILD_PHASE" ] && rm -f "$T/logging/$EBUILD_PHASE"
ebuild_phase pre_src_install
rm -rf "${PORTAGE_BUILDDIR}/image"
mkdir "${PORTAGE_BUILDDIR}/image"
#!@PORTAGE_PYTHON@
-# Copyright Gentoo Foundation 2006
-# Portage Emerge bits
+# Copyright 2006-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
# $Id$
import os
+++ /dev/null
-#!@PORTAGE_PYTHON@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-import os,sys,re
-
-# for an explanation on this logic, see pym/_emerge/__init__.py
-import os
-import sys
-if os.environ.__contains__("PORTAGE_PYTHONPATH"):
- sys.path.insert(0, os.environ["PORTAGE_PYTHONPATH"])
-else:
- sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym"))
-import portage
-
-from stat import *
-from portage.output import *
-from portage import lockfile,unlockfile,VDB_PATH,root
-import portage.const
-
-
-mylog = open(portage.const.EPREFIX+"/var/log/emerge_fix-db.log", "a")
-def writemsg(msg):
- if msg[-1] != '\n':
- msg += "\n"
- sys.stderr.write(msg)
- sys.stderr.flush()
- mylog.write(msg)
- mylog.flush()
-
-def fix_global_counter(value):
- myf = open(portage.const.EPREFIX+"/var/cache/edb/counter")
- newvalue = value+1000
- myf.write(str(newvalue))
- myf.flush()
- myf.close()
- return newvalue
-
-bad = {}
-counters = {}
-times = {}
-
-try:
- real_counter = long(open(portage.const.EPREFIX+"/var/cache/edb/counter").read())
-except SystemExit, e:
- raise # This needs to be propogated
-except:
- writemsg("ERROR: Real counter is invalid.\n")
- real_counter = 0
-
-vardbdir = root+VDB_PATH+"/"
-for cat in os.listdir(vardbdir):
- catdir = vardbdir+cat+"/"
- if not os.path.isdir(catdir):
- writemsg("Invalid file: '%s'\n" % catdir[:-1])
- continue
- for pkg in os.listdir(catdir):
- pkgdir = catdir+pkg+"/"
- catpkg = cat+"/"+pkg
-
- if not os.path.isdir(catdir):
- writemsg("Invalid file: '%s'\n" % pkgdir)
- continue
-
- bad[catpkg] = []
-
- pkgdirlist = os.listdir(pkgdir)
- if not pkgdirlist:
- writemsg("ERROR: Package directory is empty for '%s'\n" % catpkg)
- writemsg(" Deleting this directory. Remerge if you want it back.\n")
- os.rmdir(pkgdir)
- del bad[catpkg]
- continue
-
- if "CONTENTS" not in pkgdirlist:
- bad[catpkg] += ["CONTENTS is missing"]
- times[catpkg] = -1
- writemsg("ERROR: Contents file is missing from the package directory.\n")
- writemsg(" '%s' is corrupt and should be deleted.\n" % catpkg)
- else:
- times[catpkg] = None
- for line in open(pkgdir+"CONTENTS").readlines():
- mysplit = line.split()
- if mysplit[0] == "obj":
- try:
- times[catpkg] = long(mysplit[-1])
- except SystemExit, e:
- raise # This needs to be propogated
- except:
- times[catpkg] = -1
- bad[catpkg] += ["CONTENTS is corrupt"]
- writemsg("ERROR: Corrupt CONTENTS file in '%s'\n" % catpkg)
- writemsg(" This package should be deleted.\n")
- break
- if times[catpkg] == None:
- times[catpkg] = os.stat(pkgdir+"CONTENTS")[ST_MTIME]
-
- if "COUNTER" not in pkgdirlist:
- bad[catpkg] += ["COUNTER is missing"]
- writemsg("ERROR: COUNTER file missing from '%s'.\n" % catpkg)
- counters[catpkg] = -1
- else:
- try:
- counters[catpkg] = long(open(pkgdir+"COUNTER").read().strip())
- if counters[catpkg] > real_counter:
- writemsg("ERROR: Global counter is lower than the '%s' COUNTER." % catpkg)
- real_counter = fix_global_counter(counters[catpkg])
- except SystemExit, e:
- raise # This needs to be propogated
- except:
- bad[catpkg] += ["COUNTER is corrupt"]
- counters[catpkg] = -1
-
- if "SLOT" not in pkgdirlist:
- writemsg("ERROR: SLOT file missing from '%s'.\n" % catpkg)
- writemsg(" RE-MERGE this exact package version or unmerge and remerge.\n")
- bad[catpkg] += ["SLOT is missing"]
- else:
- myslot = open(pkgdir+"SLOT").read()
- if myslot and myslot[-1]=="\n":
- #writemsg("WARN: SLOT file has a newline. '%s'\n" % catpkg)
- myslot = myslot[:-1]
- if not myslot:
- bad[catpkg] += ["SLOT is empty"]
- writemsg("ERROR: SLOT file is empty for '%s'.\n" % catpkg)
- writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n")
- elif re.search("[^-a-zA-Z0-9\._]", myslot):
- bad[catpkg] += ["SLOT is corrupt"]
- writemsg("ERROR: SLOT file is corrupt for '%s'.\n" % catpkg)
- writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n")
- elif myslot.strip() != myslot:
- writemsg("WARN: SLOT file has invalid characters. '%s'\n" % catpkg)
- bad[catpkg] += ["SLOT is invalid"]
-
- if not bad[catpkg]:
- del bad[catpkg]
-
-
-actions = {}
-writemsg("\n\n")
-for catpkg in bad:
- bad[catpkg].sort()
-
- mystr = ""
- for x in bad[catpkg]:
- mystr += " "+str(x)+"\n"
-
- if bad[catpkg] == ["CONTENTS is missing", "SLOT is missing"]:
- writemsg("%s: (possibly injected)\n%s\n" % (green(catpkg), mystr))
- actions[catpkg] = ["ignore"]
- elif bad[catpkg] == ["SLOT is empty"]:
- writemsg("%s: (old package) []\n%s\n" % (yellow(catpkg), mystr))
- actions[catpkg] = ["remerge"]
- else:
- writemsg("%s: (damaged/invalid) []\n%s\n" % (red(catpkg), mystr))
- actions[catpkg] = ["merge exact"]
-
-if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"):
- writemsg("These are only directions, at the moment.")
- for catpkg in actions:
- action = actions[catpkg]
- writemsg("We will now '%s' '%s'..." % (action, catpkg))
- #if action ==
-else:
- #writemsg("Run with '--fix' to attempt automatic correction.")
- pass
-
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
from portage import catsplit, dep_expand, flatten, isvalidatom, xpak
from portage.dep import use_reduce, paren_reduce
from portage.util import ConfigProtect, ensure_dirs
- from portage.exception import InvalidData, InvalidDependString
+ from portage.exception import InvalidAtom, InvalidData, InvalidDependString
from portage.dbapi.vartree import dblink, tar_contents
from portage.checksum import perform_md5
import tarfile
del e
missing.append(arg)
continue
- except InvalidData, e:
- eout.eerror("Invalid atom: %s" % str(e))
- del e
+ except (InvalidAtom, InvalidData):
+ eout.eerror("Invalid atom: %s" % (arg,))
missing.append(arg)
continue
- if not isvalidatom(atom):
- eout.eerror("Invalid atom: %s" % atom)
+ if atom[:1] == '=' and arg[:1] != '=':
+ # dep_expand() allows missing '=' but it's really invalid
+ eout.eerror("Invalid atom: %s" % (arg,))
missing.append(arg)
continue
+
matches = vardb.match(atom)
pkgs_for_arg = 0
for cpv in matches:
"metadata.missing":"Missing metadata.xml files",
"metadata.bad":"Bad metadata.xml files",
"metadata.warning":"Warnings in metadata.xml files",
- "portage.internal":"The ebuild uses an internal Portage function",
"virtual.versioned":"PROVIDE contains virtuals with versions",
"virtual.exists":"PROVIDE contains existing package names",
"virtual.unavailable":"PROVIDE contains a virtual which contains no profile default",
--- /dev/null
+--- make.conf 2006-03-19 18:40:11.000000000 +0100
++++ make.conf.amd64-fbsd 2006-03-19 18:26:21.000000000 +0100
+@@ -23,6 +23,11 @@
+ # Example:
+ #USE="X gtk gnome -alsa"
+
++# Host Setting
++# ============
++#
++CHOST="x86_64-gentoo-freebsd7.1"
++
+ # Host and optimization settings
+ # ==============================
+ #
+@@ -33,10 +38,35 @@
+ # package (and in some cases the libraries it uses) at default optimizations
+ # before reporting errors to developers.
+ #
+-# Please refer to the GCC manual for a list of possible values.
++# -mcpu=<cpu-type> means optimize code for the particular type of CPU without
++# breaking compatibility with other CPUs. GCC 3.4 has deprecated support for
++# -mcpu, so use -mtune instead if using this compiler.
++#
++# -march=<cpu-type> means to take full advantage of the ABI and instructions
++# for the particular CPU; this will break compatibility with older CPUs (for
++# example, -march=athlon-xp code will not run on a regular Athlon, and
++# -march=i686 code will not run on a Pentium Classic.)
++#
++# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp,
++# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686
++# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron),
++# pentium3, and pentium4.
++#
++# Note that Gentoo Linux 1.4 and higher include at least gcc-3.2.
++#
++# amd64 CPU types supported in gcc-3.4: athlon64, opteron, k8
++#
++# CRITICAL WARNINGS: ****************************************************** #
++# K6 markings are deceptive. Avoid setting -march for them. See Bug #24379. #
++# Pentium-M CPU's should not enable sse2 until at least gcc-3.4. Bug 50616. #
++# GCC 3.3 doesnt support an amd64 specific -march setting, use 3.4. #
++# ************************************************************************* #
+ #
+-#CFLAGS="-O2 -pipe"
++# Decent examples:
+ #
++#CFLAGS="-mtune=k8 -O2 -pipe"
++#CFLAGS="-march=athlon64 -O2 -pipe"
++
+ # If you set a CFLAGS above, then this line will set your default C++ flags to
+ # the same settings.
+ #CXXFLAGS="${CFLAGS}"
+@@ -61,7 +91,7 @@
+ # DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
+ # IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
+ #
+-#ACCEPT_KEYWORDS="~arch"
++#ACCEPT_KEYWORDS="~amd64-fbsd"
+
+ # Portage Directories
+ # ===================
--- /dev/null
+--- make.conf
++++ make.conf.m68k
+@@ -23,6 +23,13 @@
+ # Example:
+ #USE="X gtk gnome -alsa"
+
++# Host Setting
++# ============
++#
++# m68k-unknown-linux-gnu for all m68k CPUs.
++#
++CHOST="m68k-unknown-linux-gnu"
++
+ # Host and optimization settings
+ # ==============================
+ #
+@@ -35,7 +42,7 @@
+ #
+ # Please refer to the GCC manual for a list of possible values.
+ #
+-#CFLAGS="-O2 -pipe"
++#CFLAGS="-m68030 -pipe -Os"
+ #
+ # If you set a CFLAGS above, then this line will set your default C++ flags to
+ # the same settings.
+@@ -61,7 +68,7 @@
+ # DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
+ # IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
+ #
+-#ACCEPT_KEYWORDS="~arch"
++#ACCEPT_KEYWORDS="~m68k"
+
+ # Portage Directories
+ # ===================
.B metadata.warning
Warnings in metadata.xml files
.TP
-.B portage.internal
-The ebuild uses an internal Portage function
-.TP
.B upstream.workaround
The ebuild works around an upstream bug, an upstream bug should be filed and
tracked in bugs.gentoo.org
# "update", "system", or just process files:
else:
validate_ebuild_environment(trees)
+
+ for x in myfiles:
+ if x.startswith(SETPREFIX) or \
+ is_valid_package_atom(x):
+ continue
+ msg = []
+ msg.append("'%s' is not a valid package atom." % (x,))
+ msg.append("Please check ebuild(5) for full details.")
+ writemsg_level("".join("!!! %s\n" % line for line in msg),
+ level=logging.ERROR, noiselevel=-1)
+ return 1
+
if "--pretend" not in myopts:
display_news_notification(root_config, myopts)
retval = action_build(settings, trees, mtimedb,
moveme = 1
zing = "!!!"
mymtime = None
+ protected = self.isprotected(mydest)
if mydmode != None:
# destination file exists
if stat.S_ISDIR(mydmode):
# or by a symlink to an existing regular file;
# now, config file management may come into play.
# we only need to tweak mydest if cfg file management is in play.
- if self.isprotected(mydest):
+ if protected:
# we have a protection path; enable config file management.
destmd5 = perform_md5(mydest, calc_prelink=1)
if mymd5 == destmd5:
# extract a tarball of the resulting hardlinks due to
# 'Invalid cross-device link' errors (depends on layout of
# mount points). Also, don't hardlink zero-byte files since
- # it doesn't save any space.
+ # it doesn't save any space, and don't hardlink
+ # CONFIG_PROTECTed files since config files shouldn't be
+ # hardlinked to eachother (for example, shadow installs
+ # several identical config files inside /etc/pam.d/).
parent_dir = os.path.dirname(myrealdest)
hardlink_key = (parent_dir, mymd5, mystat.st_size,
mystat.st_mode, mystat.st_uid, mystat.st_gid)
- hardlink_candidates = self._md5_merge_map.get(hardlink_key)
- if hardlink_candidates is None:
- hardlink_candidates = []
- if mystat.st_size != 0:
+
+ hardlink_candidates = None
+ if not protected and mystat.st_size != 0:
+ hardlink_candidates = self._md5_merge_map.get(hardlink_key)
+ if hardlink_candidates is None:
+ hardlink_candidates = []
self._md5_merge_map[hardlink_key] = hardlink_candidates
+
mymtime = movefile(mysrc, mydest, newmtime=thismtime,
sstat=mystat, mysettings=self.settings,
hardlink_candidates=hardlink_candidates)
if mymtime is None:
return 1
- hardlink_candidates.append(mydest)
+ if hardlink_candidates is not None:
+ hardlink_candidates.append(mydest)
zing = ">>>"
if mymtime != None:
return 'WANT_AUTO' + m.group(1) + \
' redundantly set to default value "latest" on line: %d'
-class PortageInternal(LineCheck):
- """
- In February 2009 the Gentoo council ruled that
- prepalldocs is a Portage internal.
- """
- repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\bprepalldocs\b')
- error = errors.PREPALLDOCS_ERROR
-
_constant_checks = tuple((c() for c in (
EbuildHeader, EbuildWhitespace, EbuildQuote,
EbuildAssignment, EbuildUselessDodoc,
EbuildPatches, EbuildQuotedA,
IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS,
- DeprecatedBindnowFlags, WantAutoDefaultValue, PortageInternal)))
+ DeprecatedBindnowFlags, WantAutoDefaultValue)))
def run_checks(contents, pkg):
checks = _constant_checks
EMAKE_PARALLEL_DISABLED = 'Upstream parallel compilation bug (ebuild calls emake -j1 on line: %d)'
EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEOPTS=-j1 on line: %d)'
DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d'
-PREPALLDOCS_ERROR = 'prepalldocs called on line: %d'