From 20219aa0ff7e8eed28c20e46686cfd01de320faa Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Mar 2006 00:28:12 +0000 Subject: Consolidate duplicate "myebuild" logic in the dblink.treewalk() method. svn path=/main/trunk/; revision=2842 --- pym/portage.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'pym') diff --git a/pym/portage.py b/pym/portage.py index 1b8b020af..af446927e 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5974,12 +5974,9 @@ class dblink: writemsg_stdout(">>> Merging %s %s %s\n" % (self.mycpv,"to",destroot)) # run preinst script - if myebuild: - # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg - # (if any). - a=doebuild(myebuild,"preinst",root,self.settings,cleanup=cleanup,use_cache=0,tree=self.treetype) - else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=cleanup,use_cache=0,tree=self.treetype) + if myebuild is None: + myebuild = os.path.join(inforoot, self.pkg + ".ebuild") + a = doebuild(myebuild, "preinst", root, self.settings, cleanup=cleanup, use_cache=0, tree=self.treetype) # XXX: Decide how to handle failures here. if a != 0: @@ -6078,12 +6075,7 @@ class dblink: portage_locks.unlockfile(mylock) #do postinst script - if myebuild: - # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg - # (if any). - a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0,tree=self.treetype) - else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0,tree=self.treetype) + a = doebuild(myebuild, "postinst", root, self.settings, use_cache=0, tree=self.treetype) # XXX: Decide how to handle failures here. if a != 0: -- cgit v1.2.3-1-g7c22