update source

This commit is contained in:
Dimitris Zlatanidis 2014-10-21 08:50:59 +03:00
parent 7a20e0da76
commit d728ea8ab1
4 changed files with 20 additions and 21 deletions

View file

@ -1 +1 @@
# [ main ] directory from main import *

View file

@ -74,6 +74,7 @@ class BlackList(object):
"# aaa_elflibs can't be updated.\n", "# aaa_elflibs can't be updated.\n",
"aaa_elflibs\n" "aaa_elflibs\n"
] ]
self.quit = False
self.blackfile = bls_path + "blacklist" self.blackfile = bls_path + "blacklist"
if not os.path.exists(bls_path): if not os.path.exists(bls_path):
os.mkdir(bls_path) os.mkdir(bls_path)
@ -103,20 +104,18 @@ class BlackList(object):
''' '''
Print blacklist packages Print blacklist packages
''' '''
quit = 0
print("\nPackages in blacklist:\n") print("\nPackages in blacklist:\n")
for black in self.packages(): for black in self.packages():
if black: if black:
print("{0}{1}{2}".format(GREEN, black, ENDC)) print("{0}{1}{2}".format(GREEN, black, ENDC))
quit = 1 self.quit = True
if quit == 1: if self.quit:
print # new line at exit print # new line at exit
def add(self, pkgs): def add(self, pkgs):
''' '''
Add blacklist packages if not exist Add blacklist packages if not exist
''' '''
quit = 0
blacklist = self.packages() blacklist = self.packages()
pkgs = set(pkgs) pkgs = set(pkgs)
print("\nAdd packages in blacklist:\n") print("\nAdd packages in blacklist:\n")
@ -125,16 +124,15 @@ class BlackList(object):
if pkg not in blacklist: if pkg not in blacklist:
print("{0}{1}{2}".format(GREEN, pkg, ENDC)) print("{0}{1}{2}".format(GREEN, pkg, ENDC))
black_conf.write(pkg + "\n") black_conf.write(pkg + "\n")
quit = 1 self.quit = True
black_conf.close() black_conf.close()
if quit == 1: if self.quit:
print # new line at exit print # new line at exit
def remove(self, pkgs): def remove(self, pkgs):
''' '''
Remove packages from blacklist Remove packages from blacklist
''' '''
quit = 0
print("\nRemove packages from blacklist:\n") print("\nRemove packages from blacklist:\n")
with open(self.blackfile, "w") as remove: with open(self.blackfile, "w") as remove:
for line in self.black_conf.splitlines(): for line in self.black_conf.splitlines():
@ -142,7 +140,7 @@ class BlackList(object):
remove.write(line + "\n") remove.write(line + "\n")
else: else:
print("{0}{1}{2}".format(RED, line, ENDC)) print("{0}{1}{2}".format(RED, line, ENDC))
quit = 1 self.quit = True
remove.close() remove.close()
if quit == 1: if self.quit:
print # new line at exit print # new line at exit

View file

@ -47,6 +47,7 @@ class QueuePkgs(object):
"# packages you want to build or install.\n", "# packages you want to build or install.\n",
"#\n" "#\n"
] ]
self.quit = False
self.queue = lib_path + "queue/" self.queue = lib_path + "queue/"
self.queue_list = self.queue + "queue_list" self.queue_list = self.queue + "queue_list"
if not os.path.exists(lib_path): if not os.path.exists(lib_path):
@ -79,20 +80,18 @@ class QueuePkgs(object):
''' '''
Print packages from queue Print packages from queue
''' '''
quit = 0
print("\nPackages in queue:\n") print("\nPackages in queue:\n")
for pkg in self.packages(): for pkg in self.packages():
if pkg: if pkg:
print("{0}{1}{2}".format(GREEN, pkg, ENDC)) print("{0}{1}{2}".format(GREEN, pkg, ENDC))
quit = 1 self.quit = True
if quit == 1: if self.quit:
print # new line at exit print # new line at exit
def add(self, pkgs): def add(self, pkgs):
''' '''
Add packages in queue if not exist Add packages in queue if not exist
''' '''
quit = 0
queue_list = self.packages() queue_list = self.packages()
pkgs = set(pkgs) pkgs = set(pkgs)
print("\nAdd packages in queue:\n") print("\nAdd packages in queue:\n")
@ -102,19 +101,18 @@ class QueuePkgs(object):
if pkg not in queue_list and find is not None: if pkg not in queue_list and find is not None:
print("{0}{1}{2}".format(GREEN, pkg, ENDC)) print("{0}{1}{2}".format(GREEN, pkg, ENDC))
queue.write(pkg + "\n") queue.write(pkg + "\n")
quit = 1 self.quit = True
else: else:
print("{0}{1}{2}".format(RED, pkg, ENDC)) print("{0}{1}{2}".format(RED, pkg, ENDC))
quit = 1 self.quit = True
queue.close() queue.close()
if quit == 1: if self.quit:
print # new line at exit print # new line at exit
def remove(self, pkgs): def remove(self, pkgs):
''' '''
Remove packages from queue Remove packages from queue
''' '''
quit = 0
print("\nRemove packages from queue:\n") print("\nRemove packages from queue:\n")
if pkgs == ["all"]: if pkgs == ["all"]:
pkgs = self.packages() pkgs = self.packages()
@ -124,9 +122,9 @@ class QueuePkgs(object):
queue.write(line + "\n") queue.write(line + "\n")
else: else:
print("{0}{1}{2}".format(RED, line, ENDC)) print("{0}{1}{2}".format(RED, line, ENDC))
quit = 1 self.quit = True
queue.close() queue.close()
if quit == 1: if self.quit:
print # new line at exit print # new line at exit
def build(self): def build(self):
@ -153,6 +151,9 @@ class QueuePkgs(object):
print("\nPackages not found in the queue for building\n") print("\nPackages not found in the queue for building\n")
def install(self): def install(self):
'''
Install packages from queue
'''
packages = self.packages() packages = self.packages()
if packages: if packages:
print # new line at start print # new line at start

View file

@ -318,7 +318,7 @@ def select_arch(src, UNST):
''' '''
arch = os.uname()[4] arch = os.uname()[4]
if arch.startswith("i") and arch.endswith("86"): if arch.startswith("i") and arch.endswith("86"):
arch = "i486" arch = "i486"
for item in UNST: for item in UNST:
if item in src: if item in src:
arch = item arch = item