diff --git a/pym/update/update.py b/pym/update/update.py index c5cedfb..bb34cc7 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -593,6 +593,25 @@ class Update(MethodsInterface): def _eixUpdateCommand(self, eix_cmd, countRep): return PercentProgress(eix_cmd, "-F", part=countRep or 1, atty=True) + def _copyPreviousEix(self): + chroot_path = self.clVars.Get("cl_chroot_path") + portage_eix = pathJoin(chroot_path, "var/cache/eix/portage.eix") + previous_eix = pathJoin(chroot_path, "var/cache/eix/previous.eix") + if path.exists(portage_eix): + if path.exists(previous_eix): + os.unlink(previous_eix) + try: + with writeFile(previous_eix) as f: + f.write(readFile(portage_eix)) + portage_eix_stat = os.stat(portage_eix) + os.chmod(previous_eix, portage_eix_stat.st_mode) + os.chown(previous_eix, portage_eix_stat.st_uid, + portage_eix_stat.st_gid) + except (OSError,IOError): + self.printWARNING(_("Failed to create previous eix")) + return True + + def eixUpdate(self, repositories): """ Выполенине eix-update для репозиторием @@ -601,6 +620,8 @@ class Update(MethodsInterface): обновлялись, если cl_update_eixsync_force==auto, либо все, если cl_update_eixupdate_force==force """ + self._copyPreviousEix() + eixupdate = self.get_prog_path("/usr/bin/eix-update") if not eixupdate: raise UpdateError(_("The Eix tool is not found"))