读取重要软件包列表
This commit is contained in:
parent
b35e2d0e5a
commit
a46a14a6ef
|
@ -321,13 +321,12 @@ class Sqlite3Server(object):
|
|||
|
||||
# 获取group信息
|
||||
def GetGroupmsg(self, appname):
|
||||
INPUT_CONFIG_PATH = apt_pkg.config.find_dir("Kylin-system-updater::InputConfigDir",
|
||||
'/usr/share/kylin-update-desktop-config/data')
|
||||
INPUT_CONFIG_PATH = '/usr/share/kylin-update-desktop-config/data/'
|
||||
jsonfile = appname+".json"
|
||||
files = os.listdir(INPUT_CONFIG_PATH) #获取文件夹中所有文件
|
||||
if jsonfile in files: # 存在
|
||||
# 读取组JSON文件
|
||||
with open(INPUT_CONFIG_PATH+"/"+jsonfile, "r") as f:
|
||||
with open(INPUT_CONFIG_PATH+jsonfile, "r") as f:
|
||||
try :
|
||||
data = json.load(f)
|
||||
except json.JSONDecodeError as e:
|
||||
|
|
|
@ -2,11 +2,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#参考文档: https://cuiqingcai.com/6080.html
|
||||
|
||||
import apt_pkg
|
||||
import os
|
||||
|
||||
path = apt_pkg.config.find_dir("Kylin-system-updater::LogDir",
|
||||
"/var/log/kylin-system-updater/")
|
||||
path = '/var/log/kylin-system-updater/'
|
||||
|
||||
numlist = []
|
||||
|
||||
|
|
|
@ -6,18 +6,15 @@ import os
|
|||
import json
|
||||
import yaml
|
||||
import shutil
|
||||
import apt_pkg
|
||||
from gi.repository import Gio
|
||||
from .OriginFilter import UpdateListFilterCache
|
||||
|
||||
OUTPUT_CONFIG_PATH = apt_pkg.config.find_dir("Kylin-system-updater::OutputConfigDir",
|
||||
'/var/lib/kylin-system-updater/json')
|
||||
|
||||
INPUT_CONFIG_PATH = apt_pkg.config.find_dir("Kylin-system-updater::InputConfigDir",
|
||||
'/usr/share/kylin-update-desktop-config/data')
|
||||
OUTPUT_CONFIG_PATH = '/var/lib/kylin-system-updater/json/'
|
||||
|
||||
IMPORTANT_LIST_PATH = apt_pkg.config.find_file("Kylin-system-updater::ImportantListDir",
|
||||
"/var/lib/kylin-software-properties/template/important.list")
|
||||
INPUT_CONFIG_PATH = '/usr/share/kylin-update-desktop-config/data/'
|
||||
|
||||
IMPORTANT_LIST_PATH = '/var/lib/kylin-software-properties/template/important.list'
|
||||
|
||||
class LocalUpgradeDataList:
|
||||
"""
|
||||
|
|
|
@ -10,6 +10,7 @@ import shutil
|
|||
import dbus
|
||||
import logging
|
||||
import dbus.service
|
||||
import json
|
||||
from apt.debfile import DebPackage
|
||||
from dbus.mainloop.glib import DBusGMainLoop
|
||||
DBusGMainLoop(set_as_default=True)
|
||||
|
@ -70,7 +71,9 @@ class UpdateManager():
|
|||
#是否使用光盘源
|
||||
self.disc_source = False
|
||||
|
||||
self.essential_pkgs = ["kylin-video"]
|
||||
self.essential_pkgs = []
|
||||
|
||||
self.update_essential_pkgs()
|
||||
|
||||
#是否开启关机后安装或者重启安装模式
|
||||
if self.is_shutdown_model() == True:
|
||||
|
@ -79,6 +82,18 @@ class UpdateManager():
|
|||
|
||||
self.only_update_cache()
|
||||
|
||||
def update_essential_pkgs(self):
|
||||
update_file = "/usr/share/kylin-update-desktop-config/data/kylin-update-desktop-system.json"
|
||||
if os.path.exists(update_file):
|
||||
#读取组JSON文件
|
||||
with open(update_file,'r') as f:
|
||||
try:
|
||||
data = json.load(f)
|
||||
except json.JSONDecodeError as exc:
|
||||
logging.error(exc)
|
||||
|
||||
self.essential_pkgs = data['install_list']
|
||||
|
||||
def prompt_in_boot(self):
|
||||
#关机安装完成之后开机时进行提醒
|
||||
popconfigs = UpgradeConfig(datadir = "/opt/apt_result/", name = "ota_result")
|
||||
|
|
|
@ -536,6 +536,7 @@ class InstallBackend():
|
|||
#当单包升级的时候 升级本身时,让程序退出,再重新启动
|
||||
if self.window_main.GROUPS_PKG_NAME in self.cache and self.cache[self.window_main.GROUPS_PKG_NAME] in self.cache.get_changes():
|
||||
#只有安装配置文件包 才会走到此处
|
||||
self.window_main.update_essential_pkgs()
|
||||
self.window_main.start_available()
|
||||
|
||||
return
|
||||
|
|
|
@ -1,27 +1 @@
|
|||
//reference 50uu
|
||||
Kylin-system-updater::Allowed-Origins {
|
||||
//"Ubuntu:trusty";
|
||||
"Kylin:10.1";
|
||||
":default";
|
||||
};
|
||||
|
||||
Kylin-system-updater::Package-Blacklist {
|
||||
};
|
||||
|
||||
Kylin-system-updater::Package-Whitelist {
|
||||
};
|
||||
|
||||
Kylin-system-updater::Package-Whitelist-Strict {
|
||||
};
|
||||
|
||||
Kylin-system-updater::DevRelease "auto";
|
||||
|
||||
Kylin-system-updater::LogDir "/var/log/kylin-system-updater/";
|
||||
|
||||
Kylin-system-updater::InputConfigDir "/usr/share/kylin-update-desktop-config/data";
|
||||
|
||||
Kylin-system-updater::OutputConfigDir "/var/lib/kylin-system-updater/json";
|
||||
|
||||
Kylin-system-updater::ImportantListDir "/var/lib/kylin-software-properties/template/important.list";
|
||||
|
||||
Dir::Bin::Methods::ftp "ftp";
|
||||
|
|
Loading…
Reference in New Issue