Remove the rpm cache which will be updated for image recreator.
authorwanchao-xu <wanchao.xu@samsung.com>
Mon, 26 Aug 2024 02:48:18 +0000 (10:48 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Tue, 27 Aug 2024 05:24:49 +0000 (13:24 +0800)
Change-Id: I05eb162d5a31ea4c3469ffcc526934e0d8c42e50
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
plugins/backend/zypppkgmgr.py

index ac64e05eeb7943f404d7acb6afa343f36ae1217d..50df6bffff26cb15dca72a6d61193513f1abc2b9 100644 (file)
@@ -522,11 +522,13 @@ class Zypp(BackendPlugin):
         todo = zypp.GetResolvablesToInsDel(self.Z.pool())
         installed_pkgs = todo._toInstall
         dlpkgs = []
+        update_only = False
 
         # re-create image with updating some packages
         if len(installed_pkgs) == 0:
             self.deleteUpdatedPkgs()
             installed_pkgs = self.update_pkgs
+            update_only = True
 
         for pitem in installed_pkgs:
             if not zypp.isKindPattern(pitem) and \
@@ -600,7 +602,7 @@ class Zypp(BackendPlugin):
                 nocache = repo.nocache if repo else False
 
                 if os.path.exists(local):
-                    if nocache or self.checkPkg(local) !=0:
+                    if nocache or self.checkPkg(local) !=0 or update_only:
                         os.unlink(local)
                     else:
                         download_total_size -= int(po.downloadSize())