Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
e9c37415
Kaydet (Commit)
e9c37415
authored
Haz 08, 2011
tarafından
Ozan Çağlayan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
upgrade: Use flatten_list() which is ~9x faster than sum() construct
üst
5ebbc177
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
upgrade.py
pisi/operations/upgrade.py
+5
-7
No files found.
pisi/operations/upgrade.py
Dosyayı görüntüle @
e9c37415
...
...
@@ -128,9 +128,7 @@ def upgrade(A=[], repo=None):
# Force upgrading of installed but replaced packages or else they will be removed (they are obsoleted also).
# This is not wanted for a replaced driver package (eg. nvidia-X).
#
# sum(array, []) is a nice trick to flatten an array of arrays
A
|=
set
(
sum
(
replaces
.
values
(),
[]))
A
|=
set
(
pisi
.
util
.
flatten_list
(
replaces
.
values
()))
A
|=
upgrade_base
(
A
)
...
...
@@ -148,7 +146,6 @@ def upgrade(A=[], repo=None):
ctx
.
ui
.
info
(
_
(
'No packages to upgrade.'
))
return
True
ctx
.
ui
.
debug
(
'A =
%
s'
%
str
(
A
))
if
not
ctx
.
config
.
get_option
(
'ignore_dependency'
):
...
...
@@ -172,7 +169,8 @@ def upgrade(A=[], repo=None):
needs_confirm
=
check_update_actions
(
order
)
if
set
(
order
)
-
A_0
-
set
(
sum
(
replaces
.
values
(),
[])):
# NOTE: replaces.values() was already flattened above, it can be reused
if
set
(
order
)
-
A_0
-
set
(
pisi
.
util
.
flatten_list
(
replaces
.
values
())):
ctx
.
ui
.
warning
(
_
(
"There are extra packages due to dependencies."
))
needs_confirm
=
True
...
...
@@ -219,7 +217,7 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
G_f
=
pgraph
.
PGraph
(
packagedb
)
# construct G_f
A
=
set
(
A
)
# Force upgrading of installed but replaced packages or else they will be removed (they are obsoleted also).
# This is not wanted for a replaced driver package (eg. nvidia-X).
#
...
...
@@ -228,7 +226,7 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
if
force_replaced
:
if
replaces
is
None
:
replaces
=
packagedb
.
get_replaces
()
A
|=
set
(
sum
(
replaces
.
values
(),
[]
))
A
|=
set
(
pisi
.
util
.
flatten_list
(
replaces
.
values
()
))
# find the "install closure" graph of G_f by package
# set A using packagedb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment