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

Önemli bazı yamalar

üst 3e3f83fb
......@@ -41,7 +41,7 @@ class Conflict(relation.Relation):
def installed_package_conflicts(confinfo):
"""determine if an installed package in *repository* conflicts with
given conflicting spec"""
return inary.data.relation.installed_package_satisfies(confinfo)
return relation.installed_package_satisfies(confinfo)
def package_conflicts(pkg, confs):
for c in confs:
......
......@@ -273,7 +273,7 @@ class ArchiveLzma(ArchiveBase):
from backports import lzma
lzma_file = lzma.LZMAFile(self.file_path, "r")
output = open(output_path, "w")
output.write(lzma_file.read())
output.write(lzma_file.read().decode("utf-8"))
output.close()
lzma_file.close()
......@@ -874,12 +874,12 @@ class SourceArchive:
ctx.ui.info(_("Fetching source from: {}").format(self.url.uri))
if self.url.get_uri().startswith("mirrors://"):
self.fetch_from_mirror()
if self.url.get_uri().startswith("file://"):
elif self.url.get_uri().startswith("file://"):
self.fetch_from_locale()
else:
inary.fetcher.fetch_url(self.url, ctx.config.archives_dir(), self.progress)
except inary.fetcher.FetchError:
if ctx.config.values.build.fallback:
if ctx.config.values.build.fallback and not self.is_cached(interactive=False):
self.fetch_from_fallback()
else:
raise
......
......@@ -193,10 +193,11 @@ class CLI(inary.ui.UI):
if ka['percent'] == 100:
self.output(util.colorize(_('\n [complete]\n'), 'yellow'))
def status(self, msg=None):
def status(self, msg=None, push_screen=True):
if msg:
msg = str(msg)
self.output(util.colorize(msg + '\n', 'brightgreen'))
if push_screen:
self.output(util.colorize(msg + '\n', 'brightgreen'))
util.xterm_title(msg)
def notify(self, event, **keywords):
......
......@@ -43,7 +43,6 @@ You can also give the name of a component.
def options(self):
group = optparse.OptionGroup(self.parser, _("emerge options"))
super(Emerge, self).add_options(group)
group.add_option("-c", "--component", action="store",
default=None, help=_("Emerge available packages under given component"))
group.add_option("--ignore-file-conflicts", action="store_true",
......
......@@ -21,7 +21,7 @@ _ = __trans.gettext
import inary.cli.command as command
import inary.context as ctx
import inary.db
from inary.operations import remove, upgrade
from inary.operations import repository, remove, upgrade
class Upgrade(command.PackageOp, metaclass=command.autocommand):
__doc__ = _("""Upgrade INARY packages
......@@ -91,7 +91,7 @@ expanded to package names.
else:
ctx.ui.info(_('Will not update repositories'))
repository = ctx.get_option('repository')
reposit = ctx.get_option('repository')
components = ctx.get_option('component')
packages = []
if components:
......@@ -99,9 +99,9 @@ expanded to package names.
for name in components:
if componentdb.has_component(name):
if repository:
packages.extend(componentdb.get_packages(name, walk=True, repo=repository))
packages.extend(componentdb.get_packages(name, walk=True, repo=reposit))
else:
packages.extend(componentdb.get_union_packages(name, walk=True))
packages.extend(self.args)
upgrade.upgrade(packages, repository)
upgrade.upgrade(packages, reposit)
......@@ -73,8 +73,8 @@ class GeneralDefaults:
destinationdirectory = "/"
autoclean = False
distribution = "Sulin"
distribution_release = "2018"
distribution_id = "s18"
distribution_release = "2019"
distribution_id = "s19"
architecture = "x86_64"
http_proxy = os.getenv("HTTP_PROXY") or None
https_proxy = os.getenv("HTTPS_PROXY") or None
......
......@@ -108,6 +108,7 @@ class Constants(metaclass=Singleton):
self.__c.files_db = "files"
self.__c.repos = "repos"
self.__c.devel_package_end = "-devel"
self.__c.info_package_end = "-pages"
self.__c.doc_package_end = "-docs?$"
self.__c.assign_to_system_devel = ["system.base", "system.devel"]
self.__c.system_devel_component = "system.devel"
......
......@@ -217,12 +217,13 @@ class Fetcher:
handler.update(bytes_read)
handler.end(bytes_read)
except OSError as e:
raise FetchError(_('Could not fetch destination file "{0}":{1}').format(self.url.get_uri(), e))
ctx.ui.error(FetchError(_('Could not fetch destination file: "{0}"\n\nTraceBack:{1}').format(self.url.get_uri(), e)))
except requests.exceptions.InvalidSchema:
# TODO: Add ftp downloader with ftplib
raise FetchError(_('Package manager not support downloding from ftp mirror'))
ctx.ui.error(FetchError(_('Package manager not support downloding from ftp mirror')))
except requests.exceptions.MissingSchema:
ctx.ui.info(_("Copying local file {}").format(self.url.get_uri()))
......@@ -230,7 +231,7 @@ class Fetcher:
if os.stat(self.partial_file).st_size == 0:
os.remove(self.partial_file)
raise FetchError(_('A problem occurred. Please check the archive address and/or permissions again.'))
ctx.ui.error(FetchError(_('A problem occurred. Please check the archive address and/or permissions again.')))
shutil.move(self.partial_file, self.archive_file)
......
......@@ -324,8 +324,7 @@ class Builder:
architecture))
ctx.ui.status(_("Building source package: {}").format(
self.spec.source.name))
self.spec.source.name))
# check if all patch files exists, if there are missing no need
# to unpack!
self.check_patches()
......@@ -521,10 +520,12 @@ class Builder:
self.spec.source.partOf = comp.name
def fetch_source_archives(self):
ctx.ui.status(_("Building source package: {} [ Fetching Step ]").format(self.spec.source.name), push_screen=False)
self.sourceArchives.fetch()
def unpack_source_archives(self):
ctx.ui.action(_("Unpacking archive(s)..."))
ctx.ui.status(_("\n * Building source package: {} [ Unpacking Step ]").format(self.spec.source.name), push_screen=False)
self.sourceArchives.unpack(self.pkg_work_dir())
# Grab AdditionalFiles
......@@ -532,26 +533,30 @@ class Builder:
# apply the patches and prepare a source directory for build.
if self.apply_patches():
ctx.ui.info(_(" unpacked ({})").format(self.pkg_work_dir()))
ctx.ui.info(_(" -> unpacked ({})").format(self.pkg_work_dir()))
self.set_state("unpack")
def run_setup_action(self):
# Run configure, build and install phase
ctx.ui.action(_("Setting up source..."))
ctx.ui.status(_("Building source package: {} [ SetupAction Step ]").format(self.spec.source.name), push_screen=False)
ctx.ui.action(_("\n * Setting up source..."))
if self.run_action_function(ctx.const.setup_func):
self.set_state("setupaction")
def run_build_action(self):
ctx.ui.action(_("Building source..."))
ctx.ui.status(_("Building source package: {} [ BuildAction Step ]").format(self.spec.source.name), push_screen=False)
ctx.ui.action(_("\n * Building source..."))
if self.run_action_function(ctx.const.build_func):
self.set_state("buildaction")
def run_check_action(self):
ctx.ui.action(_("Testing package..."))
ctx.ui.status(_("Building source package: [ CheckAction Step ] {}").format(self.spec.source.name), push_screen=False)
ctx.ui.action(_("\n * Testing package..."))
self.run_action_function(ctx.const.check_func)
def run_install_action(self):
ctx.ui.action(_("Installing..."))
ctx.ui.status(_("Building source package: [ InstallAction Step ] {}").format(self.spec.source.name), push_screen=False)
ctx.ui.action(_("\n * Installing..."))
# Before the default install make sure install_dir is clean
if not self.build_type and os.path.exists(self.pkg_install_dir()):
......
......@@ -47,7 +47,6 @@ class Build(build):
name, ext = os.path.splitext(in_file)
self.spawn(["intltool-merge", "-x", "po", in_file, os.path.join(self.build_base, name)])
class BuildPo(build):
def run(self):
build.run(self)
......@@ -99,7 +98,6 @@ class BuildPo(build):
except OSError:
pass
class Install(install):
def run(self):
install.run(self)
......@@ -162,19 +160,6 @@ class Install(install):
inaryconf.write("{0[0]} = {0[1]}\n".format(member))
inaryconf.write('\n')
class Uninstall(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print('Uninstalling ...')
project_dir = os.path.join(get_python_lib(), PROJECT)
if os.path.exists(project_dir):
print(' removing: ', project_dir)
shutil.rmtree(project_dir)
class Test(Command):
user_options = []
def initialize_options(self):
......@@ -197,6 +182,7 @@ datas = [
("/usr/lib/tmpfiles.d/", ["config/inary.conf-armv7h"])
]
setup(name="inary",
version= inary.__version__,
description="Inary (Special Package Manager)",
......@@ -206,6 +192,7 @@ setup(name="inary",
author_email="zaryob.dev@gmail.com",
url="https://github.com/Zaryob/inary",
#package_dir = {'': ''},
packages = ['inary',
'inary.actionsapi',
'inary.analyzer',
......@@ -220,7 +207,6 @@ setup(name="inary",
cmdclass = {'build' : Build,
'build_po' : BuildPo,
'install' : Install,
'uninstall' : Uninstall,
'test' : Test},
data_files =datas
)
......
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