echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
else
- dir=$(dirname ${obj})
+ dir=${obj%/*}
# replace $ORIGIN with the dirname of the current object for the lookup
opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#")
sneeded=$(echo ${needed} | tr , ' ')
for lib in ${sneeded}; do
found=0
for path in ${opath//:/ }; do
- [ -e "${D}/${path}/${lib}" ] && found=1
+ [ -e "${D}/${path}/${lib}" ] && found=1 && break
done
[ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}"
done
}
dyn_spec() {
- tar czf "/usr/src/rpm/SOURCES/${PF}.tar.gz" \
+ local sources_dir=/usr/src/rpm/SOURCES
+ mkdir -p "${sources_dir}"
+ tar czf "${sources_dir}/${PF}.tar.gz" \
"${EBUILD}" "${FILESDIR}" || \
die "Failed to create base rpm tarball."
}
dyn_rpm() {
+ cd "${T}" || die "cd failed"
+ local machine_name=$(uname -m)
+ local dest_dir=/usr/src/rpm/RPMS/${machine_name}
addwrite /usr/src/rpm
addwrite "${RPMDIR}"
dyn_spec
rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"
- install -D "/usr/src/rpm/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" \
+ install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \
"${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
die "Failed to move rpm"
}
fetch_env["PORTAGE_PARALLEL_FETCHONLY"] = "1"
ebuild_binary = os.path.join(
- settings["EBUILD_BIN_PATH"], "ebuild")
+ settings["PORTAGE_BIN_PATH"], "ebuild")
fetch_args = [ebuild_binary, ebuild_path, "fetch"]
debug = settings.get("PORTAGE_DEBUG") == "1"
if build_opts.fetchonly:
action_desc = "Fetching"
- if not build_opts.pretend:
+ msg = "%s (%s of %s) %s" % \
+ (action_desc,
+ colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
+ colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
+ colorize("GOOD", pkg.cpv))
- self.statusMessage("%s (%s of %s) %s %s %s" % \
- (action_desc,
- colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
- colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
- colorize("GOOD", pkg.cpv), preposition, pkg.root))
+ if pkg.root != "/":
+ msg += " %s %s" % (preposition, pkg.root)
+ if not build_opts.pretend:
+ self.statusMessage(msg)
logger.log(" >>> emerge (%s of %s) %s to %s" % \
(pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root))
action_desc = "Installing"
preposition = "to"
+ msg = "%s %s" % (action_desc, colorize("GOOD", pkg.cpv))
+
+ if pkg.root != "/":
+ msg += " %s %s" % (preposition, pkg.root)
+
if not self.merge.build_opts.fetchonly and \
not self.merge.build_opts.pretend and \
not self.merge.build_opts.buildpkgonly:
- self.merge.statusMessage("%s %s %s %s" % \
- (action_desc, colorize("GOOD", pkg.cpv),
- preposition, pkg.root))
+ self.merge.statusMessage(msg)
self.returncode = self.merge.merge()
self.wait()
if x.startswith(SETPREFIX):
s = x[len(SETPREFIX):]
if s not in sets:
- raise portage.exception.PackageNotFound(
- "emerge: there are no sets to satisfy '%s'." % s)
+ raise portage.exception.PackageSetNotFound(s)
if s in self._sets:
continue
# Recursively expand sets so that containment tests in
except portage.exception.PackageNotFound, e:
portage.writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
return 1
+ except portage.exception.PackageSetNotFound, e:
+ root_config = trees[settings["ROOT"]]["root_config"]
+ display_missing_pkg_set(root_config, e.value)
+ return 1
if show_spinner:
print "\b\b... done!"
if not retval:
settings["NOCOLOR"] = "true"
settings.backup_changes("NOCOLOR")
+def apply_priorities(settings):
+ ionice(settings)
+ nice(settings)
+
+def nice(settings):
+ try:
+ os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
+ except (OSError, ValueError), e:
+ out = portage.output.EOutput()
+ out.eerror("Failed to change nice value to '%s'" % \
+ settings["PORTAGE_NICENESS"])
+ out.eerror("%s\n" % str(e))
+
def ionice(settings):
ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND")
out.eerror("PORTAGE_IONICE_COMMAND returned %d" % (rval,))
out.eerror("See the make.conf(5) man page for PORTAGE_IONICE_COMMAND usage instructions.")
+def display_missing_pkg_set(root_config, set_name):
+
+ msg = []
+ msg.append(("emerge: There are no sets to satisfy '%s'. " + \
+ "The following sets exist:") % \
+ colorize("INFORM", set_name))
+ msg.append("")
+
+ for s in sorted(root_config.sets):
+ msg.append(" %s" % s)
+ msg.append("")
+
+ writemsg_level("".join("%s\n" % l for l in msg),
+ level=logging.ERROR, noiselevel=-1)
+
def emerge_main():
global portage # NFC why this is necessary now - genone
portage._disable_legacy_globals()
settings, trees, mtimedb = load_emerge_config()
portdb = trees[settings["ROOT"]]["porttree"].dbapi
- ionice(settings)
-
- try:
- os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
- except (OSError, ValueError), e:
- portage.writemsg("!!! Failed to change nice value to '%s'\n" % \
- settings["PORTAGE_NICENESS"])
- portage.writemsg("!!! %s\n" % str(e))
- del e
-
if portage._global_updates(trees, mtimedb["updates"]):
mtimedb.commit()
# Reload the whole config from scratch.
mysettings.lock()
del myroot, mysettings
+ apply_priorities(settings)
+
spinner = stdout_spinner()
if "candy" in settings.features:
spinner.update = spinner.update_scroll
if a.startswith(SETPREFIX):
s = a[len(SETPREFIX):]
if s not in sets:
- print "emerge: there are no sets to satisfy %s." % \
- colorize("INFORM", s)
+ display_missing_pkg_set(root_config, s)
return 1
setconfig.active.append(s)
if myaction in unmerge_actions and \
obj = realpath(obj)
if obj not in self._obj_properties:
raise KeyError("%s not in object list" % obj)
+
+ # If there is another version of this lib with the
+ # same soname and the master link points to that
+ # other version, this lib will be shadowed and won't
+ # have any consumers.
+ arch, needed, path, soname = self._obj_properties[obj]
+ obj_dir = os.path.dirname(obj)
+ master_link = os.path.join(obj_dir, soname)
+ try:
+ master_st = os.stat(master_link)
+ obj_st = os.stat(obj)
+ except OSError:
+ pass
+ else:
+ if (obj_st.st_dev, obj_st.st_ino) != \
+ (master_st.st_dev, master_st.st_ino):
+ return set()
+
rValue = set()
for soname in self._libs:
for arch in self._libs[soname]:
path = [realpath(y) for y in path+self._defpath]
if soname[0] == os.sep and realpath(soname) == realpath(obj):
rValue.add(x)
- elif realpath(os.path.dirname(obj)) in path:
+ elif realpath(obj_dir) in path:
rValue.add(x)
return rValue
for f in sorted(owned_files):
msg.append("\t%s" % os.path.join(destroot,
f.lstrip(os.path.sep)))
+ msg.append("")
eerror(msg)
+
if not owners:
eerror(["None of the installed" + \
- " packages claim the file(s)."])
+ " packages claim the file(s).", ""])
+
+ # The explanation about the collision and how to solve
+ # it may not be visible via a scrollback buffer, especially
+ # if the number of file collisions is large. Therefore,
+ # show a summary at the end.
+ msg = ("Package '%s' NOT merged due to " + \
+ "file collisions. If necessary, refer to your elog " + \
+ "messages for the whole content of the above message.") % \
+ self.settings.mycpv
+ eerror(wrap(msg, 70))
+
if collision_protect:
return 1