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

Çeşitli hata mesajlarında düzeltmeler ve hızda iyileştirmeler.

* Optimizasyon amacı ile paket listelerini optimize ettim.
* arm config dosyalarına ufak dokunuşlar.
* Anlamsız bir hata mesajı ve eksik uyarılar için bakıldı.
üst 08435646
...@@ -4,7 +4,7 @@ build_host = localhost ...@@ -4,7 +4,7 @@ build_host = localhost
commonflags = -U_FORTIFY_SOURCE -march=armv8-a+crc -mtune=cortex-a53 -O3 -s -pipe commonflags = -U_FORTIFY_SOURCE -march=armv8-a+crc -mtune=cortex-a53 -O3 -s -pipe
cflags = %(commonflags)s cflags = %(commonflags)s
cxxflags = %(commonflags)s cxxflags = %(commonflags)s
host = aarch64-unknown-linux-gnueabi host = aarch64-pc-linux-gnueabi
cc = %(host)s-gcc cc = %(host)s-gcc
cxx = %(host)s-g++ cxx = %(host)s-g++
compressionlevel = 9 compressionlevel = 9
......
...@@ -4,7 +4,7 @@ build_host = localhost ...@@ -4,7 +4,7 @@ build_host = localhost
commonflags = -U_FORTIFY_SOURCE -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O3 -s -pipe commonflags = -U_FORTIFY_SOURCE -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O3 -s -pipe
cflags = %(commonflags)s cflags = %(commonflags)s
cxxflags = %(commonflags)s cxxflags = %(commonflags)s
host = armv7l-unknown-linux-gnueabihf host = armv7l-pc-linux-gnueabihf
cc = %(host)s-gcc cc = %(host)s-gcc
cxx = %(host)s-g++ cxx = %(host)s-g++
compressionlevel = 9 compressionlevel = 9
......
...@@ -883,7 +883,7 @@ class SourceArchive: ...@@ -883,7 +883,7 @@ class SourceArchive:
else: else:
raise raise
ctx.ui.info(_("\nSource archive is stored: \"{0}/{1}\"").format(ctx.config.archives_dir(), self.url.filename())) ctx.ui.info(_("Source archive is stored: \"{0}/{1}\"").format(ctx.config.archives_dir(), self.url.filename()))
def fetch_from_fallback(self): def fetch_from_fallback(self):
inary.fetcher.fetch_url(self.url.get_uri(), ctx.config.archives_dir(), self.progress) inary.fetcher.fetch_url(self.url.get_uri(), ctx.config.archives_dir(), self.progress)
......
...@@ -83,6 +83,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment ...@@ -83,6 +83,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
ctx.ui.warning(_("{0} repository could not be reached: {1}").format(name, e)) ctx.ui.warning(_("{0} repository could not be reached: {1}").format(name, e))
self.warn_and_remove(_("Removing {0} from system.").format(name), name) self.warn_and_remove(_("Removing {0} from system.").format(name), name)
else: else:
ctx.ui.warning(_("Couldn't trust \"{0}\" repository. It is deactivated.").format(name)
repository.set_repo_activity(name, False) repository.set_repo_activity(name, False)
else: else:
......
...@@ -142,7 +142,7 @@ class Digraph(object): ...@@ -142,7 +142,7 @@ class Digraph(object):
list = [] list = []
self.dfs(lambda u: list.append(u)) self.dfs(lambda u: list.append(u))
list.reverse() list.reverse()
return list return inary.util.unique_list(list)
@staticmethod @staticmethod
def id_str(u): def id_str(u):
......
...@@ -336,7 +336,7 @@ class InstallDB(lazydb.LazyDB): ...@@ -336,7 +336,7 @@ class InstallDB(lazydb.LazyDB):
else: else:
orphaned_packages.append(x) orphaned_packages.append(x)
return orphaned_packages return orphaned_packages
def get_no_rev_deps(self): def get_no_rev_deps(self):
......
...@@ -103,9 +103,9 @@ def calculate_free_space_needed(order): ...@@ -103,9 +103,9 @@ def calculate_free_space_needed(order):
total_needed += int(packagedb.get_package(pkg.name).installedSize) total_needed += int(packagedb.get_package(pkg.name).installedSize)
needed, symbol = util.human_readable_size(total_needed) needed, symbol = util.human_readable_size(total_needed)
if total_needed < 0: if total_needed < 0:
ctx.ui.info(_("{:.2f} {} space will be freed.").format(needed, symbol), color='cyan') ctx.ui.info(_("After this operation, {:.2f} {} space will be freed.").format(needed, symbol), color='cyan')
else: else:
ctx.ui.info(_("{:.2f} {} space will be used.").format(needed, symbol), color='cyan') ctx.ui.info(_("After this operation, {:.2f} {} space will be used.").format(needed, symbol), color='cyan')
return total_needed return total_needed
......
...@@ -82,7 +82,8 @@ def install_pkg_names(A, reinstall=False, extra=False): ...@@ -82,7 +82,8 @@ def install_pkg_names(A, reinstall=False, extra=False):
extra_packages = set(order) - A_0 extra_packages = set(order) - A_0
if extra_packages: if extra_packages:
if not ctx.ui.confirm(_('There are extra packages due to dependencies. Would you like to continue?')): if not ctx.ui.confirm(_('There are extra packages due to dependencies. Would you like to continue?')):
return False raise Exception(_('External dependencies not satisfied.'))
ctx.ui.notify(ui.packagestogo, order=order) ctx.ui.notify(ui.packagestogo, order=order)
...@@ -333,8 +334,7 @@ def get_install_order(packages): ...@@ -333,8 +334,7 @@ def get_install_order(packages):
dependencies -> list_of_strings dependencies -> list_of_strings
@param packages: list of package names -> list_of_strings @param packages: list of package names -> list_of_strings
""" """
install_order = plan_install_pkg_names i_graph, order = plan_install_pkg_names(packages)
i_graph, order = install_order(packages)
return order return order
......
...@@ -74,28 +74,23 @@ def remove(A, ignore_dep=False, ignore_safety=False): ...@@ -74,28 +74,23 @@ def remove(A, ignore_dep=False, ignore_safety=False):
G_f, order = plan_remove(A) G_f, order = plan_remove(A)
else: else:
G_f = None G_f = None
order = A order = util.unique_list(A)
ctx.ui.info(_("""The following list of packages will be removed ctx.ui.info(_("""The following list of packages will be removed in the respective order to satisfy dependencies:"""), color='green')
in the respective order to satisfy dependencies:"""), color='green')
ctx.ui.info(util.strlist(order)) ctx.ui.info(util.strlist(order))
if len(order) > len(A_0):
if not ctx.ui.confirm(_('Would you like to continue?')):
ctx.ui.warning(_('Package removal declined.'))
return False
removal_size = 0 removal_size = 0
for pkg in [installdb.get_package(name) for name in order]: for pkg in [installdb.get_package(name) for name in order]:
removal_size += pkg.installedSize removal_size += pkg.installedSize
removal_size, symbol = util.human_readable_size(removal_size) removal_size, symbol = util.human_readable_size(removal_size)
ctx.ui.info(_('{:.2f} {} space will be freed.').format(removal_size, symbol), color='cyan') ctx.ui.info(_('After this operation, {:.2f} {} space will be freed.').format(removal_size, symbol), color='cyan')
del removal_size, symbol del removal_size, symbol
if not ctx.ui.confirm(_("Would you like to continue?")): if len(order) > len(A_0):
ctx.ui.warning(_('Package removal declined.')) if not ctx.ui.confirm(_('Would you like to continue?')):
return False ctx.ui.warning(_('Package removal declined.'))
return False
if ctx.get_option('dry_run'): if ctx.get_option('dry_run'):
return return
......
...@@ -207,7 +207,7 @@ def upgrade(A=None, repo=None): ...@@ -207,7 +207,7 @@ def upgrade(A=None, repo=None):
if needs_confirm and \ if needs_confirm and \
not ctx.ui.confirm(_("Would you like to continue?")): not ctx.ui.confirm(_("Would you like to continue?")):
return False raise Exception(_('External dependencies not satisfied.'))
ctx.ui.notify(ui.packagestogo, order=order) ctx.ui.notify(ui.packagestogo, order=order)
......
...@@ -167,6 +167,11 @@ def flatten_list(l): ...@@ -167,6 +167,11 @@ def flatten_list(l):
# See: http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python # See: http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python
return [item for sublist in l for item in sublist] return [item for sublist in l for item in sublist]
def unique_list(l):
"""Creates a unique list by deleting duplicate items"""
list_set = set(l)
unique_list = (list(list_set))
return [x for x in unique_list]
def strlist(l): def strlist(l):
"""Concatenate string reps of l's elements.""" """Concatenate string reps of l's elements."""
......
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