From e87ba07ce71ff048e6a7acb51230b09db4f5fd3b Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 10:55:30 +0800
Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=BD=AF=E4=BB=B6=E6=BA=90?=
 =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=88=B0=E6=9C=AC=E5=9C=B0=E7=9A=84=E8=BD=AF?=
 =?UTF-8?q?=E4=BB=B6=E5=8C=85=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 sysmig_agent/Abisystmcompchk.py | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py
index 438fc2d..bac4205 100644
--- a/sysmig_agent/Abisystmcompchk.py
+++ b/sysmig_agent/Abisystmcompchk.py
@@ -491,4 +491,28 @@ def process_data(threadName, q, queueLock, incompfw, compfw, Queue, pro_log):
             pro_log.info('message tup queue:' + str(msg_tup))
             queueLock.release()
         else:
-            queueLock.release()
\ No newline at end of file
+            queueLock.release()
+
+
+def get_system_pkg_list(migbeflist):
+    download_rpm_nums = 0
+    migration_rpm_pkg_path = local_dir + 'uos/rpms'
+
+    #clean history data
+    if os.path.exists(migration_system_total):
+        os.remove(migration_system_total)
+
+    ftw = open(migration_system_total, 'w')
+    items = os.listdir(migration_rpm_pkg_path)
+    newlist = []
+    for names in items:
+        if names.endswith(".rpm"):
+            ftw.write(names.rsplit('-',1)[0].rsplit('-',1)[0] + '\n')
+            migbeflist.append(names.rsplit('-',1)[0].rsplit('-',1)[0])
+            newlist.append(names)
+            download_rpm_nums = download_rpm_nums + 1
+    ftw.close()
+    if download_rpm_nums:
+        return newlist
+    else:
+        return False
-- 
2.20.1

