remove overlayed dir after use

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1353 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2008-03-01 15:21:37 +00:00
parent 7149a84092
commit ea3b00c2e3
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -405,7 +405,7 @@ except Exception:
conntest = entropyTools.get_remote_data(etpConst['conntestlink'])
if (conntest != False):
print_error(darkgreen("Of course you are on the Internet..."))
rc = Text.askQuestion(" Erm... Can I send the error, along with some information about your hardware to my creators so they can fix me? (Your IP will be logged)")
rc = Text.askQuestion(" Erm... Can I send the error, along with some information\n about your hardware to my creators so they can fix me? (Your IP will be logged)")
if rc == "No":
print_error(darkgreen("Ok, ok ok ok... Sorry!"))
sys.exit(2)
+23
View File
@@ -5967,6 +5967,7 @@ class TriggerInterface:
except:
myebuild = ''
self.myebuild_moved = None
if os.path.isfile(myebuild):
myebuild = self._setup_ebuild_environment(myebuild, portage_atom)
@@ -5991,6 +5992,9 @@ class TriggerInterface:
sys.stderr = oldstderr
stdfile.close()
self._remove_overlayed_ebuild()
return 0
def trigger_ebuild_postremove(self):
@@ -6004,6 +6008,7 @@ class TriggerInterface:
except:
myebuild = ''
self.myebuild_moved = None
if os.path.isfile(myebuild):
myebuild = self._setup_ebuild_environment(myebuild, portage_atom)
@@ -6026,6 +6031,9 @@ class TriggerInterface:
)
sys.stderr = oldstderr
stdfile.close()
self._remove_overlayed_ebuild()
return 0
def _setup_ebuild_environment(self, myebuild, portage_atom):
@@ -6050,8 +6058,23 @@ class TriggerInterface:
newmyebuild = os.path.join(dest_dir,ebuild_file)
if os.path.isfile(newmyebuild):
myebuild = newmyebuild
self.myebuild_moved = myebuild
return myebuild
def _remove_overlayed_ebuild(self):
if not self.myebuild_moved:
return
if os.path.isfile(self.myebuild_moved):
mydir = os.path.dirname(self.myebuild_moved)
shutil.rmtree(mydir,True)
mydir = os.path.dirname(mydir)
content = os.listdir(mydir)
while not content:
os.rmdir(mydir)
mydir = os.path.dirname(mydir)
content = os.listdir(mydir)
'''
Internal ones
'''