mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
update source
This commit is contained in:
parent
7a20e0da76
commit
d728ea8ab1
4 changed files with 20 additions and 21 deletions
|
@ -1 +1 @@
|
|||
# [ main ] directory
|
||||
from main import *
|
||||
|
|
|
@ -74,6 +74,7 @@ class BlackList(object):
|
|||
"# aaa_elflibs can't be updated.\n",
|
||||
"aaa_elflibs\n"
|
||||
]
|
||||
self.quit = False
|
||||
self.blackfile = bls_path + "blacklist"
|
||||
if not os.path.exists(bls_path):
|
||||
os.mkdir(bls_path)
|
||||
|
@ -103,20 +104,18 @@ class BlackList(object):
|
|||
'''
|
||||
Print blacklist packages
|
||||
'''
|
||||
quit = 0
|
||||
print("\nPackages in blacklist:\n")
|
||||
for black in self.packages():
|
||||
if black:
|
||||
print("{0}{1}{2}".format(GREEN, black, ENDC))
|
||||
quit = 1
|
||||
if quit == 1:
|
||||
self.quit = True
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
||||
def add(self, pkgs):
|
||||
'''
|
||||
Add blacklist packages if not exist
|
||||
'''
|
||||
quit = 0
|
||||
blacklist = self.packages()
|
||||
pkgs = set(pkgs)
|
||||
print("\nAdd packages in blacklist:\n")
|
||||
|
@ -125,16 +124,15 @@ class BlackList(object):
|
|||
if pkg not in blacklist:
|
||||
print("{0}{1}{2}".format(GREEN, pkg, ENDC))
|
||||
black_conf.write(pkg + "\n")
|
||||
quit = 1
|
||||
self.quit = True
|
||||
black_conf.close()
|
||||
if quit == 1:
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
||||
def remove(self, pkgs):
|
||||
'''
|
||||
Remove packages from blacklist
|
||||
'''
|
||||
quit = 0
|
||||
print("\nRemove packages from blacklist:\n")
|
||||
with open(self.blackfile, "w") as remove:
|
||||
for line in self.black_conf.splitlines():
|
||||
|
@ -142,7 +140,7 @@ class BlackList(object):
|
|||
remove.write(line + "\n")
|
||||
else:
|
||||
print("{0}{1}{2}".format(RED, line, ENDC))
|
||||
quit = 1
|
||||
self.quit = True
|
||||
remove.close()
|
||||
if quit == 1:
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
|
|
@ -47,6 +47,7 @@ class QueuePkgs(object):
|
|||
"# packages you want to build or install.\n",
|
||||
"#\n"
|
||||
]
|
||||
self.quit = False
|
||||
self.queue = lib_path + "queue/"
|
||||
self.queue_list = self.queue + "queue_list"
|
||||
if not os.path.exists(lib_path):
|
||||
|
@ -79,20 +80,18 @@ class QueuePkgs(object):
|
|||
'''
|
||||
Print packages from queue
|
||||
'''
|
||||
quit = 0
|
||||
print("\nPackages in queue:\n")
|
||||
for pkg in self.packages():
|
||||
if pkg:
|
||||
print("{0}{1}{2}".format(GREEN, pkg, ENDC))
|
||||
quit = 1
|
||||
if quit == 1:
|
||||
self.quit = True
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
||||
def add(self, pkgs):
|
||||
'''
|
||||
Add packages in queue if not exist
|
||||
'''
|
||||
quit = 0
|
||||
queue_list = self.packages()
|
||||
pkgs = set(pkgs)
|
||||
print("\nAdd packages in queue:\n")
|
||||
|
@ -102,19 +101,18 @@ class QueuePkgs(object):
|
|||
if pkg not in queue_list and find is not None:
|
||||
print("{0}{1}{2}".format(GREEN, pkg, ENDC))
|
||||
queue.write(pkg + "\n")
|
||||
quit = 1
|
||||
self.quit = True
|
||||
else:
|
||||
print("{0}{1}{2}".format(RED, pkg, ENDC))
|
||||
quit = 1
|
||||
self.quit = True
|
||||
queue.close()
|
||||
if quit == 1:
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
||||
def remove(self, pkgs):
|
||||
'''
|
||||
Remove packages from queue
|
||||
'''
|
||||
quit = 0
|
||||
print("\nRemove packages from queue:\n")
|
||||
if pkgs == ["all"]:
|
||||
pkgs = self.packages()
|
||||
|
@ -124,9 +122,9 @@ class QueuePkgs(object):
|
|||
queue.write(line + "\n")
|
||||
else:
|
||||
print("{0}{1}{2}".format(RED, line, ENDC))
|
||||
quit = 1
|
||||
self.quit = True
|
||||
queue.close()
|
||||
if quit == 1:
|
||||
if self.quit:
|
||||
print # new line at exit
|
||||
|
||||
def build(self):
|
||||
|
@ -153,6 +151,9 @@ class QueuePkgs(object):
|
|||
print("\nPackages not found in the queue for building\n")
|
||||
|
||||
def install(self):
|
||||
'''
|
||||
Install packages from queue
|
||||
'''
|
||||
packages = self.packages()
|
||||
if packages:
|
||||
print # new line at start
|
||||
|
|
|
@ -318,7 +318,7 @@ def select_arch(src, UNST):
|
|||
'''
|
||||
arch = os.uname()[4]
|
||||
if arch.startswith("i") and arch.endswith("86"):
|
||||
arch = "i486"
|
||||
arch = "i486"
|
||||
for item in UNST:
|
||||
if item in src:
|
||||
arch = item
|
||||
|
|
Loading…
Reference in a new issue