export EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} $*"
}
-# Ensure that $CWD is sane whenever possible.
-cd "$WORKDIR" 2>/dev/null
+# Ensure that $PWD is sane whenever possible.
+cd "$PORTAGE_BUILDDIR" 2>/dev/null
#if no perms are specified, dirs/files will have decent defaults
#(not secretive, but not stupid)
for f in ASFLAGS CATEGORY CBUILD CC CFLAGS CHOST CTARGET CXX \
CXXFLAGS DEPEND EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \
FEATURES INHERITED IUSE LDFLAGS LIBCFLAGS LIBCXXFLAGS \
- LICENSE PDEPEND PF PKGUSE PROVIDE RDEPEND RESTRICT SLOT \
+ LICENSE PDEPEND PF PKGUSE PROPERTIES PROVIDE RDEPEND RESTRICT SLOT \
KEYWORDS HOMEPAGE SRC_URI DESCRIPTION; do
[ -n "${!f}" ] && echo $(echo "${!f}" | \
tr '\n,\r,\t' ' , , ' | sed s/' \+'/' '/g) > ${f}
auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
DESCRIPTION KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE EAPI
- UNUSED_01 UNUSED_02 UNUSED_03 UNUSED_04 UNUSED_05 UNUSED_06
- UNUSED_07"
+ PROPERTIES UNUSED_06 UNUSED_05 UNUSED_04
+ UNUSED_03 UNUSED_02 UNUSED_01"
#the extra $(echo) commands remove newlines
unset CDEPEND
# not entirely safe to use it as a delimiter in the log file since
# there can still be escaped newlines that will be expanded due to
# the echo -e parameter.
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
echo -ne "${messagetype} ${line}\n\0" >> \
"${T}/logging/${EBUILD_PHASE:-other}"
done
eqawarn() {
elog_base QA "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
vecho -e " ${WARN}*${NORMAL} ${line}" >&2
done
LAST_E_CMD="eqawarn"
elog() {
elog_base LOG "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
echo -e " ${GOOD}*${NORMAL} ${line}"
done
LAST_E_CMD="elog"
einfo() {
elog_base INFO "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
echo -e " ${GOOD}*${NORMAL} ${line}"
done
LAST_E_CMD="einfo"
ewarn() {
elog_base WARN "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}${line}" >&2
done
LAST_E_CMD="ewarn"
eerror() {
elog_base ERROR "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo "$@" | while read line ; do
+ echo -e "$@" | while read line ; do
echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}${line}" >&2
done
LAST_E_CMD="eerror"
root_config = RootConfig(repoman_settings, trees["/"], setconfig)
# We really only need to cache the metadata that's necessary for visibility
# filtering. Anything else can be discarded to reduce memory consumption.
-for k in ("DEPEND", "LICENCE", "PDEPEND",
- "PROVIDE", "RDEPEND", "RESTRICT", "repository"):
- portdb._aux_cache_keys.discard(k)
+portdb._aux_cache_keys.clear()
+portdb._aux_cache_keys.update(["EAPI", "KEYWORDS", "SLOT"])
# dep_zapdeps looks at the vardbapi, but it shouldn't for repoman.
del trees["/"]["vartree"]
-<section id='package-ebuild-eapi-2_pre1'>
- <title>EAPI 2_pre1</title>
+<section id='package-ebuild-eapi-2'>
+ <title>EAPI 2</title>
<section id='package-ebuild-eapi-2-helpers'>
<title>Helpers</title>
<section id='package-ebuild-eapi-2-helpers-doman'>
<title>doman</title>
- <para>
- Language codes in file names are now used for path translation.
- </para>
- <table><title>Man Page Path Translation</title>
- <tgroup cols='2' align='left' >
- <colspec colname='source'/>
- <colspec colname='destination'/>
- <thead>
- <row>
- <entry>Source</entry>
- <entry>Destination</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>foo.1</entry>
- <entry>/usr/share/man/man1/foo.1</entry>
- </row>
- <row>
- <entry>foo.lang.1</entry>
- <entry>/usr/share/man/lang/man1/foo.1</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- </section>
- <section id='package-ebuild-eapi-2-use-deps'>
- <title>USE Dependencies</title>
- <section id='package-ebuild-eapi-2-use-deps-unconditional'>
- <title>Unconditional USE Dependencies</title>
- <table><title>Syntax Examples</title>
- <tgroup cols='2' align='left' >
- <colspec colname='example'/>
- <colspec colname='meaning'/>
- <thead>
- <row>
- <entry>Example</entry>
- <entry>Meaning</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>foo[bar]</entry>
- <entry>foo must have bar enabled</entry>
- </row>
- <row>
- <entry>foo[bar,baz]</entry>
- <entry>foo must have both bar and baz enabled</entry>
- </row>
- <row>
- <entry>foo[-bar,baz]</entry>
- <entry>foo must have bar disabled and baz enabled</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id='package-ebuild-eapi-2-use-deps-conditional'>
- <title>Conditional USE Dependencies</title>
- <table><title>Syntax Examples</title>
- <tgroup cols='2' align='left' >
- <colspec colname='compact'/>
- <colspec colname='expanded'/>
- <thead>
- <row>
- <entry>Compact Form</entry>
- <entry>Equivalent Expanded Form</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>foo[bar?]</entry>
- <entry>bar? ( foo[bar] ) !bar? ( foo )</entry>
- </row>
- <row>
- <entry>foo[!bar?]</entry>
- <entry>bar? ( foo ) !bar? ( foo[-bar] )</entry>
- </row>
- <row>
- <entry>foo[bar=]</entry>
- <entry>bar? ( foo[bar] ) !bar? ( foo[-bar] )</entry>
- </row>
- <row>
- <entry>foo[!bar=]</entry>
- <entry>bar? ( foo[-bar] ) !bar? ( foo[bar] )</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- </section>
-</section>
-<section id='package-ebuild-eapi-2_pre2'>
- <title>EAPI 2_pre2</title>
- <section id='package-ebuild-eapi-2-phases'>
- <title>Phases</title>
- <section id='package-ebuild-eapi-2-phases-src-configure'>
- <title>New src_configure Phase Function</title>
- <para>
- The configure portion of the src_compile function has been
- split into a separate function which is named src_configure. The
- src_configure function is called in-between the src_unpack and
- src_compile functions.
- </para>
- <programlisting>
-src_configure() {
- if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
- econf
- fi
-}
-
-src_compile() {
- if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ] ; then
- emake || die "emake failed"
- fi
-}
- </programlisting>
- <table><title>Execution Order of Phase Functions</title>
- <tgroup cols='1' align='left' >
- <colspec colname='name'/>
- <thead>
- <row>
- <entry>Phase Function Name</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>pkg_setup</entry>
- </row>
- <row>
- <entry>src_unpack</entry>
- </row>
- <row>
- <entry>src_configure</entry>
- </row>
- <row>
- <entry>src_compile</entry>
- </row>
- <row>
- <entry>src_test</entry>
- </row>
- <row>
- <entry>src_install</entry>
- </row>
- <row>
- <entry>pkg_preinst</entry>
- </row>
- <row>
- <entry>pkg_postinst</entry>
- </row>
- <row>
- <entry>pkg_prerm</entry>
- </row>
- <row>
- <entry>pkg_postrm</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id='package-ebuild-eapi-2-phases-default-functions'>
- <title>Default Phase Functions</title>
- <para>
- The default pkg_nofetch and src_* phase functions are now
- accessible via a function having a name
- that begins with default_ and
- ends with the respective phase function name. For example,
- a call to a function with the name default_src_compile is
- equivalent to a call to the default src_compile
- implementation.
- </para>
- <table><title>Default Phase Functions</title>
- <tgroup cols='1' align='left' >
- <colspec colname='name'/>
- <thead>
- <row>
- <entry>Function Name</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>default_pkg_nofetch</entry>
- </row>
- <row>
- <entry>default_src_unpack</entry>
- </row>
- <row>
- <entry>default_src_configure</entry>
- </row>
- <row>
- <entry>default_src_compile</entry>
- </row>
- <row>
- <entry>default_src_test</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id='package-ebuild-eapi-2-phases-default-function-alias'>
- <title>Default Phase Function Alias</title>
- <para>
- A function named "default" is redefined for each phase so that it
- will call the default_* function corresponding to the current phase.
- For example, a call to the function named "default" during the
- src_compile phase is equivalent to a call to the function named
- default_src_compile.
- </para>
- </section>
- </section>
-</section>
-<section id='package-ebuild-eapi-2-pre3'>
- <title>EAPI 2_pre3</title>
- <section id='package-ebuild-eapi-2-pre3-metadata'>
- <title>Metadata</title>
- <section id='package-ebuild-eapi-2-pre3-metadata-dependencies'>
- <title>Dependencies</title>
- <section id='package-ebuild-eapi-2-pre3-metadata-dependencies-blocker-atoms'>
- <title>Blocker Atoms</title>
- <section id='package-ebuild-eapi-2-pre3-metadata-dependencies-blocker-atoms-new-meaning'>
- <title>New Meaning for Old Syntax</title>
- <para>
- Blocker atoms which use the previously existing !atom syntax now have
- a slightly different meaning. These blocker atoms indicate that
- conflicting packages may be temporarily installed simultaneously. When
- temporary simultaneous installation of conflicting packages occurs, the
- installation of a newer package may overwrite any colliding files that
- belong to an older package which is explicitly blocked. When such file
- collisions occur, the colliding files cease to belong to the older
- package, and they remain installed after the older package is
- eventually uninstalled. The older package is uninstalled only after
- any newer blocking packages have been merged on top of it.
- </para>
- </section>
- <section id='package-ebuild-eapi-2-pre3-metadata-dependencies-blocker-atoms-new-syntax'>
- <title>New !!atom Syntax</title>
- <para>
- A new !!atom syntax is now supported, for use in special cases for which
- temporary simultaneous installation of conflicting packages should not be
- allowed. If a given package happens to be blocked my a mixture of atoms
- consisting of both the !atom and !!atom syntaxes, the !!atom syntax takes
- precedence over the !atom syntax.
- </para>
- </section>
- </section>
- </section>
- <section id='package-ebuild-eapi-2-pre3-metadata-src-uri'>
- <title>SRC_URI</title>
- <section id='package-ebuild-eapi-2-pre3-metadata-src-uri-output-file-name-customization'>
- <title>Customization of Output File Names</title>
- <para>
- A new syntax is supported which allows customization of the output
- file name for a given URI. In order to customize the output file
- name, a given URI should be followed by a "->" operator which,
- in turn, should be followed by the desired output file name. As
- usual, all tokens, including the operator and output file name,
- should be separated by whitespace.
- </para>
- </section>
- </section>
- </section>
- <section id='package-ebuild-eapi-2-pre3-phases'>
- <title>Phases</title>
- <section id='package-ebuild-eapi-2-pre3-phases-src-prepare'>
- <title>New src_prepare Phase Function</title>
- <para>
- A new src_prepare function is called after the src_unpack
- function, with cwd initially set to $S.
- </para>
- </section>
- </section>
-</section>
-<section id='package-ebuild-eapi-2-draft'>
- <title>EAPI 2 Draft</title>
- <section id='package-ebuild-eapi-2-draft-helpers'>
- <title>Helpers</title>
- <section id='package-ebuild-eapi-2-draft-helpers-doman'>
- <title>doman</title>
- <section id='package-ebuild-eapi-2-draft-helpers-doman-language-codes'>
+ <section id='package-ebuild-eapi-2-helpers-doman-language-codes'>
<title>Recognition of Language Codes in File Names</title>
<para>
Language codes in file names are now used for path translation.
</section>
</section>
</section>
- <section id='package-ebuild-eapi-2-draft-metadata'>
+ <section id='package-ebuild-eapi-2-metadata'>
<title>Metadata</title>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies'>
<title>Dependencies</title>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-blocker-atoms'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-blocker-atoms'>
<title>Blocker Atoms</title>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-blocker-atoms-new-meaning'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-blocker-atoms-new-meaning'>
<title>New Meaning for Old Syntax</title>
<para>
Blocker atoms which use the previously existing !atom syntax now have
any newer blocking packages have been merged on top of it.
</para>
</section>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-blocker-atoms-new-syntax'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-blocker-atoms-new-syntax'>
<title>New !!atom Syntax</title>
<para>
A new !!atom syntax is now supported, for use in special cases for which
</para>
</section>
</section>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-use'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-use'>
<title>USE Dependencies</title>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-use-unconditional'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-use-unconditional'>
<title>Unconditional USE Dependencies</title>
<table><title>Syntax Examples</title>
<tgroup cols='2' align='left' >
</tgroup>
</table>
</section>
- <section id='package-ebuild-eapi-2-draft-metadata-dependencies-use-conditional'>
+ <section id='package-ebuild-eapi-2-metadata-dependencies-use-conditional'>
<title>Conditional USE Dependencies</title>
<table><title>Syntax Examples</title>
<tgroup cols='2' align='left' >
</section>
</section>
</section>
- <section id='package-ebuild-eapi-2-draft-metadata-src-uri'>
+ <section id='package-ebuild-eapi-2-metadata-src-uri'>
<title>SRC_URI</title>
- <section id='package-ebuild-eapi-2-draft-metadata-src-uri-output-file-name-customization'>
+ <section id='package-ebuild-eapi-2-metadata-src-uri-output-file-name-customization'>
<title>Customization of Output File Names</title>
<para>
A new syntax is supported which allows customization of the output
</section>
</section>
</section>
- <section id='package-ebuild-eapi-2-draft-phases'>
+ <section id='package-ebuild-eapi-2-phases'>
<title>Phases</title>
- <section id='package-ebuild-eapi-2-draft-phases-src-prepare'>
+ <section id='package-ebuild-eapi-2-phases-src-prepare'>
<title>New src_prepare Phase Function</title>
<para>
A new src_prepare function is called after the src_unpack
function, with cwd initially set to $S.
</para>
</section>
- <section id='package-ebuild-eapi-2-draft-phases-src-configure'>
+ <section id='package-ebuild-eapi-2-phases-src-configure'>
<title>New src_configure Phase Function</title>
<para>
The configure portion of the src_compile function has been
}
</programlisting>
</section>
- <section id='package-ebuild-eapi-2-draft-phases-order'>
+ <section id='package-ebuild-eapi-2-phases-order'>
<title>Execution Order of Phase Functions</title>
<table><title>Execution Order of Phase Functions</title>
<tgroup cols='1' align='left' >
</tgroup>
</table>
</section>
- <section id='package-ebuild-eapi-2-draft-phases-default-functions'>
+ <section id='package-ebuild-eapi-2-phases-default-functions'>
<title>Default Phase Functions</title>
<para>
The default pkg_nofetch and src_* phase functions are now
</tgroup>
</table>
</section>
- <section id='package-ebuild-eapi-2-draft-phases-default-function-alias'>
+ <section id='package-ebuild-eapi-2-phases-default-function-alias'>
<title>Default Phase Function Alias</title>
<para>
A function named "default" is redefined for each phase so that it
\-\-noreplace <atom>\fR. As a safety measure, depclean will not remove any
packages unless *all* required dependencies have been resolved. As a
consequence, it is often necessary to run \fIemerge \-\-update \-\-newuse
-\-\-deep \-\-oneshot @system @world\fR prior to depclean.
+\-\-deep @system @world\fR prior to depclean.
\fBWARNING:\fR
Inexperienced users are advised to use \fB\-\-pretend\fR with this
"CHOST", "COUNTER", "DEPEND", "EAPI",
"INHERITED", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
- "repository", "RESTRICT", "SLOT", "USE", "_mtime_", "EPREFIX" ]
+ "repository", "PROPERTIES", "RESTRICT", "SLOT", "USE", "_mtime_", "EPREFIX" ]
def __init__(self, **kwargs):
Task.__init__(self, **kwargs)
if e is not None:
mydepgraph.display_problems()
out = portage.output.EOutput()
- out.eerror("One or packages are either masked or " + \
+ out.eerror("One or more packages are either masked or " + \
"have missing dependencies:")
out.eerror("")
indent = " "
owners = vardbapi._owners.getFileOwnerMap(consumers[:MAX_DISPLAY+2])
for c in consumers[:MAX_DISPLAY]:
print colorize("WARN", " * ") + " used by %s (%s)" % (c, ", ".join([x.mycpv for x in owners[c]]))
- if len(consumers) > MAX_DISPLAY + 1:
+ if len(consumers) == MAX_DISPLAY + 1:
+ print colorize("WARN", " * ") + " used by %s (%s)" % \
+ (consumers[MAX_DISPLAY], ", ".join(
+ x.mycpv for x in owners[consumers[MAX_DISPLAY]]))
+ elif len(consumers) > MAX_DISPLAY:
print colorize("WARN", " * ") + " used by %d other files" % (len(consumers) - MAX_DISPLAY)
- else:
- print colorize("WARN", " * ") + " used by %s (%s)" % (consumers[MAX_DISPLAY], ", ".join([x.mycpv for x in owners[consumers[MAX_DISPLAY]]]))
print "Use " + colorize("GOOD", "emerge @preserved-rebuild") + " to rebuild packages using these libraries"
msg.append("unless *all* required dependencies have been resolved. As a\n")
msg.append("consequence, it is often necessary to run %s\n" % \
good("`emerge --update"))
- msg.append(good("--newuse --deep --oneshot @system @world`") + \
+ msg.append(good("--newuse --deep @system @world`") + \
" prior to depclean.\n")
if action == "depclean" and "--quiet" not in myopts and not myfiles:
out.eerror("")
if isinstance(e, depgraph.UnsatisfiedResumeDep):
- out.eerror("One or packages are either masked or " + \
+ out.eerror("One or more packages are either masked or " + \
"have missing dependencies:")
out.eerror("")
indent = " "
"emerge --noreplace <atom>. As a safety measure, depclean " + \
"will not remove any packages unless *all* required dependencies " + \
"have been resolved. As a consequence, it is often necessary to " + \
- "run emerge --update --newuse --deep --oneshot @system @world " + \
+ "run emerge --update --newuse --deep @system @world " + \
"prior to depclean."
for line in wrap(paragraph, desc_width):
eidx = myuri.find("/", 9)
if eidx != -1:
mirrorname = myuri[9:eidx]
- if myfile != os.path.basename(myuri):
- # If a SRC_URI arrow is used together with
- # mirror://, preserve the remote path that's
- # specified within the uri.
- path = myuri[eidx+1:]
- else:
- path = myfile
+ path = myuri[eidx+1:]
# Try user-defined mirrors first
if mirrorname in custommirrors:
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND',
'PDEPEND', 'PROVIDE', 'EAPI',
- 'UNUSED_01', 'UNUSED_02', 'UNUSED_03', 'UNUSED_04',
- 'UNUSED_05', 'UNUSED_06', 'UNUSED_07',
+ 'PROPERTIES', 'UNUSED_06', 'UNUSED_05', 'UNUSED_04',
+ 'UNUSED_03', 'UNUSED_02', 'UNUSED_01',
]
auxdbkeylen=len(auxdbkeys)
super(database,self).__init__(*args, **config)
self.location = os.path.join(self.location,
self.label.lstrip(os.path.sep).rstrip(os.path.sep))
-
+ write_keys = set(self._known_keys)
+ write_keys.add("_eclasses_")
+ self._write_keys = sorted(write_keys)
if not self.readonly and not os.path.exists(self.location):
self._ensure_dirs()
raise cache_errors.CacheCorruption(cpv, e)
if "_eclasses_" in d:
d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
+ else:
+ d["_eclasses_"] = {}
return d
for x in self._known_keys:
else:
raise cache_errors.CacheCorruption(cpv, e)
- for k, v in values.iteritems():
- if not v:
- continue
- if k != "_mtime_" and (k == "_eclasses_" or k in self._known_keys):
+ try:
+ for k in self._write_keys:
+ v = values.get(k)
+ if not v:
+ continue
myf.write("%s=%s\n" % (k, v))
-
- myf.close()
+ finally:
+ myf.close()
self._ensure_access(fp, mtime=values["_mtime_"])
#update written. now we move it.
auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'IUSE', 'CDEPEND',
- 'PDEPEND', 'PROVIDE','_eclasses_')
+ 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES')
def __init__(self, label, auxdbkeys, **config):
super(database,self).__init__(label, auxdbkeys, **config)
auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND',
- 'PDEPEND', 'PROVIDE', 'EAPI')
+ 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES')
autocommits = True
if "INHERITED" in d:
d["_eclasses_"] = self.ec.get_eclass_data(d["INHERITED"].split(), from_master_only=True)
del d["INHERITED"]
+ else:
+ d["_eclasses_"] = {}
elif isinstance(d["_eclasses_"], basestring):
# We skip this if flat_hash.database._parse_data() was called above
# because it calls reconstruct_eclasses() internally.
d = dict(l)
if "_eclasses_" in d:
d["_eclasses_"] = reconstruct_eclasses(oldcpv, d["_eclasses_"])
+ else:
+ d["_eclasses_"] = {}
yield cpv, d
l.clear()
oldcpv = x
d = dict(l)
if "_eclasses_" in d:
d["_eclasses_"] = reconstruct_eclasses(oldcpv, d["_eclasses_"])
+ else:
+ d["_eclasses_"] = {}
yield cpv, d
def commit(self):
pass #writemsg("%s: %s\n" % (cpv, str(e)))
if "_eclasses_" in d:
d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
+ else:
+ d["_eclasses_"] = {}
for x in self._known_keys:
d.setdefault(x,'')
return d
d=self._getitem(cpv)
if self.serialize_eclasses and "_eclasses_" in d:
d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
+ elif "_eclasses_" not in d:
+ d["_eclasses_"] = {}
return d
def _getitem(self, cpv):
trg = None
try:
trg = trg_cache[x]
- if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \
- eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \
- set(trg["_eclasses_"]) == set(entry["_eclasses_"]):
- write_it = False
- except (cache_errors.CacheError, KeyError):
+ except (KeyError, cache_errors.CacheError):
pass
+ else:
+ try:
+ if long(trg["_mtime_"]) == long(entry["_mtime_"]) and \
+ eclass_cache.is_eclass_data_valid(trg["_eclasses_"]) and \
+ set(trg["_eclasses_"]) == set(entry["_eclasses_"]):
+ write_it = False
+ except cache_errors.CacheError:
+ pass
if trg and not write_it:
""" We don't want to skip the write unless we're really sure that
"package", "preinst", "postinst","prerm", "postrm",
"nofetch", "config", "info", "other"]
-EAPI = 1
+EAPI = 2
HASHING_BLOCKSIZE = 32768
MANIFEST1_HASH_FUNCTIONS = ["MD5","SHA256","RMD160"]
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(
["CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
- "LICENSE", "PDEPEND", "PROVIDE",
+ "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE",
"RDEPEND", "repository", "RESTRICT", "SLOT", "USE",
"EPREFIX"])
self._aux_cache_slot_dict = slot_dict_class(self._aux_cache_keys)
self._pkgindex_keys.update(["CPV", "MTIME", "SIZE"])
self._pkgindex_aux_keys = \
["CHOST", "DEPEND", "DESCRIPTION", "EAPI",
- "IUSE", "KEYWORDS", "LICENSE", "PDEPEND",
+ "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES",
"PROVIDE", "RDEPEND", "repository", "SLOT", "USE",
"EPREFIX"]
self._pkgindex_aux_keys = list(self._pkgindex_aux_keys)
+ self._pkgindex_use_evaluated_keys = \
+ ("LICENSE", "RDEPEND", "DEPEND",
+ "PDEPEND", "PROPERTIES", "PROVIDE")
self._pkgindex_header_keys = set(["ACCEPT_KEYWORDS", "CBUILD",
"CHOST", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES",
"GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE", "EAPI", "EPREFIX"])
"LICENSE" : "",
"PATH" : "",
"PDEPEND" : "",
+ "PROPERTIES" : "",
"PROVIDE" : "",
"RDEPEND" : "",
"RESTRICT": "",
metadata["USE"] = " ".join(use)
from portage.dep import paren_reduce, use_reduce, \
paren_normalize, paren_enclose
- for k in "LICENSE", "RDEPEND", "DEPEND", "PDEPEND", "PROVIDE":
+ for k in self._pkgindex_use_evaluated_keys:
try:
deps = paren_reduce(metadata[k])
deps = use_reduce(deps, uselist=raw_use)
# XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys
# ~harring
filtered_auxdbkeys = filter(lambda x: not x.startswith("UNUSED_0"), auxdbkeys)
+ filtered_auxdbkeys.sort()
if secpass < 1:
from portage.cache import metadata_overlay, volatile
for x in self.porttrees:
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(
["DEPEND", "EAPI", "INHERITED", "IUSE", "KEYWORDS", "LICENSE",
- "PDEPEND", "PROVIDE", "RDEPEND", "repository",
+ "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND", "repository",
"RESTRICT", "SLOT"])
# Repoman modifies _aux_cache_keys, so delay _aux_cache_slot_dict
self._aux_cache_keys = set(
["CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
"EAPI", "HOMEPAGE", "IUSE", "KEYWORDS",
- "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
+ "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND",
"repository", "RESTRICT" , "SLOT", "USE"])
self._aux_cache_obj = None
self._aux_cache_filename = os.path.join(self.root,
@param msg: A very brief (shorter than one line) error message.
@type msg: StringType
"""
- out = sys.stdout
+ out = sys.stderr
if not self.quiet:
if self.__last_e_cmd == "ebegin":
out.write("\n")
@param msg: A very brief (shorter than one line) warning message.
@type msg: StringType
"""
- out = sys.stdout
+ out = sys.stderr
if not self.quiet:
if self.__last_e_cmd == "ebegin":
out.write("\n")