[Rigo*] implement mirrors optimization feature, see bug #3438
This commit is contained in:
@@ -436,7 +436,7 @@ class RigoDaemonService(dbus.service.Object):
|
||||
BUS_NAME = DbusConfig.BUS_NAME
|
||||
OBJECT_PATH = DbusConfig.OBJECT_PATH
|
||||
|
||||
API_VERSION = 6
|
||||
API_VERSION = 7
|
||||
|
||||
"""
|
||||
RigoDaemon is the dbus service Object in charge of executing
|
||||
@@ -2549,6 +2549,37 @@ class RigoDaemonService(dbus.service.Object):
|
||||
outcome.append(obj)
|
||||
return outcome
|
||||
|
||||
def _optimize_mirrors(self, repository_ids):
|
||||
"""
|
||||
Execute a background Repository Mirrors optimization.
|
||||
This low-priority method shall reorder Repository mirrors
|
||||
basing on throughput performance.
|
||||
It can be run in parallel with any other Entropy Client
|
||||
activity since the operation is atomic.
|
||||
"""
|
||||
optimized = False
|
||||
for repository_id in repository_ids:
|
||||
|
||||
write_output("_optimize_mirrors: %s" % (
|
||||
repository_id,), debug=True)
|
||||
|
||||
try:
|
||||
repository_metadata = self._entropy.reorder_mirrors(
|
||||
repository_id)
|
||||
except KeyError as err:
|
||||
write_output("_optimize_mirrors: "
|
||||
"repository update error: %s" % (
|
||||
repr(err),), debug=True)
|
||||
continue
|
||||
|
||||
optimized = True
|
||||
mirrors = repository_metadata.get('plain_packages')
|
||||
write_output("_optimize_mirrors: repository "
|
||||
"'%s' updated, mirrors: %s" % (
|
||||
repository_id, mirrors), debug=True)
|
||||
|
||||
GLib.idle_add(self.mirrors_optimized, repository_ids, optimized)
|
||||
|
||||
### DBUS METHODS
|
||||
|
||||
@dbus.service.method(BUS_NAME, in_signature='asb',
|
||||
@@ -3372,6 +3403,40 @@ class RigoDaemonService(dbus.service.Object):
|
||||
task.start()
|
||||
return True
|
||||
|
||||
@dbus.service.method(BUS_NAME, in_signature='as',
|
||||
out_signature='b', sender_keyword='sender')
|
||||
def optimize_mirrors(self, repository_ids, sender=None):
|
||||
"""
|
||||
Request RigoDaeon to optimize Repository Mirrors
|
||||
in background.
|
||||
"""
|
||||
pid = self._get_caller_pid(sender)
|
||||
write_output("optimize_mirrors called: "
|
||||
"client pid: %s" % (
|
||||
(pid,)), debug=True)
|
||||
|
||||
def _optimize(_repository_ids):
|
||||
_repository_ids = [self._dbus_to_unicode(x) for \
|
||||
x in _repository_ids]
|
||||
authorized = self._authorize(
|
||||
pid, PolicyActions.MANAGE_CONFIGURATION)
|
||||
if authorized:
|
||||
th = ParallelTask(
|
||||
self._optimize_mirrors,
|
||||
_repository_ids)
|
||||
th.name = "OptimizeMirrorsThread"
|
||||
th.daemon = True
|
||||
th.start()
|
||||
else:
|
||||
GLib.idle_add(self.mirrors_optimized,
|
||||
_repository_ids, False)
|
||||
|
||||
task = ParallelTask(_optimize, repository_ids)
|
||||
task.name = "OptimizeMirrorsRequestThread"
|
||||
task.daemon = True
|
||||
task.start()
|
||||
return True
|
||||
|
||||
### DBUS SIGNALS
|
||||
|
||||
@dbus.service.signal(dbus_interface=BUS_NAME,
|
||||
@@ -3611,6 +3676,15 @@ class RigoDaemonService(dbus.service.Object):
|
||||
write_output("old_repositories(): %s" % (locals(),),
|
||||
debug=True)
|
||||
|
||||
@dbus.service.signal(dbus_interface=BUS_NAME,
|
||||
signature='asb')
|
||||
def mirrors_optimized(self, repository_ids, optimized):
|
||||
"""
|
||||
Mirrors have been eventually optimized for given Repositories.
|
||||
"""
|
||||
write_output("mirrors_optimized() issued, args:"
|
||||
" %s" % (locals(),), debug=True)
|
||||
|
||||
@dbus.service.signal(dbus_interface=BUS_NAME,
|
||||
signature='')
|
||||
def ping(self):
|
||||
|
||||
@@ -112,5 +112,10 @@
|
||||
<arg name="accepted" type="b" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="optimize_mirrors">
|
||||
<arg name="repository_ids" type="as" direction="in"/>
|
||||
<arg name="accepted" type="b" direction="out"/>
|
||||
</method>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
|
||||
463
rigo/data/icons/browser-download.svg
Normal file
463
rigo/data/icons/browser-download.svg
Normal file
@@ -0,0 +1,463 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.0"
|
||||
width="48"
|
||||
height="48"
|
||||
id="svg3786">
|
||||
<defs
|
||||
id="defs3788">
|
||||
<linearGradient
|
||||
x1="8.5273199"
|
||||
y1="33.332287"
|
||||
x2="57.411129"
|
||||
y2="33.332287"
|
||||
id="linearGradient2901"
|
||||
xlink:href="#linearGradient4222"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0,0.798445,-0.7913078,0,44.889795,-5.6111935)" />
|
||||
<linearGradient
|
||||
id="linearGradient4222">
|
||||
<stop
|
||||
id="stop4224"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop4226"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2264">
|
||||
<stop
|
||||
id="stop2266"
|
||||
style="stop-color:#d7e866;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2268"
|
||||
style="stop-color:#8cab2a;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="28.670898"
|
||||
y1="23.890965"
|
||||
x2="1.3099612"
|
||||
y2="23.890965"
|
||||
id="linearGradient3390"
|
||||
xlink:href="#linearGradient2264"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0,-0.6884294,-0.6854408,0,40.375844,29.770525)" />
|
||||
<linearGradient
|
||||
id="linearGradient5048-8">
|
||||
<stop
|
||||
id="stop5050-1"
|
||||
style="stop-color:#000000;stop-opacity:0"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop5056-2"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0.5" />
|
||||
<stop
|
||||
id="stop5052-9"
|
||||
style="stop-color:#000000;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
r="117.14286"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
id="radialGradient2939"
|
||||
xlink:href="#linearGradient5060-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.04484747,0,0,0.02058824,15.231827,34.839926)" />
|
||||
<linearGradient
|
||||
id="linearGradient5060-3">
|
||||
<stop
|
||||
id="stop5062-9"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop5064-0"
|
||||
style="stop-color:#000000;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
r="117.14286"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
id="radialGradient2936"
|
||||
xlink:href="#linearGradient5060-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.04484747,0,0,0.02058824,32.454077,34.839926)" />
|
||||
<linearGradient
|
||||
x1="29.9375"
|
||||
y1="41"
|
||||
x2="30"
|
||||
y2="49.999996"
|
||||
id="linearGradient2933"
|
||||
xlink:href="#linearGradient2215-8"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0017502,0,0,0.7596403,-5.2079507,7.3249279)" />
|
||||
<linearGradient
|
||||
id="linearGradient2215-8">
|
||||
<stop
|
||||
id="stop2223-8"
|
||||
style="stop-color:#7a7a7a;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2219-5"
|
||||
style="stop-color:#474747;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="11.734284"
|
||||
cy="8.4900017"
|
||||
r="23.047892"
|
||||
fx="11.734284"
|
||||
fy="8.4900017"
|
||||
id="radialGradient2927"
|
||||
xlink:href="#linearGradient7056-0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.3767077,0.69719425,-0.46810846,0.92434578,-0.2062097,-0.5500743)" />
|
||||
<linearGradient
|
||||
id="linearGradient7056-0">
|
||||
<stop
|
||||
id="stop7064-9"
|
||||
style="stop-color:#e6e6e6;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop7060-6"
|
||||
style="stop-color:#c8c8c8;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="17.813944"
|
||||
y1="29.796696"
|
||||
x2="18.072828"
|
||||
y2="10.000001"
|
||||
id="linearGradient2929"
|
||||
xlink:href="#linearGradient3484-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.1570532,1.3884067)" />
|
||||
<linearGradient
|
||||
id="linearGradient3484-3">
|
||||
<stop
|
||||
id="stop3486-8"
|
||||
style="stop-color:#969696;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3488-5"
|
||||
style="stop-color:#b4b4b4;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="141.74666"
|
||||
cy="206.42612"
|
||||
r="78.728165"
|
||||
fx="141.74666"
|
||||
fy="206.42612"
|
||||
id="radialGradient2923"
|
||||
xlink:href="#linearGradient4035"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.35160878,-0.0050244,0.00260227,0.28909275,-27.181393,-22.828984)" />
|
||||
<linearGradient
|
||||
id="linearGradient4035">
|
||||
<stop
|
||||
id="stop4037"
|
||||
style="stop-color:#f5f5f5;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop4039"
|
||||
style="stop-color:#e7e7e7;stop-opacity:1"
|
||||
offset="0.47025558" />
|
||||
<stop
|
||||
id="stop4041"
|
||||
style="stop-color:#8c8c8c;stop-opacity:1"
|
||||
offset="0.69348532" />
|
||||
<stop
|
||||
id="stop4043"
|
||||
style="stop-color:#dddddd;stop-opacity:1"
|
||||
offset="0.83542866" />
|
||||
<stop
|
||||
id="stop4045"
|
||||
style="stop-color:#a8a8a8;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="142.62215"
|
||||
cy="191.85428"
|
||||
r="78.728165"
|
||||
fx="142.62215"
|
||||
fy="191.85428"
|
||||
id="radialGradient2920"
|
||||
xlink:href="#linearGradient7609"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.18495239,0,0,-0.13074306,-3.2682255,47.43699)" />
|
||||
<linearGradient
|
||||
id="linearGradient7609">
|
||||
<stop
|
||||
id="stop7611"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop7677"
|
||||
style="stop-color:#e7e7e7;stop-opacity:1"
|
||||
offset="0.47025558" />
|
||||
<stop
|
||||
id="stop7613"
|
||||
style="stop-color:#8c8c8c;stop-opacity:1"
|
||||
offset="0.67183787" />
|
||||
<stop
|
||||
id="stop7617"
|
||||
style="stop-color:#dddddd;stop-opacity:1"
|
||||
offset="0.83542866" />
|
||||
<stop
|
||||
id="stop7615"
|
||||
style="stop-color:#a8a8a8;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="113.0654"
|
||||
cy="97.587898"
|
||||
r="2.5631001"
|
||||
fx="113.667"
|
||||
fy="98"
|
||||
id="radialGradient2965"
|
||||
xlink:href="#radialGradient4241"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.32948872,0,0,0.34974643,41.805988,2.8823791)" />
|
||||
<radialGradient
|
||||
cx="113.0654"
|
||||
cy="97.587898"
|
||||
r="2.5631001"
|
||||
fx="113.667"
|
||||
fy="98"
|
||||
id="radialGradient4241"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
id="stop4243"
|
||||
style="stop-color:#eeeeee;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop4245"
|
||||
style="stop-color:#cecece;stop-opacity:1"
|
||||
offset="0.16" />
|
||||
<stop
|
||||
id="stop4247"
|
||||
style="stop-color:#888888;stop-opacity:1"
|
||||
offset="0.4675" />
|
||||
<stop
|
||||
id="stop4249"
|
||||
style="stop-color:#555555;stop-opacity:1"
|
||||
offset="1" />
|
||||
</radialGradient>
|
||||
<radialGradient
|
||||
cx="113.0654"
|
||||
cy="97.587898"
|
||||
r="2.5631001"
|
||||
fx="113.667"
|
||||
fy="98"
|
||||
id="radialGradient2959"
|
||||
xlink:href="#radialGradient4241"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.22282769,-0.03752228,0.02509892,0.149051,-18.302971,2.9208339)" />
|
||||
<radialGradient
|
||||
cx="113.0654"
|
||||
cy="97.587898"
|
||||
r="2.5631001"
|
||||
fx="113.667"
|
||||
fy="98"
|
||||
id="radialGradient2953"
|
||||
xlink:href="#radialGradient4241"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.22333209,0.03439303,-0.02300572,0.14938839,14.634388,-5.2432873)" />
|
||||
<linearGradient
|
||||
x1="7.0625"
|
||||
y1="35.28125"
|
||||
x2="24.6875"
|
||||
y2="35.28125"
|
||||
id="linearGradient2908"
|
||||
xlink:href="#linearGradient5060-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0212766,0,0,0.89887639,0.6301868,10.175067)" />
|
||||
<linearGradient
|
||||
x1="12.277412"
|
||||
y1="37.205811"
|
||||
x2="12.221823"
|
||||
y2="33.758667"
|
||||
id="linearGradient2905"
|
||||
xlink:href="#linearGradient4236"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0212766,0,0,0.89887639,-0.1822315,11.366816)" />
|
||||
<linearGradient
|
||||
id="linearGradient4236">
|
||||
<stop
|
||||
id="stop4238"
|
||||
style="stop-color:#eeeeee;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop4240"
|
||||
style="stop-color:#eeeeee;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="127.31733"
|
||||
cy="143.82751"
|
||||
r="78.728165"
|
||||
fx="127.31733"
|
||||
fy="143.82751"
|
||||
id="radialGradient2902"
|
||||
xlink:href="#linearGradient4035"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.19054222,-0.02505584,0.00619351,0.10073457,-7.5942276,6.81724)" />
|
||||
<radialGradient
|
||||
cx="113.0654"
|
||||
cy="97.587898"
|
||||
r="2.5631001"
|
||||
fx="113.667"
|
||||
fy="98"
|
||||
id="radialGradient2947"
|
||||
xlink:href="#radialGradient4241"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.32948872,0,0,0.34974643,5.89787,2.8823791)" />
|
||||
<radialGradient
|
||||
cx="24"
|
||||
cy="42"
|
||||
r="21"
|
||||
fx="24"
|
||||
fy="42"
|
||||
id="radialGradient2896"
|
||||
xlink:href="#linearGradient6310-8"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99999995,-1.0652117e-8,2.7812622e-8,0.35714279,-0.1570521,26.888557)" />
|
||||
<linearGradient
|
||||
id="linearGradient6310-8">
|
||||
<stop
|
||||
id="stop6312-6"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop6314-6"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="302.85715"
|
||||
y1="366.64789"
|
||||
x2="302.85715"
|
||||
y2="609.50507"
|
||||
id="linearGradient3032"
|
||||
xlink:href="#linearGradient5048-8"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.07635654,0,0,0.02058824,-3.7544815,34.839926)" />
|
||||
</defs>
|
||||
<rect
|
||||
width="36.869301"
|
||||
height="5"
|
||||
x="5.4082794"
|
||||
y="42.388554"
|
||||
id="rect2723-6"
|
||||
style="opacity:0.3;fill:url(#linearGradient3032);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
d="m 42.259617,42.388728 c 0,0 0,4.999723 0,4.999723 2.30953,0.0094 5.58333,-1.120185 5.58333,-2.500182 0,-1.379997 -2.57726,-2.499541 -5.58333,-2.499541 z"
|
||||
id="path2725-1"
|
||||
style="opacity:0.3;fill:url(#radialGradient2939);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
d="m 5.426277,42.388728 c 0,0 0,4.999723 0,4.999723 -2.30954,0.0094 -5.5833302,-1.120185 -5.5833302,-2.500182 0,-1.379997 2.5772702,-2.499541 5.5833302,-2.499541 z"
|
||||
id="path2727-1"
|
||||
style="opacity:0.3;fill:url(#radialGradient2936);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
d="m 1.3068005,38.852555 45.0720005,0 -0.901202,6.072 -43.169419,0 -1.0013795,-6.072 z"
|
||||
id="rect6431-5"
|
||||
style="fill:url(#linearGradient2933);fill-opacity:1;fill-rule:evenodd;stroke:#353537;stroke-width:0.9279989;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline;enable-background:new" />
|
||||
<rect
|
||||
width="45"
|
||||
height="1"
|
||||
x="1.342947"
|
||||
y="38.388409"
|
||||
id="rect6381-9"
|
||||
style="fill:#d2d2d3;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;enable-background:new" />
|
||||
<path
|
||||
d="M 46.392947,38.990516 39.583314,13.216178 c -0.192553,-0.733973 -1.2012,-1.329879 -2.049166,-1.329879 l -27.617218,0 c -1.30274,0 -2.049257,0.198573 -2.323959,1.329879 L 1.2929468,38.96542"
|
||||
id="path6345-8"
|
||||
style="fill:url(#radialGradient2927);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2929);stroke-width:0.99578345;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
d="M 45.342949,38.888408 2.342947,38.864357"
|
||||
id="path7046-4"
|
||||
style="opacity:0.4;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
d="m 40.814344,27.762368 c -0.21768,-1.997975 -1.676509,-3.903122 -4.1004,-5.406472 -0.04876,-0.577862 -0.670055,-7.97019 -0.670055,-7.97019 -0.04762,-0.568265 -0.771749,-0.997153 -1.685016,-0.997153 l -5.731268,0 c -0.919834,0 -1.630882,0.434524 -1.654073,1.010704 -0.10517,2.603206 -3.312025,3.962376 -8.095624,5.198802 -1.67612,0.29034 -6.046005,1.655156 -7.048964,2.254184 -2.952438,1.573605 -4.713226,3.67147 -4.957204,5.910125 -0.22194,2.036069 0.844826,4.073551 3.003866,5.737168 3.160059,2.435045 8.381346,3.889018 13.967237,3.889018 5.5859,0 10.807176,-1.453973 13.967635,-3.889018 1.971903,-1.519149 3.032469,-3.350655 3.032469,-5.207826 0,-0.17636 -0.01031,-0.352992 -0.02866,-0.529342 l 5.7e-5,0 z m -16.971501,8.616336 c -9.303498,0 -16.427483,-4.080325 -15.912079,-8.810179 0.222328,-2.039173 1.854362,-4.216036 4.557022,-5.650539 0.506122,-0.381482 5.077073,-1.865368 6.716838,-2.126087 4.544655,-1.17209 8.700731,-2.693216 8.831026,-5.89884 0.0057,-0.153501 0.267557,-0.275107 0.591955,-0.275107 l 5.730502,0 c 0.33174,0 0.611698,0.127531 0.62484,0.284984 l 0.695941,8.281975 c 2.408816,1.395843 3.86841,3.479309 4.075655,5.383614 0.515781,4.729854 -6.608191,8.810179 -15.9117,8.810179 l 0,0 z"
|
||||
id="path9001"
|
||||
style="fill:url(#radialGradient2923);fill-opacity:1" />
|
||||
<path
|
||||
d="m 23.842716,30.388554 c -3.364964,0 -5.944551,-1.267115 -5.998923,-2.947825 -4.28e-4,-0.01817 -8.46e-4,-0.03604 -8.46e-4,-0.0539 0,-0.608175 0.338098,-1.186584 0.980563,-1.676322 1.086804,-0.827824 2.963209,-1.321951 5.019622,-1.321951 2.055997,0 3.932391,0.494127 5.019195,1.321951 0.661441,0.503521 1.000395,1.101987 0.979728,1.729907 -0.05524,1.68071 -2.634804,2.948137 -5.999339,2.948137 l 0,3e-6 z m 0,-5.059679 c -3.161777,0 -4.77259,1.255831 -4.734647,2.402312 0.03667,1.128624 2.156333,2.030394 4.734647,2.030394 2.578314,0 4.697955,-0.902088 4.734637,-2.030394 0.03749,-1.146798 -1.572872,-2.402312 -4.734637,-2.402312 l 0,0 z"
|
||||
id="path9003"
|
||||
style="fill:url(#radialGradient2920);fill-opacity:1;fill-rule:nonzero;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
d="m 5.85877,37.007838 c -0.04152,0.595269 -0.663261,1.080716 -1.388137,1.080716 -0.724546,0 -1.273145,-0.485447 -1.22471,-1.080716 0.04811,-0.592121 0.669522,-1.070225 1.387148,-1.070225 0.717957,2.81e-4 1.266555,0.478104 1.225699,1.070225 z"
|
||||
id="path9007"
|
||||
style="fill:#e1e1e1;fill-opacity:1" />
|
||||
<path
|
||||
d="m 5.389906,36.589191 c 0.06623,0.07554 0.142011,0.196558 0.142011,0.357441 0,0.01155 -6.61e-4,0.02308 -0.0013,0.03533 -0.02867,0.410252 -0.514003,0.756851 -1.059637,0.756851 -0.310707,0 -0.594726,-0.113668 -0.759471,-0.304629 -0.07084,-0.08149 -0.151565,-0.216493 -0.137067,-0.396263 0.03328,-0.406755 0.517955,-0.750556 1.058977,-0.750556 0.308401,2.8e-4 0.591431,0.112968 0.756505,0.301831 l 3e-6,0 z"
|
||||
id="path9009"
|
||||
style="fill:url(#radialGradient2965);fill-opacity:1" />
|
||||
<path
|
||||
d="m 8.456482,13.370357 c 0.0708,0.248957 0.526108,0.385035 1.016329,0.302486 0.489999,-0.08251 0.82617,-0.351869 0.750696,-0.600038 -0.07503,-0.246865 -0.52959,-0.379851 -1.014908,-0.298127 -0.485522,0.08188 -0.82224,0.347988 -0.752117,0.595679 z"
|
||||
id="path9019"
|
||||
style="fill:#f0f0f0;fill-opacity:1" />
|
||||
<path
|
||||
d="m 8.743523,13.138549 c -0.03937,0.03974 -0.08193,0.09994 -0.07039,0.168502 8.29e-4,0.0049 0.0021,0.0098 0.0034,0.0149 0.04883,0.171572 0.401926,0.264011 0.770928,0.201874 0.210127,-0.03538 0.394047,-0.116169 0.491757,-0.216312 0.04206,-0.0428 0.08696,-0.109523 0.06426,-0.184484 -0.0517,-0.169557 -0.404147,-0.260879 -0.770031,-0.199267 -0.208546,0.03524 -0.391868,0.115496 -0.489951,0.214782 l -2e-6,1e-6 z"
|
||||
id="path9021"
|
||||
style="fill:url(#radialGradient2959);fill-opacity:1" />
|
||||
<path
|
||||
d="m 36.755204,13.085116 c -0.01101,0.258593 0.37848,0.530843 0.869811,0.606508 0.491108,0.07563 0.894887,-0.07446 0.901213,-0.333771 0.0063,-0.257936 -0.383413,-0.527015 -0.869831,-0.601923 -0.486659,-0.07482 -0.889937,0.07201 -0.901193,0.329186 z"
|
||||
id="path9025"
|
||||
style="fill:#e1e1e1;fill-opacity:1" />
|
||||
<path
|
||||
d="m 37.100544,12.955239 c -0.04986,0.02535 -0.109185,0.06913 -0.119768,0.137852 -7.6e-4,0.0049 -0.0011,0.0099 -0.0014,0.01523 -0.0076,0.178225 0.298614,0.37693 0.668452,0.433884 0.210602,0.03243 0.410591,0.01353 0.534819,-0.05084 0.05338,-0.02741 0.116973,-0.07665 0.118971,-0.15495 0.0042,-0.177212 -0.301707,-0.374653 -0.668419,-0.431126 -0.209057,-0.03207 -0.408312,-0.01348 -0.532624,0.04996 l -2e-6,-1e-6 z"
|
||||
id="path9027"
|
||||
style="fill:url(#radialGradient2953);fill-opacity:1" />
|
||||
<path
|
||||
d="m 7.342947,39.388553 18.500009,0 0,5.000001 -18,0 -0.500009,-5.000001 z"
|
||||
id="rect8993"
|
||||
style="fill:url(#linearGradient2908);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.40899992;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
d="m 7.842955,44.38855 c 0,0 -0.400008,-3.605827 -0.400008,-3.605827 1.874581,2.857731 8.873019,3.605827 13.612771,3.605827 0,0 -13.212763,0 -13.212763,0 z"
|
||||
id="path8995"
|
||||
style="opacity:0.81142853;fill:url(#linearGradient2905);fill-opacity:1;fill-rule:evenodd;stroke:none" />
|
||||
<path
|
||||
d="m 10.749526,13.388553 -0.103274,0.381009 -1.54175,5.670889 -0.261555,0.948102 0.763997,-0.203795 12.994774,-3.544305 0.04127,-0.01771 0.03442,-0.01771 c 0.688135,-0.354354 1.05583,-1.07045 1.142548,-1.727849 0.0434,-0.328702 0.03039,-0.650575 -0.08254,-0.948099 C 23.630774,13.648209 23.35314,13.398308 23.0629,13.406298 l 0,-0.01771 -0.04821,0 -11.955461,0 -0.30973,0 3.3e-5,10e-7 z m 0.439836,0.350376 11.976544,0 c 0.0056,0.04787 0.01906,0.07443 0.0067,0.165 -0.03757,0.285021 -0.199195,1.304699 -0.605242,1.527141 l -12.596058,3.437485 1.217592,-5.129624 3.91e-4,0 z"
|
||||
id="path9039"
|
||||
style="fill:url(#radialGradient2902);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
d="m 41.845089,37.007838 c 0.04152,0.595269 0.663261,1.080716 1.388137,1.080716 0.724546,0 1.273145,-0.485447 1.22471,-1.080716 -0.04811,-0.592121 -0.669522,-1.070225 -1.387148,-1.070225 -0.717957,2.81e-4 -1.266555,0.478104 -1.225699,1.070225 z"
|
||||
id="path9091"
|
||||
style="fill:#e1e1e1;fill-opacity:1" />
|
||||
<path
|
||||
d="m 42.313953,36.589191 c -0.06623,0.07554 -0.142011,0.196558 -0.142011,0.357441 0,0.01155 6.6e-4,0.02308 0.0013,0.03533 0.02867,0.410252 0.514002,0.756851 1.059636,0.756851 0.310708,0 0.594727,-0.113668 0.759471,-0.304629 0.07084,-0.08149 0.151565,-0.216493 0.137068,-0.396263 -0.03328,-0.406755 -0.517956,-0.750556 -1.058978,-0.750556 -0.308401,2.8e-4 -0.591431,0.112968 -0.756505,0.301831 l -2e-6,0 z"
|
||||
id="path9093"
|
||||
style="fill:url(#radialGradient2947);fill-opacity:1" />
|
||||
<rect
|
||||
width="42"
|
||||
height="5"
|
||||
x="2.842947"
|
||||
y="39.388554"
|
||||
id="rect6300-3"
|
||||
style="opacity:0.3;fill:url(#radialGradient2896);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 37.509771,13.5 23.966059,28.509772 10.490228,13.5 16.5,13.5 l 0,-13.009772 15,0 0,13.009772 6.009771,0 z"
|
||||
id="path4348"
|
||||
style="fill:url(#linearGradient3390);fill-opacity:1;fill-rule:nonzero;stroke:#548820;stroke-width:0.98045683;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
d="M 35.205341,14.5 24,27 12.632926,14.5 17.5,14.5 l 0,-13.0000004 13,0 0,13.0000004 4.705341,0 z"
|
||||
id="path4360"
|
||||
style="opacity:0.35400002;fill:none;stroke:url(#linearGradient2901);stroke-width:0.98045683;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 21 KiB |
@@ -69,6 +69,7 @@ class RigoServiceController(GObject.Object):
|
||||
SYSTEM_UPGRADE_CONTEXT_ID = "SystemUpgradeContextId"
|
||||
PKG_INSTALL_CONTEXT_ID = "PackageInstallContextId"
|
||||
REPOSITORY_SETTINGS_CONTEXT_ID = "RepositoriesSettingsContextId"
|
||||
OPTIMIZE_MIRRORS_CONTEXT_ID = "MirrorsOptimizedContextId"
|
||||
|
||||
class ServiceNotificationBox(NotificationBox):
|
||||
|
||||
@@ -186,7 +187,8 @@ class RigoServiceController(GObject.Object):
|
||||
_OLD_REPOSITORIES_SIGNAL = "old_repositories"
|
||||
_NOTICEBOARDS_AVAILABLE_SIGNAL = "noticeboards_available"
|
||||
_REPOS_SETTINGS_CHANGED_SIGNAL = "repositories_settings_changed"
|
||||
_SUPPORTED_APIS = [6]
|
||||
_MIRRORS_OPTIMIZED_SIGNAL = "mirrors_optimized"
|
||||
_SUPPORTED_APIS = [6, 7]
|
||||
|
||||
def __init__(self, rigo_app, activity_rwsem,
|
||||
entropy_client, entropy_ws):
|
||||
@@ -541,6 +543,13 @@ class RigoServiceController(GObject.Object):
|
||||
self._repositories_settings_changed_signal,
|
||||
dbus_interface=self.DBUS_INTERFACE)
|
||||
|
||||
# RigoDaemon tells us that mirros have been
|
||||
# optimized
|
||||
self.__entropy_bus.connect_to_signal(
|
||||
self._MIRRORS_OPTIMIZED_SIGNAL,
|
||||
self._mirrors_optimized_signal,
|
||||
dbus_interface=self.DBUS_INTERFACE)
|
||||
|
||||
return self.__entropy_bus
|
||||
|
||||
### GOBJECT EVENTS
|
||||
@@ -1085,6 +1094,30 @@ class RigoServiceController(GObject.Object):
|
||||
__name__,
|
||||
"_repositories_updated_signal: repositories-updated")
|
||||
|
||||
def _mirrors_optimized_signal(self, repository_ids, optimized):
|
||||
|
||||
repository_ids = [self._dbus_to_unicode(x) for x in \
|
||||
repository_ids]
|
||||
|
||||
const_debug_write(
|
||||
__name__,
|
||||
"_mirrors_optimized_signal: received for "
|
||||
"%s, optimized: %s" % (repository_ids, optimized,))
|
||||
|
||||
if optimized:
|
||||
msg = prepare_markup(
|
||||
_("Congratulations, mirrors have been <b>optimized</b>!"))
|
||||
msg_type = Gtk.MessageType.INFO
|
||||
else:
|
||||
msg = prepare_markup(
|
||||
_("Ouch, mirrors <b>not optimized</b>, sorry!"))
|
||||
msg_type = Gtk.MessageType.WARNING
|
||||
|
||||
box = self.ServiceNotificationBox(
|
||||
msg, msg_type,
|
||||
context_id=self.OPTIMIZE_MIRRORS_CONTEXT_ID)
|
||||
self._nc.append(box, timeout=30)
|
||||
|
||||
def _output_signal(self, text, header, footer, back, importance, level,
|
||||
count_c, count_t, percent, raw):
|
||||
"""
|
||||
@@ -1466,6 +1499,37 @@ class RigoServiceController(GObject.Object):
|
||||
task.daemon = True
|
||||
task.start()
|
||||
|
||||
def optimize_mirrors(self, repository_ids):
|
||||
"""
|
||||
Request mirror list optimization (basically
|
||||
sorting per throughput) for the given
|
||||
Repositories.
|
||||
"""
|
||||
if self.api() < 7:
|
||||
# ignore request, RigoDaemon is too old
|
||||
return
|
||||
|
||||
def _optimize():
|
||||
accepted = dbus.Interface(
|
||||
self._entropy_bus,
|
||||
dbus_interface=self.DBUS_INTERFACE
|
||||
).optimize_mirrors(repository_ids)
|
||||
if accepted:
|
||||
msg = prepare_markup(
|
||||
_("Mirrors will be optimized in <b>background</b>..."))
|
||||
msg_type = Gtk.MessageType.INFO
|
||||
else:
|
||||
msg = prepare_markup(
|
||||
_("Mirrors optimization <b>not available</b> at this time"))
|
||||
msg_type = Gtk.MessageType.WARNING
|
||||
box = self.ServiceNotificationBox(
|
||||
msg, msg_type,
|
||||
context_id=self.OPTIMIZE_MIRRORS_CONTEXT_ID)
|
||||
self._nc.append(box, timeout=30)
|
||||
return accepted
|
||||
|
||||
return self._execute_mainloop(_optimize)
|
||||
|
||||
def configuration_updates(self):
|
||||
"""
|
||||
Request pending Configuration File Updates.
|
||||
|
||||
@@ -446,6 +446,14 @@ class ApplicationsViewController(GObject.Object):
|
||||
if sim_str:
|
||||
self.remove(sim_str)
|
||||
|
||||
def _do_optimize_mirrors():
|
||||
self._entropy.rwsem().reader_acquire()
|
||||
try:
|
||||
repository_ids = self._entropy.repositories()
|
||||
finally:
|
||||
self._entropy.rwsem().reader_release()
|
||||
self._service.optimize_mirrors(repository_ids)
|
||||
|
||||
special_keys_map = {
|
||||
"in:confupdate": self._service.configuration_updates,
|
||||
self.SHOW_QUEUE_KEY: self._show_action_queue_items,
|
||||
@@ -463,6 +471,7 @@ class ApplicationsViewController(GObject.Object):
|
||||
"do:remove": _do_remove,
|
||||
"do:upgrade": self.upgrade,
|
||||
"do:hello": self._service.hello,
|
||||
"do:optimize": _do_optimize_mirrors,
|
||||
}
|
||||
|
||||
special_f = special_keys_map.get(split_text[0])
|
||||
@@ -717,11 +726,25 @@ class ApplicationsViewController(GObject.Object):
|
||||
self._search(ApplicationsViewController.SHOW_INSTALLED_KEY,
|
||||
_force=True)
|
||||
pref = Preference(
|
||||
-1, _("Show Installed Applications"),
|
||||
-2, _("Show Installed Applications"),
|
||||
_("Browse through the currently Installed Applications."),
|
||||
"drive-harddisk", _show_installed)
|
||||
self._prefc.append(pref)
|
||||
|
||||
def _optimize_mirrors():
|
||||
self._entropy.rwsem().reader_acquire()
|
||||
try:
|
||||
repository_ids = self._entropy.repositories()
|
||||
finally:
|
||||
self._entropy.rwsem().reader_release()
|
||||
self._service.optimize_mirrors(repository_ids)
|
||||
pref = Preference(
|
||||
50, _("Optimize Download Speed"),
|
||||
_("Benchmark the download mirrors to speed up Application"
|
||||
" installation."),
|
||||
"browser-download", _optimize_mirrors)
|
||||
self._prefc.append(pref)
|
||||
|
||||
def _show_queue_view(widget):
|
||||
self._search(ApplicationsViewController.SHOW_QUEUE_KEY,
|
||||
_force=True)
|
||||
|
||||
Reference in New Issue
Block a user