Kaydet (Commit) 4a2f713b authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Last changes before stable

üst 9ed6a21c
2018-03-29 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Hata düzeltmeleri:
Kararlı öncesi.
-> Magic modülü kararlı hale getirildi, pkgconfig librarisi düzenlenecek.
-> Arşiv çıkartılırken oluşan hata düzeltildi.
-> inary-cli betiğini hangi kafa ile düzeltmişim? Saçmalamasına
sebeb olan hata düzeltildi
* Genel iyileştirmeler
-> Actionsapi betiklerinden gereksiz fonksiyon var mı diye kontrol edilip
betikler düzenlendi.
-> Yeni bir renk skalası eklendi. ("faint")
-> Renklendirme yapıldı
2018-03-18 Suleyman Poyraz <nipalensisaquila@gmail.com>
* minidom vs ciksemek:
* minidom vs ciksemel:
minidom ile tüm inary sistemi yeniden yazıldı. Ancak ciddi manada
inar yavaşlıyor. Db initializing süresi 8 sn. Yuh yani. Ama minidom
uğraşımı öylece silmek istemediğim için minidom ve ciksemeli beraber
......
......@@ -24,7 +24,7 @@ Legend:
+ CMake Tools
/ unit test
+ source building
- Detailed build log file
+ Detailed build log file
+ package module
+ extraction
+ add file / compression
......@@ -89,9 +89,9 @@ Legend:
+ basic types
+ list type
+ class type
/ localtext/text types (localtext.... Ummm?.... )
+ write meaningful localtext datas (Zaryob)
- return meaningful localtext summaries and descriptions (Hak getire, inşallah xml.dom ile)
+ localtext/text types (localtext.... Ummm?.... )
+ write meaningful localtext datas
+ return meaningful localtext summaries and descriptions
+ revised interface
/ Error handling
+ improved error handling, check routines, hooks, format/print routines
......@@ -120,7 +120,7 @@ Legend:
+ decide how to implement
+ support repo order
+ refactor xml support and implement multiple backends
/ ciksemel based modules rewrite with xml.dom.minidom (Zaryob)
+ ciksemel based modules rewrite with xml.dom.minidom (Zaryob)
/ partial caching and automatic resume for file download (meren)
+ use a '.part' extension
- resume file downloading (Darara.... fetcher will rewrite with httplib) (Zaryob)
......@@ -142,7 +142,7 @@ Legend:
+ UI
- INARYMAT
/ Automatic dependency finder
/ read pkgconfig files and find dependencies (Zaryob)
+ read pkgconfig files and find dependencies (Zaryob)
+ find cycle dependencies (Zaryob)
- Automatic build upgrader
- pykde & pygtk GUI (cartman)
......@@ -214,7 +214,7 @@ Legend:
- refactoring
sort of match the refactoring of inary-2.x series and improve it
- accelerate search
+ accelerate search
/ package signing
/ an embebed package signer.(aquila)
+ a flag to sign package after building
......
......@@ -9,6 +9,7 @@
#
# Please read the COPYING file.
#
import sys
import errno
import traceback
......@@ -17,11 +18,6 @@ import signal
import inary
import inary.context as ctx
import inary.cli.inarycli as inarycli
try:
import ciksemel
except:
#FIXME: Görünüşü güzel olsa bile kodda anlamsızlık yaratıyor
sys.stdout.write("\033[05;31mWARNING:\033[0m\n\t\033[02;37mCiksemel XML Parser not found!!!\n\tFalling back with minidom!!! :(\033[0m\n\n")
import gettext
gettext.bindtextdomain('inary', "/usr/share/locale")
......@@ -29,6 +25,14 @@ gettext.textdomain('inary')
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
try:
import ciksemel
except:
#FIXME: Görünüşü güzel olsa bile kodda anlamsızlık yaratıyor
warn = inary.util.colorize(_("WARNING\n"),"blinkingred")+ inary.util.colorize(_("\tCiksemel XML Parser not found!!!\n"
"\tFalling back with minidom!!! :(\n"), 'faintwhite')
sys.stdout.write(warn)
def sig_handler(sig, frame):
if sig == signal.SIGTERM:
exit()
......@@ -37,19 +41,19 @@ def exit():
sys.exit(1)
def handle_exception(exception, value, tb):
try:
signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts
ui = inary.cli.CLI() # make a temporary UI
show_traceback = False
except KeyboardInterrupt:
ui.error(_("Keyboard Interrupt: Exiting..."))
exit()
signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts
ui = inary.cli.CLI() # make a temporary UI
show_traceback = False
if isinstance(value, inary.Error):
ui.error(_("Program terminated."))
ui.error(_("\nProgram terminated."))
elif isinstance(value, KeyboardInterrupt):
ui.error(_("\nKeyboard Interrupt: Exiting..."))
exit()
elif isinstance(value, inary.Exception):
show_traceback = True
ui.error(_("Unhandled internal exception.\n"
ui.error(_("\nUnhandled internal exception.\n"
"Please file a bug report to <http://bugs.sulin.org>."))
elif isinstance(value, IOError) and value.errno == errno.EPIPE:
# Ignore broken pipe errors
......@@ -58,7 +62,7 @@ def handle_exception(exception, value, tb):
# For any other exception (possibly Python exceptions) show
# the traceback!
show_traceback = ctx.get_option('debug')
ui.error(_("System error. Program terminated."))
ui.error(_("\nSystem error. Program terminated."))
if show_traceback:
ui.error("{}: {}".format(exception, str(value)))
......
......@@ -6,9 +6,6 @@ TODO
(-) inarytools.dodoc() may need an optional mode parameter for chmodding installed
documents
(-) inarytools.dodoc() does not allow passing a directory as source
(-) inarytools.dobin() is already doing what inarytools.doexe() is doing
(-) inarytools.dolib() and inarytools.dolib_so() are carbon copies!
(-) Unify all dolib* stuff into one function
(-) rename() could be dropped in favor of move()
(-) inarytools.dosed() does not provide all sed functionality. It only supports
substitution. Rename the function or add support for other sed commands.
......
......@@ -25,7 +25,7 @@ class Error(inary.Error):
pass
def get_firmwares():
ctx.ui.info(inary.util.colorize("Extracting firmware list for {}...".format(os.uname()[2]), "green"))
ctx.ui.info(inary.util.colorize(_("Extracting firmware list for {}...").format(os.uname()[2]), "green"))
d = {}
modules = [os.path.basename(mod.replace(".ko", "")) for mod in \
os.popen("modprobe -l").read().strip().split("\n")]
......@@ -45,7 +45,7 @@ def get_firmware_package(firmware):
unavailable_fw_packages = set(fw_packages).difference(inary.db.installdb.InstallDB().list_installed())
if unavailable_fw_packages:
ctx.ui.info(inary.util.colorize("The following firmwares are not installed:", "yellow"))
ctx.ui.info(inary.util.colorize(_("The following firmwares are not installed:"), "yellow"))
ctx.ui.info("\n".join(unavailable_fw_packages))
for module, firmwares in list(get_firmwares().items()):
......@@ -60,6 +60,6 @@ def get_firmware_package(firmware):
pass
ctx.ui.info(" ({})".format(inary.util.colorize(firmware, 'green') if firmware else \
inary.util.colorize("missing", 'red')))
inary.util.colorize(_("Missing"), 'red')))
except:
raise Error()
......@@ -38,7 +38,7 @@ if not libmagic or not libmagic._name:
magic_dlls = {'darwin': ['/opt/local/lib/libmagic.dylib',
'/usr/local/lib/libmagic.dylib',
glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib')],
'win32': 'magic1.dll','cygmagic-1.dll',
'win32': ['magic1.dll','cygmagic-1.dll'],
'linux': ['libmagic.so.1'],
}
......@@ -141,14 +141,14 @@ class Magic:
if os.path.isfile(data):
open(data)
with self.lock:
return magic_file(self.cookie, data)
return magic_file(self.cookie, data.encode('utf-8')).decode('utf-8')
else:
with self.lock:
if type(data) == str and str != bytes:
buf = data.encode('utf-8', errors='replace')
return magic_buffer(self.cookie, data, len(data))
return magic_buffer(self.cookie, data, len(data)).decode('utf-8')
except MagicException as err:
raise(_("Can Not load file or buffer {}").format(err))
raise(_("Can't load file or buffer {}").format(err))
def __del__(self):
if self.cookie and magic_close:
......
......@@ -37,7 +37,7 @@ _ = __trans.gettext
class Error(inary.Error):
pass
class LDD:
class PCorLDD:
def __init__(self, packages, directory, component, installed_list=True, systembase=False, systemdevel=False):
self.installdb = inary.db.installdb.InstallDB()
......
......@@ -198,7 +198,7 @@ class ArchiveBzip2(ArchiveBase):
import bz2
bz2_file = bz2.BZ2File(self.file_path, "r")
output = open(output_path, "w")
output.write(bz2_file.read())
output.write(bz2_file.read().decode('utf-8'))
output.close()
bz2_file.close()
......@@ -224,7 +224,7 @@ class ArchiveGzip(ArchiveBase):
import gzip
gzip_file = gzip.GzipFile(self.file_path, "r")
output = open(output_path, "w")
output.write(gzip_file.read())
output.write(gzip_file.read().decode('utf-8'))
output.close()
gzip_file.close()
......
......@@ -291,7 +291,7 @@ class Install(AtomicOperation):
# Chowning for additional files
for _file in self.package.get_files().list:
fpath = util.join_path(ctx.config.dest_dir(), _file.path)
ctx.ui.debug("** chowning in postinstall ({0}:{1})".format(_file.uid, _file.gid))
ctx.ui.debug("* Chowning in postinstall ({0}:{1})".format(_file.uid, _file.gid))
os.chown(fpath, int(_file.uid), int(_file.gid))
if ctx.scom:
......@@ -321,6 +321,7 @@ class Install(AtomicOperation):
self.config_later = True
else:
self.config_later = True
def extract_install(self):
"unzip package in place"
......
......@@ -52,7 +52,6 @@ class CLI(inary.ui.UI):
def close(self):
inary.util.xterm_title_reset()
######### in old releases use this output function #########
def output(self, msg, err = False, verbose = False):
if (verbose and self.show_verbose) or (not verbose):
if type(msg)==type(bytes()):
......@@ -61,11 +60,7 @@ class CLI(inary.ui.UI):
sys.stderr.write(str(msg))
else:
sys.stdout.write(str(msg))
#######But there are formatted problem in this, #####
#######So I write a skeleton output function #####
def output(self, msg, err = False, verbose = False):
sys.stdout.write(str(msg))
def formatted_output(self, msg, verbose = False, noln = False, column=":"):
key_width = 20
......
......@@ -140,6 +140,14 @@ class Constants(metaclass=Singleton):
'brightmagenta' : "\033[01;35m",
'brightcyan' : "\033[01;36m",
'brightwhite' : "\033[01;37m",
'faintblack' : "\033[02;30m",
'faintred' : "\033[02;31m",
'faintgreen' : "\033[02;32m",
'faintyellow' : "\033[02;33m",
'faintblue' : "\033[02;34m",
'faintpurple' : "\033[02;35m",
'faintcyan' : "\033[02;36m",
'faintwhite' : "\033[02;37m",
'underlineblack' : "\033[04;30m",
'underlinered' : "\033[04;31m",
'underlinegreen' : "\033[04;32m",
......
......@@ -184,7 +184,8 @@ class Index(xmlfile.XmlFile, metaclass=autoxml.autoxml):
pool.join()
ctx.ui.info("")
raise
ctx.ui.info("%-80.80s\r" % (_("Adding packages from directory {}... done.".format(key))))
ctx.ui.info("%-80.80s\r" % (_("Adding packages from directory {}... done.".format(key))),
noln = False if ctx.config.get_option("verbose") else True)
ctx.ui.info("")
pool.close()
......
......@@ -16,6 +16,7 @@ import shelve
import hashlib
import inary
import inary.util as util
import inary.context as ctx
import inary.db.lazydb as lazydb
......@@ -66,11 +67,10 @@ class FilesDB(lazydb.LazyDB):
def add_files(self, pkg, files):
self.__check_filesdb()
ctx.ui.info(inary.util.colorize(_(' |___* Adding \'{}\' to db... '), 'purple').format(pkg), noln=True)
ctx.ui.info("%-80.80s\r" % (util.colorize(_('-> Adding \'{}\' to db...'), 'purple').format(pkg)), noln=True)
for f in files.list:
key=hashlib.md5(f.path.encode('utf-8')).hexdigest()
self.filesdb[key] = pkg
ctx.ui.info(inary.util.colorize(_('OK.'), 'backgroundmagenta'))
def remove_files(self, files):
for f in files:
......
......@@ -12,6 +12,7 @@
import os
import inary
import inary.context as ctx
import inary.db.lazydb as lazydb
import inary.data.history as History
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment