used without the prefix)
- they may currently only include simple and versioned atoms or other sets, use
conditionals or any-of constructs aren't possible yet
- - emerge makes no difference atm wether you pass a setname or all atoms contained
+ - emerge makes no difference atm whether you pass a setname or all atoms contained
in the set to it, this means that without options packages will be remerged if
already installed, or in the case of --unmerge all atoms in a set will be
unmerged even if they are depended upon by other packages. This may change in
[[ ! -d ${ED}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
_doins() {
- local mysrc="$1" mydir="$2"
+ local mysrc="$1" mydir="$2" cleanup="" rval
if [ -L "$mysrc" ] ; then
cp "$mysrc" "${T}"
mysrc="${T}/${mysrc##*/}"
+ cleanup=${mysrc}
fi
install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}"
+ rval=$?
+ [[ -n ${cleanup} ]] && rm -f "${cleanup}"
+ return $rval
}
_xdoins() {
done
}
+success=0
+
for x in "$@" ; do
if [ -d "$x" ] ; then
if [ "${DOINSRECUR}" == "n" ] ; then
find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \;
find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins
popd >/dev/null
+ ((++success))
else
- _doins "${x}"
+ _doins "${x}" && ((++success))
fi
done
+
+[ $success -gt 0 ] && exit 0 || exit 1
if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \
(md5_list[mybn]["size"] != md5sums[mybn]["size"]):
- # This associates teh md5 with each file. [md5/size]
+ # This associates the md5 with each file. [md5/size]
md5joins = md5_list[mybn][2].split(",")
md5joins = (" ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"],").join(md5joins)
md5joins += " ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"]"
exit 1
fi
-rm -rf "${T}/${2}" && \
-cp -f "${1}" "${T}/${2}" && \
-exec doins "${T}/${2}"
+rm -rf "${T}/${2}" || exit $?
+cp -f "${1}" "${T}/${2}" || exit $?
+doins "${T}/${2}"
+ret=$?
+rm -rf "${T}/${2}"
+exit $ret
if opts.mode == 'commit' and not (opts.force or opts.pretend):
if opts.ignore_masked:
- parser.error('Commit mode and --ignore-masked are not compatable')
+ parser.error('Commit mode and --ignore-masked are not compatible')
if opts.without_mask:
- parser.error('Commit mode and --without-mask are not compatable')
+ parser.error('Commit mode and --without-mask are not compatible')
# Use the verbosity and quiet options to fiddle with the loglevel appropriately
for val in range(opts.verbosity):
fails["KEYWORDS.stupid"].append(x+"/"+y+".ebuild")
"""
- Ebuilds that inherit a "Live" eclasss (darcs,subversion,git,cvs,etc..) should
+ Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
not be allowed to be marked stable
"""
if set(["darcs","cvs","subversion","git"]).intersection(
self.portdb.xmatch("match-all",match))
elif mtype == "desc":
full_package = match
- match = portage.pkgsplit(match)[0]
+ match = portage.cpv_getkey(match)
elif mtype == "set":
print green("*")+" "+white(match)
print " ", darkgreen("Description:")+" ", self.sdict[match].getMetadata("DESCRIPTION")
show_repos = True
verboseadd += teal("[%s]" % repoadd)
- xs = list(portage.pkgsplit(x[2]))
+ xs = [portage.cpv_getkey(pkg_key)] + \
+ list(portage.catpkgsplit(pkg_key)[2:])
if xs[2] == "r0":
xs[2] = ""
else:
myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
p.append(myprint)
- mysplit = portage.pkgsplit(x[2])
- if "--tree" not in self.myopts and mysplit and \
- len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \
- x[1] == "/":
-
- if mysplit[2] == "r0":
- myversion = mysplit[1]
- else:
- myversion = "%s-%s" % (mysplit[1], mysplit[2])
-
- if myversion != portage.VERSION and "--quiet" not in self.myopts:
- if mylist_index < len(mylist) - 1 and EPREFIX == BPREFIX:
- p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
- p.append(colorize("WARN", " then resume the merge."))
- print
- del mysplit
+ mysplit = [portage.cpv_getkey(pkg_key)] + \
+ list(portage.catpkgsplit(pkg_key)[2:])
+ if "--tree" not in self.myopts and mysplit and \
+ len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \
+ x[1] == "/":
+
+ if mysplit[2] == "r0":
+ myversion = mysplit[1]
+ else:
+ myversion = "%s-%s" % (mysplit[1], mysplit[2])
+
+ if myversion != portage.VERSION and "--quiet" not in self.myopts:
+ if mylist_index < len(mylist) - 1:
+ p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
+ p.append(colorize("WARN", " then resume the merge."))
+ print
+ del mysplit
for x in p:
print x
if "--pretend" not in self.myopts and \
"--fetchonly" not in self.myopts and \
"--fetch-all-uri" not in self.myopts:
- # Clean the old package that we have merged over top of it.
- if pkgsettings.get("AUTOCLEAN", "yes") == "yes":
- xsplit=portage.pkgsplit(x[2])
- emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0])
- retval = unmerge(self.trees[myroot]["root_config"],
- self.myopts,
- "clean", [xsplit[0]], ldpath_mtimes, autoclean=1)
- if not retval:
- emergelog(xterm_titles,
- " --- AUTOCLEAN: Nothing unmerged.")
- else:
- portage.writemsg_stdout(colorize("WARN", "WARNING:")
- + " AUTOCLEAN is disabled. This can cause serious"
- + " problems due to overlapping packages.\n")
# Figure out if we need a restart.
- mysplit=portage.pkgsplit(x[2])
- if mysplit[0] == "sys-apps/portage" and x[1] == "/":
+ if myroot == "/" and \
+ portage.dep_getkey(pkg_key) == "sys-apps/portage":
if len(mymergelist) > mergecount and EPREFIX == BPREFIX:
emergelog(xterm_titles,
" ::: completed emerge ("+ \
out.eerror("Error: The resume list contains packages that are no longer")
out.eerror(" available to be emerged. Please restart/continue")
out.eerror(" the merge operation manually.")
- del mtimedb["resume"]
+
+ # delete the current list and also the backup
+ # since it's probably stale too.
+ for k in ("resume", "resume_backup"):
+ mtimedb.pop(k, None)
mtimedb.commit()
return 1
if show_spinner:
from portage import listdir, dep_expand, flatten, key_expand, \
doebuild_environment, doebuild, env_update, prepare_build_dirs, \
- abssymlink, movefile, _movefile, bsd_chflags
+ abssymlink, movefile, _movefile, bsd_chflags, cpv_getkey
from portage.elog import elog_process
from portage.elog.messages import ewarn
for v in self.vartree.dbapi.cp_list(self.mysplit[0]):
otherversions.append(v.split("/")[1])
- slot_matches = self.vartree.dbapi.match(
- "%s:%s" % (self.mysplit[0], slot))
+ # filter any old-style virtual matches
+ slot_matches = [cpv for cpv in self.vartree.dbapi.match(
+ "%s:%s" % (cpv_getkey(self.mycpv), slot)) \
+ if cpv_getkey(cpv) == cpv_getkey(self.mycpv)]
+
if self.mycpv not in slot_matches and \
self.vartree.dbapi.cpv_exists(self.mycpv):
# handle multislot or unapplied slotmove
"portage" == pkgsplit(self.pkg)[0]:
reinstall_self = True
+ autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes"
for dblnk in list(others_in_slot):
if dblnk is self:
continue
- if dblnk.mycpv != self.mycpv and \
- not reinstall_self:
+ if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self):
continue
writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
others_in_slot.remove(dblnk) # dblnk will unmerge itself now
# TODO: Check status and abort if necessary.
dblnk.delete()
writemsg_stdout(">>> Original instance of package unmerged safely.\n")
- if not reinstall_self:
- break
+
+ if len(others_in_slot) > 1:
+ from portage.output import colorize
+ writemsg_stdout(colorize("WARN", "WARNING:")
+ + " AUTOCLEAN is disabled. This can cause serious"
+ + " problems due to overlapping packages.\n")
# We hold both directory locks.
self.dbdir = self.dbpkgdir
del self.fhashdict[ftype][fname]
def hasFile(self, ftype, fname):
- """ Return wether the Manifest contains an entry for the given type,filename pair """
+ """ Return whether the Manifest contains an entry for the given type,filename pair """
return (fname in self.fhashdict[ftype])
def findFile(self, fname):