|
|
|
@ -147,6 +147,7 @@ def sort_install_pkg():
|
|
|
|
|
#pkg =scan_config_portage()
|
|
|
|
|
INSTALL = {}
|
|
|
|
|
pkg_name =""
|
|
|
|
|
TrePortage = ScanTreePortage()
|
|
|
|
|
path = '/var/db/pkg/'
|
|
|
|
|
for d, dirs, files in os.walk(path):
|
|
|
|
|
for f in files:
|
|
|
|
@ -163,6 +164,7 @@ def sort_install_pkg():
|
|
|
|
|
#print(pkg_name)
|
|
|
|
|
if pkg_name not in INSTALL:
|
|
|
|
|
INSTALL[d.replace(path, "").split('/')[0]] = []
|
|
|
|
|
if
|
|
|
|
|
INSTALL[d.replace(path,"").split('/')[0]].append(dict(name = pkg_name[:-1], ver = f.replace(pkg_name, "")))
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
@ -179,8 +181,10 @@ def sort_install_pkg():
|
|
|
|
|
#print(str(len(INSTALL)))
|
|
|
|
|
#return json.dumps({'install_pkgs':INSTALL})
|
|
|
|
|
return INSTALL
|
|
|
|
|
def scan TreePortage():
|
|
|
|
|
def ScanTreePortage():
|
|
|
|
|
DirsRoot = ["/var/db/repos", "/usr/portage"]
|
|
|
|
|
d, ListTree, f for in os.walk('/usr/portage') and d, ListTree, f for in os.walk("/var/db/repos")
|
|
|
|
|
return ListTree
|
|
|
|
|
|
|
|
|
|
def scan_config_portage():
|
|
|
|
|
Dirs_root = ["/var/db/repos", "/usr/portage"]
|
|
|
|
@ -190,8 +194,8 @@ def scan_config_portage():
|
|
|
|
|
Data = {}
|
|
|
|
|
Pf = {}
|
|
|
|
|
for Dir_root in Dirs_root:
|
|
|
|
|
for d, dirs, files in os.walk(dir_root):
|
|
|
|
|
print(str(d))
|
|
|
|
|
for d, dirs, files in os.walk(Dir_root):
|
|
|
|
|
#print(str(d))
|
|
|
|
|
I += 1
|
|
|
|
|
for fl in files:
|
|
|
|
|
with open(d + "/" + fl) as f:
|
|
|
|
|