raise # Needed else can't exit
except Exception, e:
print >> sys.stderr, "\n\n!!! Problem in '%s' dependencies." % mykey
- print >> sys.stderr, "!!!", str(e), e.__module__
+ print >> sys.stderr, "!!!", str(e), getattr(e, "__module__", None)
raise
if not self.mysd:
</programlisting>
</para>
<para>
+ This warning crops up when code starts casting distinct pointer types and
+ then dereferencing them. Generally, this is a violation of aliasing rules
+ which are part of the C standard. Historically, these warnings did not show
+ up as the optimization was not turned on by default. With gcc-4.1.x and
+ newer though, the -O2 optimization level enables strict aliasing support.
+ For information, please review these links:
+ <ulink url="http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html">NetBSD Explanation</ulink>,
+ <ulink url="http://thread.gmane.org/gmane.linux.gentoo.devel/39495">Gentoo Dev Thread</ulink>,
+ <ulink url="http://gcc.gnu.org/bugs.html#nonbugs_c">GCC Docs</ulink>
+ </para>
+ <para>
+ To fix this issue, use the methods proposed in the links mentioned earlier.
+ If you're unable to do so, then a work around would be to append the gcc
+ -fno-strict-aliasing flag to CFLAGS in the ebuild.
</para>
</sect1>
QA Notice: Package has poor programming practices which may compile
fine but exhibit random runtime failures.
...: warning: implicit declaration of function ...
+ ...: warning: incompatible implicit declaration of built-in function ...
</programlisting>
</para>
<para>
<programlisting>
QA Notice: Package has poor programming practices which may compile
fine but exhibit random runtime failures.
- ...: warning: incompatible implicit declaration of built-in function ...
+ ...: warning: is used uninitialized in this function
</programlisting>
</para>
<para>
<programlisting>
QA Notice: Package has poor programming practices which may compile
fine but exhibit random runtime failures.
- ...: warning: is used uninitialized in this function
+ ...: warning: comparisons like X<=Y<=Z do not have their mathematical meaning
</programlisting>
</para>
<para>
<programlisting>
QA Notice: Package has poor programming practices which may compile
fine but exhibit random runtime failures.
- ...: warning: comparisons like X<=Y<=Z do not have their mathematical meaning
+ ...: warning: null argument where non-null required
</programlisting>
</para>
<para>
raise KeyError
myslot = portage_dep.dep_getslot(mydep)
if myslot is not None:
- myval = [cpv for cpv in myval \
- if self.aux_get(cpv, ["SLOT"])[0] == myslot]
+ slotmatches = []
+ for cpv in myval:
+ try:
+ if self.aux_get(cpv, ["SLOT"])[0] == myslot:
+ slotmatches.append(cpv)
+ except KeyError:
+ pass # ebuild masked by corruption
+ myval = slotmatches
if self.frozen and (level not in ["match-list","bestmatch-list"]):
self.xcache[level][mydep]=myval
if origdep and origdep != mydep:
HASHING_BLOCKSIZE = 32768
MANIFEST1_HASH_FUNCTIONS = ["MD5","SHA256","RMD160"]
MANIFEST2_HASH_FUNCTIONS = ["SHA1","SHA256","RMD160"]
+MANIFEST2_REQUIRED_HASH = "SHA1"
MANIFEST2_IDENTIFIERS = ["AUX","MISC","DIST","EBUILD"]
# ===========================================================================
if not from_scratch:
self._read()
self.compat = manifest1_compat
- self.fetchlist_dict = fetchlist_dict
+ if fetchlist_dict != None:
+ self.fetchlist_dict = fetchlist_dict
+ else:
+ self.fetchlist_dict = {}
self.distdir = distdir
self.guessType = guessManifestFileType
""" Validate signature on Manifest """
raise NotImplementedError()
- def addFile(self, ftype, fname, hashdict=None):
+ def addFile(self, ftype, fname, hashdict=None, ignoreMissing=False):
""" Add entry to Manifest optionally using hashdict to avoid recalculation of hashes """
- if not os.path.exists(self.pkgdir+fname):
+ if ftype == "AUX" and not fname.startswith("files/"):
+ fname = os.path.join("files", fname)
+ if not os.path.exists(self.pkgdir+fname) and not ignoreMissing:
raise FileNotFound(fname)
if not ftype in portage_const.MANIFEST2_IDENTIFIERS:
raise InvalidDataType(ftype)
+ if ftype == "AUX" and fname.startswith("files"):
+ fname = fname[6:]
self.fhashdict[ftype][fname] = {}
if hashdict != None:
self.fhashdict[ftype][fname].update(hashdict)
if not portage_const.MANIFEST2_REQUIRED_HASH in self.fhashdict[ftype][fname]:
- self.updateFileHashes(ftype, fname)
+ self.updateFileHashes(ftype, fname, checkExisting=False, ignoreMissing=ignoreMissing)
def removeFile(self, ftype, fname):
""" Remove given entry from Manifest """
self.checkTypeHashes("MISC", ignoreMissingFiles=False)
ebuildname = "%s.ebuild" % self._catsplit(cpv)[1]
self.checkFileHashes("EBUILD", ebuildname, ignoreMissing=False)
- if checkDistfiles:
- if onlyDistfiles:
- for f in self._getCpvDistfiles(cpv):
- self.checkFileHashes("DIST", f, ignoreMissing=False)
+ if checkDistfiles or onlyDistfiles:
+ for f in self._getCpvDistfiles(cpv):
+ self.checkFileHashes("DIST", f, ignoreMissing=False)
def _getCpvDistfiles(self, cpv):
""" Get a list of all DIST files associated to the given cpv """