fix make.conf #3

master
serkus01 2 years ago
parent b89ef5d21f
commit 62dfdd2ad3

@ -5,6 +5,6 @@
"THEME": "default"
},
"Portage":{
"make.conf":"/etc/portge/make.conf/custom"
"make.conf":"/etc/portage/make.conf/custom"
}
}

@ -15,20 +15,20 @@ class PortageConfig():
def parseMakeConf(self):
StateBox = 'Null'
Lines = self.getlines(self.Config.Portage['make.conf'])
Lines = self.getLines(self.Config['Portage']['make.conf'])
for line in lines:
for line in Lines:
if not line.startswith('#'):
if StateBox is 'Null' and not line.endswith('"'):
if StateBox == 'Null' and not line.endswith('"'):
StateBox = line.split('=')[0]
MakeConfig[StateBox] = line.split('=')] = []
for i in line.split('=')] = line.split(" ")
MakeConfig[StateBox] = line.split('=')[1].split(" ")
for i in line.split('=')[1].split(" "):
MakeConfig[StateBox].append(i)
elif StateBox is not 'Null' and not line.endswith('"')
elif StateBox != 'Null' and not line.endswith('"'):
StateBox ='Null'
for i in line.split('=')] = line.split(" ")
MakeConfig[StateBox].append(i)
elif StateBox is 'Null' and line.endswith('"'):
for i in line.split('=')[1].split(" "):
MakeConfig[StateBox].append(i)
elif StateBox == 'Null' and line.endswith('"'):
MakeConfig[StateBox] = line.split(" ")
print(MakeConfig)
@ -38,10 +38,9 @@ class PortageConfig():
def parsePackageMasks(self):
Lines = self.getlines(self.Config.Portage['package.mask'])
def def parsePackageKeywords(self):
def parsePackageKeywords(self):
Lines = self.getlines(self.Config.Portage['package.keywords'])
if __name__ == '__main__':
test = TestConfig()
test.parseMakeConfig()
test = PortageConfig()
test.parseMakeConf()

@ -3,7 +3,7 @@
'__autor__' == 'serkus'
import os, sys, json
from urllib import request
from utils.package import search
from package import search
# import xml
import xml.etree.ElementTree as ET
@ -164,18 +164,14 @@ 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, "")))
if d.replace(path, "").split('/')[0] not in INSTALL:
INSTALL[d.replace(path,"").split('/')[0]].append(dict(name = pkg_name[:-1], ver = f.replace(pkg_name, "")))
else:
INSTALL[d.replace(path,
"").split('/')[0]].append(dict(name = pkg_name[:-1],ver = f.replace(pkg_name, "")
INSTALL[d.replace(path,"").split('/')[0]].append(dict(name = pkg_name[:-1],ver = f.replace(pkg_name, "")))
if d.replace(path, "").split('/')[0] not in INSTALL:
INSTALL[d.replace(path, "").split('/')[0]] = []
INSTALL[d.replace(path, "").split('/')[0]].append(f.replace(".ebuild", "") )
INSTALL[d.replace(path,
"").split('/')[0]].append(f.replace(".ebuild", "")) #dict(name = pkg_name[:-1],ver = f.replace(pkg_name, "")
INSTALL[d.replace(path,"").split('/')[0]].append(f.replace(".ebuild", "")) #dict(name = pkg_name[:-1],ver = f.replace(pkg_name, "")
#print(str(len(INSTALL)))
@ -183,8 +179,8 @@ def sort_install_pkg():
return INSTALL
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
#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"]

Loading…
Cancel
Save