Kaydet (Commit) 227e0a26 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

General changes, please look ChangeLog for details

üst 7303df78
2018-03-15 Suleyman Poyraz <nipalensisaquila@gmail.com>
* fetcher.py:
-> Her zaman sinirimi bozan bu fetcher requests ile yeniden yazıldı.
urllib kullanmak indirme yöneticisini yavaşlatıyordu.
Bir tane yeni bağımlılık eklerim de yine de o yavaşlığı çekemem arkadaş
* İç aksam düzenlemeleri:
-> inary.__init__()
inary main modulu içindeki error sınıfı ait olduğunu hissettiğim
yer inary.errors içine taşındı. Böylece bir error için bütün inary
modulunu yeniden import etmeye gerek kalmayacak.
Bknz: 'Bit için yorgan yakılmaz.'
-> inary.db.filesdb:
filesdb zaten dinamik bir database. O yüzden her installing ardından
koskocaman files databasesi yapılandırmayı saçma buldum. Onu
düzelttim. Ayrıca database testleri ile sağlıklı çalıştığına emin
oldum.
-> Çıktılar biraz ellendi, renklendirmeler eklendi
* Atom düzenlemeleri:
-> Gereksiz boşluklar temizlendi.
-> Simetri hastası bir insan olarak bazı modul importlarını elle
düzelttim.
2018-03-14 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Özellik eklemesi:
-> Paket kurulumundan önce yeterli alan olup olmadığı artık denetleniyor.
* Hata düzeltmeleri:
-> Görünümsel hatalar fixe edildi.
-> runtime hatalarından bazıları giderildi
-> dosym methodundaki hata düzeltildi.
2018-03-29 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Hata düzeltmeleri:
Kararlı öncesi.
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.
-> Actionsapi betiklerinden gereksiz fonksiyon var mı diye kontrol edilip
betikler düzenlendi.
-> Yeni bir renk skalası eklendi. ("faint")
-> Renklendirme yapıldı
......@@ -16,7 +51,7 @@
2018-03-18 Suleyman Poyraz <nipalensisaquila@gmail.com>
* 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
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
kullanma kararı aldım.
......@@ -29,7 +64,7 @@
patches/applied-patches/minimum-dependency-maximum-stabilization-001.patch
If we had one or two dependency we can control inary
but there are a lot of runtime dependency. And this is
look up bad. I clean runtime dependencies and I write
look up bad. I clean runtime dependencies and I write
alternative libraries into inary. I clean runtimes:
* magic: it soo easy if when use ctypes.I import libmagic
with ctypes and I use it in inary
......@@ -60,7 +95,7 @@
2018-03-02 Suleyman Poyraz <nipalensisaquila@gmail.com>
* deleted distupdate command:
Sulin will be a roolling release distro. So we don't have a
Sulin will be a roolling release distro. So we don't have a
distupdater.
2018-02-11 Suleyman Poyraz <nipalensisaquila@gmail.com>
......@@ -79,7 +114,7 @@
* System modulleri silindi:
Inary içinde onlara ihtiyaç olmadığını farkettim. Scom içine alarak yer
kazandım.
* inary/strutils.py:
* inary/strutils.py:
Str veri tipi için basit tipte fonksiyonları ve multisplit gibi şeyleri
içeren bir modul.
......@@ -97,8 +132,8 @@
2018-01-28 Suleyman Poyraz <nipalensisaquila@gmail.com>
* distupdate komutu eklendi:
Upgrade komutu buyuk capta guncellemeler için biraz
tehlikeli kaçıyordu ve yetersiz sayılırdı. Bu yüzden bu
Upgrade komutu buyuk capta guncellemeler için biraz
tehlikeli kaçıyordu ve yetersiz sayılırdı. Bu yüzden bu
modul eklendi.
* Downgrade silindi:
......@@ -140,7 +175,7 @@
-> testlerin islevselliginden emin olunuldu (2018-01-23)
2018-01-17 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Added system_literals and now work crossplatorm
* Added system_literals and now work crossplatorm
inary packaging:
Look more about inary/system_literals/Modules.md
......@@ -151,7 +186,7 @@
2017-12-24 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Python3 kutuphane uyumlulugu:
lzma hataları düzenlendi, urllib.request ile fetcher
lzma hataları düzenlendi, urllib.request ile fetcher
yeniden yazıldı
magic kutuphanesi düzenlendi.
......@@ -173,7 +208,7 @@
* unuseful importing libraries:
example in xmlfile. A developer imported an old library preprocess
and I try fix it
and I try fix it
Türkçesi ile benim neler çektiğimi nerden bileceksiniz
2017-09-01 Suleyman Poyraz <nipalensisaquila@gmail.com>
......@@ -184,11 +219,11 @@
in packages and it moving to package dirs actions.py file
* install:
FIXME: If we want install a new release for any package it
FIXME: If we want install a new release for any package it
report file conflicts error, it should fix it.
* removing:
FIXME: In removing a package it report file conflicts error
FIXME: In removing a package it report file conflicts error
and can not remove package
* delta:
......@@ -207,7 +242,7 @@
2017-08-31 Suleyman Poyraz <nipalensisaquila@gmail.com>
* Remove Comar/scom libraries:
Now we can install packages without comar scripts
I add a function in actions.py file. I we want
I add a function in actions.py file. I we want
configure package after installing we can make it quickly
2017-08-20 Suleyman Poyraz <nipalensisaquila@gmail.com>
......@@ -243,7 +278,7 @@
2017-04-14 Suleyman Poyraz <nipalensisaquila@gmail.com>
* filesldb and plyvel:
Should fix pisi-plyvel library hash encode type error
* install:
Fixed compressed metadata and files xml file reading problem
(FileNotFound ERROR when reading)
......@@ -259,16 +294,16 @@
* indexing:
Fixed index library. Now we an indexing. And basic type package
handling
* installing:
Now there are a problem in install library so we can't install
packages from package files. Should fix autoxml.py write module
and xmlfilepiks module
* fetching and progress:
I rewrite fetcher without UIHandler. I write an progress handler
with use python
2017-04-11 Suleyman Poyraz <nipalensisaquila@gmail.com>
* lzma archive options:
......@@ -322,5 +357,3 @@
Old versions written by Python2. This will be a problem in future. So
I start it porting Python2 to Python3. This is an hard job but It doesn't
impossible.
......@@ -2,14 +2,17 @@
* inary.fetcher.py: --- status: not fixed; flag: critical ---:
Neden local dosyaları çekmiyor bu?
"""
$ inary fc dbus
$ inary fc dbus
dbus package found in binrepo repository
Error: Program terminated.
Error: A problem occurred. Please check the archive address and/or permissions again. Could not fetch destination file: "/home/zaryob/Repositories/binrepo/d/dbus/dbus-1.11.8-1-s18-x86_64.inary"
Error: A problem occurred. Please check the archive address and/or permissions again. Could not fetch destination file: "/home/zaryob/Repositories/binrepo/d/dbus/dbus-1.11.8-1-s18-x86_64.inary"
Raised Value error: "unknown url type: '/home/zaryob/Repositories/binrepo/d/dbus/dbus-1.11.8-1-s18-x86_64.inary'"
Please use 'inary help' for general help.
"""
* ayrıca yine fetcher:
sudo inary it dbus -f diyince nereye indiriyor yaw bu
2018-03-17 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary.db.installdb.py: --- status: fixed; flag: critical ---:
......@@ -48,5 +51,3 @@
* inary/atomicoperations.py --- status: not fixed flag: critical ---
In removing not asking "Do you want remove conflicted files "
Now remove all package files and conflicted files
......@@ -39,7 +39,7 @@ Legend:
+ single repository index
+ simple dependency checking
+ Package/Files
- Detailed inary logs into /var/lib/inary
+ Detailed inary logs into /var/log
2. Alpha
+ multi-package dependency analysis (eray)
......@@ -66,6 +66,8 @@ Legend:
+ implement source database (eray)
+ easy package preparation
? convert ebuild to inary
\ convert deb packages to inary
\ convert rpm packages to inary
+ Configuring system interface after installing
+ what do we need to specify in a package
+ package install: register script and configure system with it
......@@ -74,7 +76,7 @@ Legend:
+ support URI's whereever a filename is supported
+ http server
+ https server
- ftp server
+ ftp server
+ inary updatedb over internet
3. Beta
......
......@@ -17,7 +17,12 @@ import signal
import inary
import inary.context as ctx
import inary.cli.inarycli as inarycli
import inary.cli
from inary.cli import inarycli
import inary.db
import inary.errors
import inary.util
import gettext
gettext.bindtextdomain('inary', "/usr/share/locale")
......@@ -48,12 +53,12 @@ def handle_exception(exception, value, tb):
ui = inary.cli.CLI() # make a temporary UI
show_traceback = False
if isinstance(value, inary.Error):
if isinstance(value, inary.errors.Error):
ui.error(_("\nProgram terminated."))
elif isinstance(value, KeyboardInterrupt):
ui.error(_("\nKeyboard Interrupt: Exiting..."))
exit()
elif isinstance(value, inary.Exception):
elif isinstance(value, inary.errors.Exception):
show_traceback = True
ui.error(_("\nUnhandled internal exception.\n"
"Please file a bug report to <http://bugs.sulin.org>."))
......@@ -78,7 +83,7 @@ def handle_exception(exception, value, tb):
if show_traceback:
ui.info(_("\nTraceback:"))
traceback.print_tb(tb)
elif not isinstance(value, inary.Error):
elif not isinstance(value, inary.errors.Error):
ui.info(_("Use --debug to see a traceback."))
exit()
......@@ -88,7 +93,7 @@ if __name__ == "__main__":
signal.signal(signal.SIGTERM, sig_handler)
cli = inarycli.InaryCLI()
cli = inary.cli.inarycli.InaryCLI()
if cli.command.name[1] in "rdb sf".split():
ctx.filesdb = inary.db.filesdb.FilesDB()
cli.run_command()
......@@ -17,26 +17,11 @@ import sys
import atexit
import logging
import logging.handlers
import imp
import imp
__version__ = "0.5"
__all__ = [ 'api', 'configfile', 'db']
# FIXME: Exception shadows builtin Exception. This is no good.
class Exception(Exception):
"""Class of exceptions that must be caught and handled within INARY"""
def __str__(self):
s = ''
for x in self.args:
if s != '':
s += '\n'
s += str(x)
return str(s)
class Error(Exception):
"""Class of exceptions that lead to program termination"""
pass
__all__ = [ 'api', 'configfile', 'db', 'files', 'util']
import inary.api
import inary.config
......
......@@ -10,16 +10,15 @@
# Please read the COPYING file.
#
import inary
import inary.context as ctx
import inary.errors
class Error(inary.Error):
class Error(inary.errors.Error):
pass
class Exception(inary.Exception):
class Exception(inary.errors.Exception):
pass
import inary.context as ctx
def error(msg):
if ctx.config.get_option('ignore_action_errors'):
ctx.ui.error(msg)
......
......@@ -65,4 +65,3 @@ def make(parameters = ''):
def install(parameters = '', argument = 'install'):
cmaketools.install('-C build {}'.format(parameters), argument)
......@@ -136,4 +136,3 @@ def libraryExists(library):
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
return result == 0
......@@ -62,4 +62,3 @@ def make(parameters=''):
def install(parameters='', argument='install'):
cmaketools.install('INSTALL_ROOT="{0}" {1}'.format(get.installDIR(), parameters), argument)
......@@ -70,4 +70,3 @@ def make(parameters=''):
def install(parameters='', argument='install'):
cmaketools.install('INSTALL_ROOT="{0}" {1}'.format(get.installDIR(), parameters), argument)
......@@ -106,4 +106,3 @@ def run(parameters=''):
if system('ruby {}'.format(parameters)):
raise RuntimeError(_("Running 'ruby {}' failed.").format(parameters))
......@@ -280,4 +280,3 @@ def generateConfigFiles():
elif command == "BuildLanguageDat":
ctx.ui.info(_('No rule to proccess {}. Please file a bug.').format(command))
jobsfile.close()
......@@ -12,8 +12,9 @@
import os
import sys
import inary
import inary.context as ctx
import inary.db
import inary.errors
import inary.util
#Gettext
......@@ -21,7 +22,7 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
class Error(inary.Error):
class Error(inary.errors.Error):
pass
def get_firmwares():
......@@ -43,7 +44,7 @@ def get_firmware_package(firmware):
try:
fw_packages = inary.db.componentdb.ComponentDB().get_packages("hardware.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("\n".join(unavailable_fw_packages))
......
......@@ -2,10 +2,12 @@
import hashlib
import os
import inary
import sys
import time
import inary.db
import inary.operations
IGNORE_DIRS = ('/root',
'/tmp',
'/home',
......
......@@ -23,10 +23,13 @@ import itertools
import subprocess
#Inary functions
import inary
import inary.db
import inary.api
import inary.analyzer.magic
import inary.context as ctx
import inary.db
import inary.errors
import inary.package
#Gettext
import gettext
......@@ -34,7 +37,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
class Error(inary.Error):
class Error(inary.errors.Error):
pass
class PCorLDD:
......
......@@ -15,7 +15,6 @@ import bz2
import sys
import os
def loadFile(_file):
try:
f = open(_file)
......@@ -93,4 +92,3 @@ def urgent_packages(index, packages):
# print("-> %s" % i)
# for k in requiredPackages[i]:
# print("\t%s" % k)
......@@ -132,7 +132,7 @@ class TarFile(tarfile.TarFile):
if fileobj is not None:
fileobj = _LZMAProxy(fileobj, mode)
else:
else:
options = {"format": compressformat}
fileobj = lzma.LZMAFile(name, mode)
......@@ -422,7 +422,7 @@ class ArchiveTar(ArchiveBase):
except IOError as e:
# Handle the case where new path is file, but old path is directory
# due to not possible touch file c in /a/b if directory /a/b/c exists.
# due to not possible touch file c in /a/b if directory /a/b/c exists.
if not e.errno == errno.EISDIR:
path = tarinfo.name
found = False
......@@ -572,7 +572,7 @@ class Archive7Zip(ArchiveBase):
def __init__(self, file_path, arch_type="7z"):
super(Archive7Zip, self).__init__(file_path, arch_type)
self.cmd = inary.util.search_executable(arch_type)
self.cmd = util.search_executable(arch_type)
if not self.cmd:
raise ArchiveHandlerNotInstalled
......@@ -584,7 +584,7 @@ class Archive7Zip(ArchiveBase):
"""Unpack 7z archive to a given target directory(target_dir)."""
# e.g. 7z x -bd -o<target_directory> <archive.7z>
inary.util.run_batch("{0} x -bd -o{1} {2}".format(self.cmd, target_dir, self.file_path))
util.run_batch("{0} x -bd -o{1} {2}".format(self.cmd, target_dir, self.file_path))
class ArchiveZip(ArchiveBase):
......
......@@ -20,10 +20,15 @@ import shutil
import zipfile
import inary
import inary.configfile
import inary.context as ctx
import inary.data
import inary.errors
import inary.data
import inary.db
import inary.file
import inary.package
import inary.operations
import inary.uri
import inary.ui
......@@ -31,10 +36,10 @@ import inary.util as util
import inary.version
import inary.data.pgraph as pgraph
class Error(inary.Error):
class Error(inary.errors.Error):
pass
class NotfoundError(inary.Error):
class NotfoundError(inary.errors.Error):
pass
# single package operations
......@@ -114,7 +119,7 @@ class Install(AtomicOperation):
if not cached_file:
downloaded_file = install_op.package.filepath
if util.sha1_file(downloaded_file) != pkg_hash:
raise inary.Error(_("Download Error: Package does not match the repository package."))
raise inary.errors.Error(_("Download Error: Package does not match the repository package."))
return install_op
else:
......@@ -175,7 +180,8 @@ class Install(AtomicOperation):
def check_requirements(self):
"""check system requirements"""
# Check free space
ctx.ui.debug(_("Free Space: {} MB").format(util.free_space() / (1024*1024.0)))
total_size, symbol = util.human_readable_size(util.free_space())
ctx.ui.debug(_("Free Space: %.2f %s "% (total_size, symbol))) # I DONT KNOW BETTER WAY
if util.free_space() < self.installedSize:
raise Error(_("Is there any free space in your disk."))
......@@ -578,11 +584,11 @@ class Remove(AtomicOperation):
self.store_old_paths = store_old_paths
try:
self.files = self.installdb.get_files(self.package_name)
except inary.Error as e:
except inary.errors.Error as e:
# for some reason file was deleted, we still allow removes!
ctx.ui.error(str(e))
ctx.ui.warning(_('File list could not be read for package {}, continuing removal.').format(package_name))
self.files = inary.files.Files()
self.files = inary.data.files.Files()
def run(self):
"""Remove a single package"""
......@@ -921,20 +927,20 @@ def configure_pending(packages=None):
ctx.ui.notify(inary.ui.configured, package = pkginfo, files = None)
installdb.clear_pending(x)
except ImportError:
raise inary.Error(_("scom package is not fully installed"))
raise inary.errors.Error(_("scom package is not fully installed"))
@locked
def add_repo(name, indexuri, at = None):
import re
if not re.match("^[0-9{}\-\\_\\.\s]*$".format(str(util.letters())), name):
raise inary.Error(_('Not a valid repo name.'))
raise inary.errors.Error(_('Not a valid repo name.'))
repodb = inary.db.repodb.RepoDB()
if repodb.has_repo(name):
raise inary.Error(_('Repo {} already present.').format(name))
raise inary.errors.Error(_('Repo {} already present.').format(name))
elif repodb.has_repo_url(indexuri, only_active = False):
repo = repodb.get_repo_by_url(indexuri)
raise inary.Error(_('Repo already present with name {}.').format(repo))
raise inary.errors.Error(_('Repo already present with name {}.').format(repo))
else:
repo = inary.db.repodb.Repo(inary.uri.URI(indexuri))
repodb.add_repo(name, repo, at = at)
......@@ -949,7 +955,7 @@ def remove_repo(name):
inary.db.flush_caches()
ctx.ui.info(_('Repo {} removed from system.').format(name))
else:
raise inary.Error(_('Repository {} does not exist. Cannot remove.').format(name))
raise inary.errors.Error(_('Repository {} does not exist. Cannot remove.').format(name))
@locked
def update_repos(repos, force=False):
......@@ -996,7 +1002,7 @@ def __update_repo(repo, force=False):
ctx.ui.info(_('Package database updated.'))
else:
raise inary.Error(_('No repository named {} found.').format(repo))
raise inary.errors.Error(_('No repository named {} found.').format(repo))
return True
......@@ -1008,11 +1014,13 @@ def rebuild_db():
options = ctx.config.options
ui = ctx.ui
scom = ctx.scom
inary._cleanup()
from inary import _cleanup
_cleanup()
ctx.filesdb.close()
ctx.filesdb.destroy()
ctx.filesdb = inary.db.filesdb.FilesDB()
ctx.filesdb.update()
# reinitialize everything
ctx.ui = ui
......
......@@ -33,7 +33,7 @@ def exclude_from(packages, exfrom):
def exclude(packages, patterns):
packages = set(packages)
componentdb = inary.db.componentdb.ComponentDB()
for pattern in patterns:
# match pattern in package names
match = fnmatch.filter(packages, pattern)
......
......@@ -17,16 +17,15 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.context as ctx
import inary.ui
import inary.util
class Error(inary.Error):
class Error(inary.errors.Error):
pass
class Exception(inary.Exception):
class Exception(inary.errors.Exception):
pass
#in old releases used this printu function
......@@ -182,7 +181,7 @@ class CLI(inary.ui.UI):
self.output("\r%s (%d%%)" % (ka['info'], ka['percent']))
if ka['percent'] == 100:
self.output(inary.util.colorize(_(' [complete]\n'), 'gray'))
self.output(inary.util.colorize(_('\n [complete]\n'), 'yellow'))
def status(self, msg = None):
if msg:
......
......@@ -16,10 +16,11 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.atomicoperations
import inary.cli.command as command
import inary.context as ctx
import inary.db
import inary.errors
class AddRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Add a repository
......@@ -70,7 +71,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
if not ctx.get_option('no_fetch'):
try:
inary.atomicoperations.update_repo(name)
except (inary.Error, IOError):
except (inary.errors.Error, IOError):
warning = _("{0} repository could not be reached. Removing {0} from system.").format(name)
self.warn_and_remove(warning, name)
else:
......
......@@ -16,10 +16,11 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.atomicoperations
import inary.cli.command as command
import inary.context as ctx
import inary.package
import inary.operations
usage = _("""Build INARY packages
......
......@@ -31,4 +31,3 @@ This command deletes unused locks from the database directory.""")
def run(self):
self.init()
......@@ -164,7 +164,7 @@ class Command(object):
ui = inary.cli.CLI()
if (write and not os.access(inary.context.config.packages_dir(), os.W_OK) or \
('sf' in self.get_name() and not os.access(os.path.join(ctx.config.info_dir(), ctx.const.files_ldb), os.W_OK))):
('sf' in self.get_name() and not os.access(os.path.join(ctx.config.info_dir(), ctx.const.files_db+'.db'), os.W_OK))):
raise inary.cli.Error(_("You have to be root for this operation."))
inary.api.set_scom(self.scom and not ctx.get_option('ignore_scom'))
......
......@@ -14,7 +14,6 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.atomicoperations
import inary.cli.command as command
......
......@@ -16,10 +16,10 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.cli.command as command
import inary.context as ctx
import inary.package
import inary.operations
usage = _("""Creates delta packages
......
......@@ -16,11 +16,11 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.atomicoperations
import inary.cli.command as command
import inary.cli.build as build
import inary.context as ctx
import inary.atomicoperations
import inary.db