From c6266cc39c887747e2d4e835b718dc10dca2b1b4 Mon Sep 17 00:00:00 2001 From: lxnay Date: Sun, 25 Jan 2009 17:25:12 +0000 Subject: [PATCH] Entropy/Equo: - searchOrphans: do not crash on symlink loops Entropy/RepoInterface: - when setting up a new gentoo profile and reverting the change, make sure to remove the old make.profile too git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2938 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- TODO | 2 +- client/text_query.py | 6 +++++- libraries/entropy.py | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index a1ce53cae..905af00cd 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,7 @@ TODO list - documentation + man page Repository Manager: - - multiple instances support + - multiple instances support (on server: Fatal Python error: PyEval_RestoreThread: NULL tstate) Proposed for Entropy >1.0 (require API changes): - Entropy codebase refactoring diff --git a/client/text_query.py b/client/text_query.py index 1f9d7612c..3f02f7f59 100644 --- a/client/text_query.py +++ b/client/text_query.py @@ -481,7 +481,11 @@ def searchOrphans(EquoConnection = None): tdbconn = Equo.openGenericDatabase(filepath) tdbconn.initializeDatabase() for xdir in dirs: - for currentdir,subdirs,files in os.walk(xdir): + try: + wd = os.walk(xdir) + except RuntimeError: # maximum recursion? + continue + for currentdir,subdirs,files in wd: foundFiles = {} for filename in files: # filter python compiled objects? diff --git a/libraries/entropy.py b/libraries/entropy.py index 0b46e79bd..c398bc8de 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -7654,6 +7654,8 @@ class RepoInterface: os.remove(system_make_profile) os.symlink(repo_profile_link_data,system_make_profile) if not self.entropyTools.is_valid_path(system_make_profile): + if os.path.lexists(system_make_profile): + os.remove(system_make_profile) # revert change, link does not exist yet self.Entropy.updateProgress( "%s: %s %s. %s." % (