[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/emerge/bin
From:       Ralf Habacker <Ralf.Habacker () freenet ! de>
Date:       2009-08-01 0:12:06
Message-ID: 1249085526.082903.31103.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005421 by habacker:

unmerge package before qmerge if same package is already installed

 M  +4 -1      Package/PackageBase.py  
 M  +15 -3     utils.py  


--- trunk/kdesupport/emerge/bin/Package/PackageBase.py #1005420:1005421
@@ -50,6 +50,9 @@
             if os.path.exists( script ):
                 utils.copyFile( script, destscript )
 
+        if utils.isInstalled( '', self.package, '', self.buildType() ):
+            self.unmerge()
+
         utils.mergeImageDirToRootDir( self.mergeSourceDir(), \
self.mergeDestinationDir() )  self.manifest()
 
@@ -68,7 +71,7 @@
 
     def unmerge( self ):
         """unmergeing the files from the filesystem"""
-        utils.debug("base unmerge called",2)
+        utils.debug("Packagebase unmerge called",2)
 
         ## \todo mergeDestinationDir() reads the real used merge dir from the 
         ## package definition, which fails if this is changed 
--- trunk/kdesupport/emerge/bin/utils.py #1005420:1005421
@@ -310,9 +310,15 @@
     found = False
     f = open( fileName, "rb" )
     for line in f.read().splitlines():
-        if ( line == "%s/%s-%s" % ( category, package, version ) ):
+        (_category, _packageVersion) = line.split( "/" )
+        print _packageVersion
+        (_package, _version) = packageSplit(_packageVersion)
+        if category <> '' and version <> '' and category == _category and package == \
_package and version == _version:  found = True
             break
+        elif category == '' and version == '' and package == _package:
+            found = True
+            break
     f.close()
 
     # find in release mode database
@@ -321,9 +327,14 @@
         if os.path.isfile( fileName ):
             f = open( fileName, "rb" )
             for line in f.read().splitlines():
-                if ( line == "%s/%s-%s" % ( category, package, version ) ):
+                (_category, _packageVersion) = line.split( "/" )
+                (_package, _version) = packageSplit(_packageVersion)
+                if category <> '' and version <> '' and category == _category and \
package == _package and version == _version:  found = True
                     break
+                elif category == '' and version == '' and package == _package:
+                    found = True
+                    break
             f.close()
 
     if ( not found ):
@@ -340,6 +351,7 @@
             if filename.startswith( package ):
                 found = True
                 break
+    debug("package %s %s" % (package, found) ,2)
     return found
 
 def findInstalled( category, package, buildType='' ):
@@ -752,7 +764,7 @@
 
 def unmerge( rootdir, package, forced = False ):
     """ delete files according to the manifest files """
-    debug( "unmerge called: %s" % ( package ), 1 )
+    debug( "unmerge called: %s" % ( package ), 2 )
 
     if os.path.exists( os.path.join( rootdir, "manifest"  ) ):
         for file in os.listdir( os.path.join( rootdir, "manifest" ) ):


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic