[entropy.client] make possible to disable differential repository update feature
This commit is contained in:
@@ -34,6 +34,17 @@ repository|sabayonlinux.org||ftp://mirror.aarnet.edu.au/pub/SabayonLinux/entropy
|
||||
repository|sabayonlinux.org||http://cross-lfs.sabayonlinux.org/entropy|
|
||||
repository|sabayonlinux.org||http://na.mirror.garr.it/mirrors/sabayonlinux/entropy|
|
||||
|
||||
# syntax for differential-update
|
||||
# differential-update: This setting controls the way Entropy client updates
|
||||
# its repositories. If you're on a slow/unstable network
|
||||
# it is recommended to disable "differential-update"
|
||||
# in favour of a simple and more reliabile HTTP/FTP
|
||||
# connection. In fact, differential repository updates
|
||||
# are known to cause issues on some networks.
|
||||
# Valid parameters: disable, enable, true, false, disabled, enabled
|
||||
# Default is: enabled
|
||||
# differential-update: enabled
|
||||
|
||||
# syntax for developer-repo
|
||||
#
|
||||
# developer-repo: Enable this setting to fetch an extended repository database containing
|
||||
|
||||
@@ -140,6 +140,8 @@ class AvailablePackagesRepositoryUpdater(object):
|
||||
)
|
||||
self._developer_repo = \
|
||||
self._settings['repositories']['developer_repo']
|
||||
self._differential_update = \
|
||||
self._settings['repositories']['differential_update']
|
||||
if self._developer_repo:
|
||||
const_debug_write(__name__,
|
||||
"__init__: developer repo mode enabled")
|
||||
@@ -295,6 +297,14 @@ class AvailablePackagesRepositoryUpdater(object):
|
||||
elif sqlite3_rc != 0:
|
||||
repo_eapi = 1
|
||||
|
||||
# if differential update is disabled and FORCE_EAPI is not overriding
|
||||
# we cannot use EAPI=3
|
||||
if (eapi_env_clear is None) and (not self._differential_update) and \
|
||||
(repo_eapi == 3):
|
||||
const_debug_write(__name__,
|
||||
"__get_repo_eapi: differential update is disabled !")
|
||||
repo_eapi -= 1
|
||||
|
||||
# check EAPI
|
||||
if eapi_env_clear is not None:
|
||||
repo_eapi = eapi_env_clear
|
||||
@@ -303,7 +313,7 @@ class AvailablePackagesRepositoryUpdater(object):
|
||||
# developer_repo mode
|
||||
self._developer_repo = False
|
||||
const_debug_write(__name__,
|
||||
"_setup_repo_eapi: developer repo mode disabled FORCE_EAPI")
|
||||
"__get_repo_eapi: developer repo mode disabled FORCE_EAPI")
|
||||
|
||||
elif repo_eapi > 1 and self._developer_repo:
|
||||
# enforce EAPI=1
|
||||
|
||||
@@ -1150,6 +1150,7 @@ class SystemSettings(Singleton, EntropyPluginStore):
|
||||
'timeout': etpConst['default_download_timeout'],
|
||||
'security_advisories_url': etpConst['securityurl'],
|
||||
'developer_repo': False,
|
||||
'differential_update': True,
|
||||
}
|
||||
|
||||
repo_conf = etpConst['repositoriesconf']
|
||||
@@ -1247,6 +1248,13 @@ class SystemSettings(Singleton, EntropyPluginStore):
|
||||
if dev_repo in ("enable", "enabled", "true", "1", "yes",):
|
||||
data['developer_repo'] = True
|
||||
|
||||
elif (line.find("differential-update|") != -1) and \
|
||||
(not line.startswith("#")) and (split_line_len == 2):
|
||||
|
||||
dev_repo = split_line[1]
|
||||
if dev_repo in ("disable", "disabled", "false", "0", "no",):
|
||||
data['differential_update'] = False
|
||||
|
||||
elif (line.find("downloadspeedlimit|") != -1) and \
|
||||
(not line.startswith("#")) and (split_line_len == 2):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user