einstall() {
# CONF_PREFIX is only set if they didn't pass in libdir above.
+ local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
LIBDIR_VAR="LIBDIR_${ABI}"
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
CONF_LIBDIR="${!LIBDIR_VAR}"
if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:-unset}" != "unset" ]; then
EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})"
- EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${EXTRA_EINSTALL}"
+ LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
unset EI_DESTLIBDIR
fi
localstatedir="${ED}/var/lib" \
mandir="${ED}/usr/share/man" \
sysconfdir="${ED}/etc" \
- ${EXTRA_EINSTALL} \
+ ${LOCAL_EXTRA_EINSTALL} \
"$@" install
fi
make prefix="${ED}/usr" \
localstatedir="${ED}/var/lib" \
mandir="${ED}/usr/share/man" \
sysconfdir="${ED}/etc" \
- ${EXTRA_EINSTALL} \
+ ${LOCAL_EXTRA_EINSTALL} \
"$@" install || die "einstall failed"
else
die "no Makefile found"
}
src_compile() {
- if [ -x ./configure ]; then
+ if [ -x "${ECONF_SOURCE:-.}/configure" ] ; then
econf
fi
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
shortmodes={"ci":"commit"}
modeshelp={
"scan" : "Scan directory tree for QA issues (default)",
+"manifest" : "Generate a Manifest (fetches files if necessary)",
"fix" : "Fix simple QA issues (stray digests, missing digests)",
"full" : "Scan directory tree for QA issues (full listing)",
"help" : "Show this screen",
# the current working directory (from the shell).
mydir = os.environ["PWD"]
mydir = normalize_path(mydir)
+path_ids = set()
+p = mydir
+s = None
+while True:
+ s = os.stat(p)
+ path_ids.add((s.st_dev, s.st_ino))
+ if p == "/":
+ break
+ p = os.path.dirname(p)
if mydir[-1] != "/":
mydir += "/"
for overlay in repoman_settings["PORTDIR_OVERLAY"].split():
+ overlay = os.path.realpath(overlay)
+ try:
+ s = os.stat(overlay)
+ except OSError:
+ continue
+ overlay_id = (s.st_dev, s.st_ino)
if overlay[-1] != "/":
overlay += "/"
- if mydir.startswith(overlay):
+ if overlay_id in path_ids:
portdir_overlay = overlay
subdir = mydir[len(overlay):]
if subdir and subdir[-1] != "/":
portdir = portdir_overlay
break
+del p, s, path_ids
+
if not portdir_overlay:
if (repoman_settings["PORTDIR"] + os.path.sep).startswith(mydir):
portdir_overlay = repoman_settings["PORTDIR"]
def caterror(mycat):
err(mycat+" is not an official category. Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
-if "--pretend" in myoptions:
+if mymode == "manifest":
+ pass
+elif "--pretend" in myoptions:
print green("\nRepoMan does a once-over of the neighborhood...")
elif quiet < 1:
print green("\nRepoMan scours the neighborhood...")
return True
return False
-
+dofail = 0
arch_caches={}
arch_xmatch_caches = {}
for x in scanlist:
dadded=[]
catdir,pkgdir=x.split("/")
checkdir=repodir+"/"+x
+
+ if mymode == "manifest":
+ repoman_settings["O"] = checkdir
+ if not portage.digestgen([], repoman_settings, myportdb=portdb):
+ print "Unable to generate manifest."
+ dofail = 1
+ continue
+
checkdirlist=os.listdir(checkdir)
ebuildlist=[]
for y in checkdirlist:
stats["ebuild.allmasked"]+=1
fails["ebuild.allmasked"].append(x)
+if mymode == "manifest":
+ sys.exit(dofail)
+
#Pickle and save results for instant reuse in last and lfull
if os.access(portage.const.CACHE_PATH, os.W_OK):
for myobj, fname in (stats, "repo.stats"), (fails, "repo.fails"):
mygraph = self._parent_child_digraph
i = 0
depth = 0
+ shown_edges = set()
for x in mylist:
if "blocks" == x[0]:
display_list.append((x, 0, True))
tree_nodes = tree_nodes[:depth]
tree_nodes.append(graph_key)
display_list.append((x, depth, True))
+ shown_edges.add((graph_key, tree_nodes[depth-1]))
else:
traversed_nodes = set() # prevent endless circles
traversed_nodes.add(graph_key)
for node in parent_nodes:
if node not in traversed_nodes and \
node not in child_nodes:
+ edge = (current_node, node)
+ if edge in shown_edges:
+ continue
selected_parent = node
break
if not selected_parent:
# A direct cycle is unavoidable.
for node in parent_nodes:
if node not in traversed_nodes:
+ edge = (current_node, node)
+ if edge in shown_edges:
+ continue
selected_parent = node
break
if selected_parent:
+ shown_edges.add((current_node, selected_parent))
traversed_nodes.add(selected_parent)
add_parents(selected_parent, False)
display_list.append((list(current_node),
UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news")
porttree = portdbapi(porttree_root=settings["PORTDIR"], mysettings=settings)
newsReaderDisplay = False
-
- print
+
for repo in porttree.getRepositories():
unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo)
if unreadItems:
+ if not newsReaderDisplay:
+ newsReaderDisplay = True
+ print
print colorize("WARN", " * IMPORTANT:"),
print "%s news items need reading for repository '%s'." % (unreadItems, repo)
- newsReaderDisplay = True
+
if newsReaderDisplay:
print colorize("WARN", " *"),
print "Use " + colorize("GOOD", "eselect news") + " to read news items."
+ print
- print
def post_emerge(settings, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
doebuild_environment, doebuild, env_update, dircache, \
abssymlink, movefile, bsd_chflags
-import os, sys, stat, cPickle, errno, commands, copy, time
+import os, sys, stat, errno, commands, copy, time
from itertools import izip
+try:
+ import cPickle
+except ImportError:
+ import pickle as cPickle
class PreservedLibsRegistry(object):
""" This class handles the tracking of preserved library objects """
path = os.path.join(self.portdb.getRepositoryPath(repoid), self.NEWS_PATH)
newsdir_lock = None
try:
- newsdir_lock = lockdir(self.portdb.getRepositoryPath(repoid))
+ repo_path = self.portdb.getRepositoryPath(repoid)
+ if os.access(os.path.dirname(repo_path), os.W_OK):
+ # This lock file should really be mapped into /var somewhere
+ # since the repo_path or it's parent directory may not even be
+ # writable.
+ newsdir_lock = lockdir(repo_path)
# Skip reading news for repoid if the news dir does not exist. Requested by
# NightMorph :)
if not os.path.exists(path):
def update_dbentry(update_cmd, mycontent):
if update_cmd[0] == "move":
old_value, new_value = update_cmd[1], update_cmd[2]
- if mycontent.count(old_value):
+ if old_value in mycontent:
old_value = re.escape(old_value);
mycontent = re.sub(old_value+"(:|$|\\s)", new_value+"\\1", mycontent)
def myreplace(matchobj):
elif update_cmd[0] == "slotmove" and get_operator(update_cmd[1]) is None:
pkg, origslot, newslot = update_cmd[1:]
old_value = "%s:%s" % (pkg, origslot)
- if mycontent.count(old_value):
+ if old_value in mycontent:
old_value = re.escape(old_value)
new_value = "%s:%s" % (pkg, newslot)
mycontent = re.sub(old_value+"($|\\s)", new_value+"\\1", mycontent)