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

Changes

üst 462d5ae1
2018-03-17 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary.fetcher.py:
Neden local dosyaları çekmiyor bu?
"""
$ 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"
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.
"""
2018-03-17 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary.db.installdb.py:
Şu satır bir kontrol edilmeli:
"""
DEBUG: InstallDB initialized in 0.0029578208923339844.
File "/bin/inary-cli", line 82, in <module>
cli.run_command()
File "/usr/lib/python3.6/site-packages/inary/cli/inarycli.py", line 144, in run_command
self.command.run()
File "/usr/lib/python3.6/site-packages/inary/cli/listupgrades.py", line 52, in run
upgradable_pkgs = op_wrappers.list_upgradable()
File "/usr/lib/python3.6/site-packages/inary/operations/op_wrappers.py", line 119, in list_upgradable
upgradable = list(filter(is_upgradable, installdb.list_installed()))
File "/usr/lib/python3.6/site-packages/inary/operations/upgrade.py", line 402, in is_upgradable
(i_version, i_release, i_build, i_distro, i_distro_release) = installdb.get_version_and_distro_release(name)
File "/usr/lib/python3.6/site-packages/inary/db/installdb.py", line 173, in get_version_and_distro_release
return self.__get_version(meta_doc) + self.__get_distro_release(meta_doc)
File "/usr/lib/python3.6/site-packages/inary/db/installdb.py", line 151, in __get_version
version = history.getElementsByTagName("Update")[0].getElementsByTagName("Version")[0].firstChild.data
Error: System error. Program terminated.
Error: <class 'AttributeError'>: 'str' object has no attribute 'getElementsByTagName'
Please use 'inary help' for general help.
"""
2018-03-17 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary.fetcher.py:
Traceback:
Program terminated.
You have to be root for this operation.
Please use 'inary help' for general help.
2018-01-26 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary/db/filesdb.py:
Bir hata var bu leveldb içinde, çokça kullanmaya çalışınca kafayı yiyor
......@@ -42,3 +91,4 @@ AttributeError: 'FilesDB' object has no attribute 'filesdb'
In removing not asking "Do you want remove conflicted files "
Now remove all package files and conflicted files
......@@ -29,6 +29,7 @@ import inary.uri
import inary.ui
import inary.util as util
import inary.version
import inary.data.pgraph as pgraph
class Error(inary.Error):
pass
......@@ -887,7 +888,7 @@ def configure_pending(packages=None):
else:
packages = set(packages).intersection(installdb.list_pending())
order = generate_pending_order(packages)
order = pgraph.generate_pending_order(packages)
try:
for x in order:
if installdb.has_package(x):
......
......@@ -17,7 +17,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.atomicoperations
import inary.cli.command as command
import inary.context as ctx
......@@ -50,7 +50,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
def warn_and_remove(self, message, repo):
ctx.ui.warning(message)
inary.api.remove_repo(repo)
inary.atomicoperations.remove_repo(repo)
def run(self):
......@@ -65,11 +65,11 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
'Do you want to continue?').format(name)):
return
inary.api.add_repo(name, indexuri, ctx.get_option('at'))
inary.atomicoperations.add_repo(name, indexuri, ctx.get_option('at'))
if not ctx.get_option('no_fetch'):
try:
inary.api.update_repo(name)
inary.atomicoperations.update_repo(name)
except (inary.Error, IOError):
warning = _("{0} repository could not be reached. Removing {0} from system.").format(name)
self.warn_and_remove(warning, name)
......
......@@ -17,7 +17,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.atomicoperations
import inary.cli.command as command
import inary.context as ctx
......@@ -178,4 +178,4 @@ class Build(command.Command, metaclass=command.autocommand):
if ctx.get_option('until'):
inary.operations.build.build_until(x, ctx.get_option('until'))
else:
inary.api.build(x)
inary.atomicoperations.build(x)
......@@ -16,8 +16,9 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary.api
import inary.atomicoperations
import inary.operations.check
import inary.operations.op_wrappers as op_wrappers
import inary.cli.command as command
import inary.context as ctx
import inary.util as util
......@@ -72,7 +73,7 @@ class Check(command.Command, metaclass=command.autocommand):
component = ctx.get_option('component')
if component:
installed = inary.api.list_installed()
installed = op_wrappers.list_installed()
component_pkgs = self.componentdb.get_union_packages(component,
walk=True)
pkgs = list(set(installed) & set(component_pkgs))
......@@ -80,7 +81,7 @@ class Check(command.Command, metaclass=command.autocommand):
pkgs = self.args
else:
ctx.ui.info(_('Checking all installed packages') + '\n')
pkgs = inary.api.list_installed()
pkgs = op_wrappers.list_installed()
necessary_permissions = True
......@@ -96,9 +97,7 @@ class Check(command.Command, metaclass=command.autocommand):
for pkg in pkgs:
if self.installdb.has_package(pkg):
check_results = inary.operations.check.check_package(pkg, check_config)
ctx.ui.info("{0} {1}".format((prefix.format(pkg),
' ' * (maxpkglen - len(pkg)))),
noln=True)
ctx.ui.info("{0} {1}".format(prefix.format(pkg), (' ' * (maxpkglen - len(pkg)))), noln=True)
if check_results['missing'] or check_results['corrupted'] \
or check_results['config']:
......
......@@ -16,7 +16,7 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary.api
import inary.atomicoperations
import inary.cli.command as command
class ConfigurePending(command.PackageOp, metaclass=command.autocommand):
......@@ -41,4 +41,4 @@ configures those packages.
def run(self):
self.init()
inary.api.configure_pending(self.args)
inary.atomicoperations.configure_pending(self.args)
......@@ -15,7 +15,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.atomicoperations
import inary.cli.command as command
class DeleteCache(command.Command, metaclass=command.autocommand):
......@@ -34,4 +34,4 @@ consume a lot of disk space.""")
def run(self):
self.init(database=False, write=True)
inary.api.delete_cache()
inary.atomicoperations.delete_cache()
......@@ -16,7 +16,7 @@ _ = __trans.gettext
import inary.db
import inary.cli.command as command
import inary.api
import inary.atomicoperations
class DisableRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Disable repository
......@@ -43,4 +43,4 @@ Disabled repositories are not taken into account in operations
for repo in self.args:
if self.repodb.has_repo(repo):
inary.api.set_repo_activity(repo, False)
inary.atomicoperations.set_repo_activity(repo, False)
......@@ -19,7 +19,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.cli.build as build
import inary.context as ctx
import inary.api
import inary.atomicoperations
class Emerge(build.Build, metaclass=command.autocommand):
__doc__ = _("""Build and install INARY source packages from repository
......@@ -72,4 +72,4 @@ You can also give the name of a component.
ctx.ui.info(_('Outputting binary packages in the package cache.'))
ctx.config.options.output_dir = ctx.config.cached_packages_dir()
inary.api.emerge(sources)
inary.atomicoperations.emerge(sources)
......@@ -20,7 +20,8 @@ import inary
import inary.cli.command as command
import inary.cli.build as build
import inary.context as ctx
import inary.api
import inary.atomicoperations
import inary.operations.op_wrappers as op_wrappers
class EmergeUp(build.Build, metaclass=command.autocommand):
__doc__ = _("""Build and upgrade INARY source packages from repository
......@@ -76,7 +77,7 @@ You can also give the name of a component.
ctx.ui.info(_('Outputting binary packages in the package cache.'))
ctx.config.options.output_dir = ctx.config.cached_packages_dir()
repos = inary.api.list_repos()
inary.api.update_repos(repos, ctx.get_option('force'))
repos = op_wrappers.list_repos()
inary.atomicoperations.update_repos(repos, ctx.get_option('force'))
inary.api.emerge(emerge_up_list)
inary.atomicoperations.emerge(emerge_up_list)
......@@ -16,7 +16,7 @@ _ = __trans.gettext
import inary.db
import inary.cli.command as command
import inary.api
import inary.atomicoperations
class EnableRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Enable repository
......@@ -43,4 +43,4 @@ Disabled repositories are not taken into account in operations
for repo in self.args:
if self.repodb.has_repo(repo):
inary.api.set_repo_activity(repo, True)
inary.atomicoperations.set_repo_activity(repo, True)
......@@ -19,8 +19,8 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary
import inary.db
import inary.fetcher as fetcher
class Fetch(command.Command, metaclass=command.autocommand):
__doc__ = _("""Fetch a package
......@@ -65,4 +65,4 @@ Downloads the given inary packages to working directory
for dep in package.runtimeDependencies():
full_packages.append(dep.name())
inary.api.fetch(full_packages, ctx.config.options.output_dir)
fetcher.fetch(full_packages, ctx.config.options.output_dir)
......@@ -16,11 +16,11 @@ import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.cli.command as command
import inary.context as ctx
import inary.db
import inary.data.pgraph as pgraph
import inary.operations.op_wrappers as op_wrappers
class Graph(command.Command, metaclass=command.autocommand):
__doc__ = _("""Graph package relations
......@@ -76,7 +76,7 @@ the package in graphviz format to 'pgraph.dot'.
if self.args:
a = self.args
else:
a = inary.api.list_available(repo)
a = op_wrappers.list_available(repo)
else:
# Graph from installed packages database
packagedb = inary.db.installdb.InstallDB()
......@@ -86,8 +86,8 @@ the package in graphviz format to 'pgraph.dot'.
else:
# if A is empty, then graph all packages
ctx.ui.info(_('Plotting a graph of relations among all installed packages'))
a = inary.api.list_installed()
a = op_wrappers.list_installed()
g = inary.api.package_graph(a, packagedb,
g = pgraph.package_graph(a, packagedb,
ignore_installed = ctx.get_option('ignore_installed'), reverse = ctx.get_option('reverse'))
g.write_graphviz(open(ctx.get_option('output'), 'w'))
......@@ -19,7 +19,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.atomicoperations
import inary.db
import inary.context as ctx
import inary.cli.command as command
......@@ -55,10 +55,10 @@ Lists previous operations.""")
help=_("Takeback to the state after the given operation finished"))
def take_snapshot(self):
inary.api.snapshot()
inary.atomicoperations.snapshot()
def takeback(self, operation):
inary.api.takeback(operation)
inary.atomicoperations.takeback(operation)
def print_history(self):
for operation in self.historydb.get_last(ctx.get_option('last')):
......
......@@ -18,6 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.data.index as index
usage = _("""Index INARY files in a given directory
......@@ -77,7 +78,6 @@ class Index(command.Command, metaclass=command.autocommand):
def run(self):
self.init(database=True, write=False)
import inary.api
from inary.file import File
ctypes = {"bz2": File.COMPRESSION_TYPE_BZ2,
......@@ -86,7 +86,7 @@ class Index(command.Command, metaclass=command.autocommand):
for type_str in ctx.get_option("compression_types").split(","):
compression |= ctypes.get(type_str, 0)
inary.api.index(self.args or ["."], ctx.get_option('output'),
index.index(self.args or ["."], ctx.get_option('output'),
skip_sources=ctx.get_option('skip_sources'),
skip_signing=ctx.get_option('skip_signing'),
compression=compression)
......@@ -19,8 +19,8 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.util as util
import inary.api
import inary.db
import inary.operations.info as info_operation
class Info(command.Command, metaclass=command.autocommand):
__doc__ = _("""Display package information
......@@ -87,7 +87,7 @@ Usage: info <package1> <package2> ... <packagen>
# info of packages
for arg in self.args:
if self.options.xml:
index.packages.append(inary.api.info(arg)[0].package)
index.packages.append(info_operation.info(arg)[0].package)
else:
self.info_package(arg)
......@@ -140,7 +140,7 @@ Usage: info <package1> <package2> ... <packagen>
print()
def inaryfile_info(self, package):
metadata, files = inary.api.info_file(package)
metadata, files = info_operation.info_file(package)
ctx.ui.formatted_output(_("Package file: {}").format(package))
self.print_metadata(metadata)
......@@ -149,7 +149,7 @@ Usage: info <package1> <package2> ... <packagen>
def installdb_info(self, package):
if self.installdb.has_package(package):
metadata, files, repo = inary.api.info_name(package, True)
metadata, files, repo = info_operation.info_name(package, True)
if self.options.files or self.options.files_path:
self.print_files(files)
......@@ -166,7 +166,7 @@ Usage: info <package1> <package2> ... <packagen>
def packagedb_info(self, package):
if self.packagedb.has_package(package):
metadata, files, repo = inary.api.info_name(package, False)
metadata, files, repo = info_operation.info_name(package, False)
if self.options.short:
ctx.ui.formatted_output(_("[binary] "), noln=True, column=" ")
else:
......
......@@ -18,7 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
import inary.db
class Install(command.PackageOp, metaclass=command.autocommand):
......@@ -102,4 +102,4 @@ expanded to package names.
packages = inary.blacklist.exclude(packages, ctx.get_option('exclude'))
reinstall = bool(packages) and packages[0].endswith(ctx.const.package_suffix)
inary.api.install(packages, ctx.get_option('reinstall') or reinstall)
inary.atomicoperations.install(packages, ctx.get_option('reinstall') or reinstall)
......@@ -19,8 +19,9 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.util as util
import inary.api
import inary.atomicoperations
import inary.db
import inary.operations.op_wrappers as op_wrappers
class ListAvailable(command.Command, metaclass=command.autocommand):
__doc__ = _("""List available packages in the repositories
......@@ -62,7 +63,7 @@ all repositories.
self.print_packages(arg)
else:
# print for all repos
for repo in inary.api.list_repos():
for repo in op_wrappers.list_repos():
ctx.ui.info(_("Repository : {}\n").format(str(repo)))
self.print_packages(repo)
......@@ -75,9 +76,9 @@ all repositories.
except Exception as e:
return
else:
l = inary.api.list_available(repo)
l = op_wrappers.list_available(repo)
installed_list = inary.api.list_installed()
installed_list = op_wrappers.list_installed()
# maxlen is defined dynamically from the longest package name (#9021)
if l:
......
......@@ -63,7 +63,7 @@ Usage: list-installed
component = ctx.get_option('component')
if component:
#FIXME: inary api is insufficient to do this
#FIXME: inary.atomicoperations is insufficient to do this
component_pkgs = self.componentdb.get_union_packages(component, walk=True)
installed = list(set(installed) & set(component_pkgs))
......
......@@ -18,8 +18,8 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.db
import inary.operations.op_wrappers as op_wrappers
class ListNewest(command.Command, metaclass=command.autocommand):
__doc__ = _("""List newest packages in the repositories
......@@ -56,7 +56,7 @@ packages from all repositories.
self.print_packages(arg)
else:
# print for all repos
for repo in inary.api.list_repos():
for repo in op_wrappers.list_repos():
self.print_packages(repo)
def print_packages(self, repo):
......@@ -67,7 +67,7 @@ packages from all repositories.
else:
since = None
l = inary.api.list_newest(repo, since)
l = op_wrappers.list_newest(repo, since)
if not l:
return
......
......@@ -16,7 +16,8 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
import inary.operations.op_wrappers as op_wrappers
class ListPending(command.Command, metaclass=command.autocommand):
__doc__ = _("""List pending packages
......@@ -32,9 +33,9 @@ Lists packages waiting to be configured.
def run(self):
self.init(database = True, write = False)
A = inary.api.list_pending()
A = op_wrappers.list_pending()
if len(A):
for p in inary.api.generate_pending_order(A):
for p in inary.atomicoperations.generate_pending_order(A):
sys.stdout.write(p)
else:
ctx.ui.info(_('There are no packages waiting to be configured'))
......@@ -19,8 +19,8 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.blacklist
import inary.context as ctx
import inary.api
import inary.db
import inary.operations.op_wrappers as op_wrappers
class ListUpgrades(command.Command, metaclass=command.autocommand):
__doc__ = _("""List packages to be upgraded
......@@ -49,7 +49,7 @@ Lists the packages that will be upgraded.
def run(self):
self.init(database = True, write = False)
upgradable_pkgs = inary.api.list_upgradable()
upgradable_pkgs = op_wrappers.list_upgradable()
component = ctx.get_option('component')
if component:
......
......@@ -18,7 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
class RebuildDb(command.Command, metaclass=command.autocommand):
__doc__ = _("""Rebuild Databases
......@@ -48,4 +48,4 @@ dirs under /var/lib/inary
def run(self):
self.init(database=True)
if ctx.ui.confirm(str(_('Rebuild INARY databases?'))):
inary.api.rebuild_db()
inary.atomicoperations.rebuild_db()
......@@ -18,7 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
import inary.db
class Remove(command.PackageOp, metaclass=command.autocommand):
......@@ -62,4 +62,4 @@ expanded to package names.
packages.extend(self.componentdb.get_union_packages(name, walk=True))
packages.extend(self.args)
inary.api.remove(packages)
inary.atomicoperations.remove(packages)
......@@ -18,7 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
import inary.db
class RemoveOrphaned(command.PackageOp, metaclass=command.autocommand):
......@@ -51,4 +51,4 @@ Remove all orphaned packages from the system.
if ctx.get_option('exclude'):
orphaned = inary.blacklist.exclude(orphaned, ctx.get_option('exclude'))
inary.api.remove(orphaned)
inary.atomicoperations.remove(orphaned)
......@@ -15,7 +15,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary.cli.command as command
import inary.api
import inary.atomicoperations
class RemoveRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Remove repositories
......@@ -35,7 +35,7 @@ Remove all repository information from the system.
if len(self.args)>=1:
self.init()
for repo in self.args:
inary.api.remove_repo(repo)
inary.atomicoperations.remove_repo(repo)
else:
self.help()
return
......@@ -17,7 +17,7 @@ __trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
import inary
import inary.api
import inary.operations.search as search
import inary.context as ctx
import inary.cli.command as command
......@@ -43,7 +43,7 @@ Finds the installed package which contains the specified file.
self.parser.add_option_group(group)
def search_file(self, path):
found = inary.api.search_file(path)
found = search.search_file(path)
for pkg, files in found:
for pkg_file in files:
ctx.ui.info(_("Package {0} has file /{1}").format(pkg, pkg_file))
......
......@@ -18,7 +18,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.atomicoperations
class UpdateRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Update repository databases
......@@ -52,6 +52,6 @@ If no repository is given, all repositories are updated.
if self.args:
repos = self.args
else:
repos = inary.api.list_repos()
repos = op_wrappers.list_repos()
inary.api.update_repos(repos, ctx.get_option('force'))
inary.atomicoperations.update_repos(repos, ctx.get_option('force'))
......@@ -18,8 +18,9 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.api
import inary.db
import inary.operations.op_wrappers as op_wrappers
import inary.atomicoperations
class Upgrade(command.PackageOp, metaclass=command.autocommand):
__doc__ = _("""Upgrade INARY packages
......@@ -84,8 +85,8 @@ expanded to package names.
if not ctx.get_option('bypass_update_repo'):
ctx.ui.info(_('Updating repositories'))
repos = inary.api.list_repos()
inary.api.update_repos(repos)
repos = op_wrappers.list_repos()
inary.atomicoperations.update_repos(repos)
else:
ctx.ui.info(_('Will not update repositories'))
......@@ -102,4 +103,4 @@ expanded to package names.
packages.extend(componentdb.get_union_packages(name, walk=True))
packages.extend(self.args)
inary.api.upgrade(packages, repository)
inary.atomicoperations.upgrade(packages, repository)
......@@ -13,6 +13,8 @@
"""INARY package relation graph that represents the state of packagedb"""
import inary
import inary.context as ctx
import inary.operations.helper as op_helper
import inary.db
import gettext
......@@ -276,7 +278,7 @@ def generate_pending_order(A):
componentdb = inary.db.componentdb.ComponentDB()
# Bug 4211
if componentdb.has_component('system.base'):
order = reorder_base_packages(order)
order = op_helper.reorder_base_packages(order)
return order
......@@ -55,6 +55,7 @@ class FilesDB(lazydb.LazyDB):
return self.filesdb.get(key), path
def search_file(self, term):
print("GELDIM BURAYA")
if self.has_file(term):
pkg, path = self.get_file(term)
return [(pkg,[path])]
......
......@@ -469,4 +469,4 @@ def fetch(packages=[], path=os.path.curdir):
else:
url = os.path.join(os.path.dirname(repodb.get_repo_url(repo)), str(uri.path()))
fetcher.fetch_url(url, path, ctx.ui.Progress)
fetch_url(url, path, ctx.ui.Progress)
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