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
71782825
Kaydet (Commit)
71782825
authored
May 15, 2020
tarafından
Ali Rıza KESKİN
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
paket varlik kontrolu sistemi degistirildi
üst
4d6599d4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
35 deletions
+25
-35
atomicoperations.py
inary/atomicoperations.py
+8
-5
inarycli.py
inary/cli/inarycli.py
+0
-1
installdb.py
inary/db/installdb.py
+7
-11
packagedb.py
inary/db/packagedb.py
+2
-4
helper.py
inary/operations/helper.py
+2
-3
install.py
inary/operations/install.py
+1
-3
upgrade.py
inary/operations/upgrade.py
+5
-8
No files found.
inary/atomicoperations.py
Dosyayı görüntüle @
71782825
...
...
@@ -78,6 +78,7 @@ class Install(AtomicOperation):
@staticmethod
def
from_name
(
name
,
ignore_dep
=
None
):
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
# download package and return an installer object
# find package in repository
repo
=
packagedb
.
which_repo
(
name
)
...
...
@@ -89,7 +90,6 @@ class Install(AtomicOperation):
pkg
=
packagedb
.
get_package
(
name
)
delta
=
None
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
# Package is installed. This is an upgrade. Check delta.
if
installdb
.
has_package
(
pkg
.
name
):
release
=
installdb
.
get_release
(
pkg
.
name
)
...
...
@@ -486,7 +486,7 @@ class Install(AtomicOperation):
self
.
package
.
extract_file_synced
(
ctx
.
const
.
postops
,
self
.
package
.
pkg_dir
())
def
write_status_file
(
self
):
self
.
installdb
.
mark_installed
(
self
.
pkginfo
.
name
)
self
.
installdb
.
mark_installed
(
"{0}-{1}-{2}"
.
format
(
self
.
pkginfo
.
name
,
self
.
pkginfo
.
version
,
self
.
pkginfo
.
release
)
)
def
update_databases
(
self
):
"""update databases"""
...
...
@@ -501,10 +501,10 @@ class Install(AtomicOperation):
actions
=
self
.
pkginfo
.
get_update_actions
(
"1"
)
for
package_name
in
actions
.
get
(
"serviceRestart"
,
[]):
inary
.
db
.
installdb
.
InstallDB
()
.
mark_needs_restart
(
package_name
)
self
.
installdb
.
mark_needs_restart
(
package_name
)
for
package_name
in
actions
.
get
(
"systemRestart"
,
[]):
inary
.
db
.
installdb
.
InstallDB
()
.
mark_needs_reboot
(
package_name
)
self
.
installdb
.
mark_needs_reboot
(
package_name
)
# filesdb
ctx
.
ui
.
info
(
_
(
'Adding files of
\"
{}
\"
package to database...'
)
.
format
(
self
.
metadata
.
package
.
name
),
color
=
'faintpurple'
)
...
...
@@ -593,7 +593,10 @@ class Remove(AtomicOperation):
ctx
.
ui
.
close
()
ctx
.
ui
.
notify
(
inary
.
ui
.
removed
,
package
=
self
.
package
,
files
=
self
.
files
)
util
.
xterm_title_reset
()
self
.
installdb
.
clear_installed
(
self
.
package_name
)
self
.
remove_status_file
()
def
remove_status_file
(
self
):
self
.
installdb
.
clear_installed
(
"{0.name}-{0.version}-{0.release}"
.
format
(
self
.
package
))
def
check_dependencies
(
self
):
# FIXME: why is this not implemented? -- exa
...
...
inary/cli/inarycli.py
Dosyayı görüntüle @
71782825
...
...
@@ -22,7 +22,6 @@ _ = __trans.gettext
import
inary
import
inary.errors
import
inary.cli
import
inary.cli.command
as
command
import
inary.cli.addrepo
...
...
inary/db/installdb.py
Dosyayı görüntüle @
71782825
...
...
@@ -68,7 +68,7 @@ class InstallDB(lazydb.LazyDB):
def
__init__
(
self
):
lazydb
.
LazyDB
.
__init__
(
self
,
cacheable
=
True
,
cachedir
=
ctx
.
config
.
packages_dir
())
self
.
init
()
#
self.init()
def
init
(
self
):
self
.
installed_db
=
self
.
__generate_installed_pkgs
()
...
...
@@ -87,19 +87,15 @@ class InstallDB(lazydb.LazyDB):
@staticmethod
def
__generate_installed_pkgs
():
installed_list
=
[]
not_installed
=
[]
info_path
=
os
.
path
.
join
(
ctx
.
config
.
info_dir
(),
ctx
.
const
.
config_installed
)
#config = open(info_path, "w")
installed_pkgs
=
open
(
info_path
)
.
read
()
.
split
()
def
split_name
(
dirname
):
name
,
version
,
release
=
dirname
.
rsplit
(
"-"
,
2
)
#config.write("{}\n".format(nam
e))
if
name
in
installed_pkgs
:
installed_list
.
append
((
name
,
version
+
"-"
+
release
))
installed_list
.
append
((
name
,
version
+
"-"
+
releas
e
))
installed_pkgs
=
open
(
info_path
)
.
read
()
.
split
()
for
i
in
os
.
listdir
(
ctx
.
config
.
packages_dir
())
:
split_name
(
i
)
for
name
in
installed_pkgs
:
split_name
(
name
)
return
dict
(
installed_list
)
@staticmethod
...
...
@@ -423,7 +419,6 @@ class InstallDB(lazydb.LazyDB):
packages
=
self
.
__get_marked_packages
(
_type
)
if
package
not
in
packages
:
packages
.
append
(
package
)
packages
.
sort
()
self
.
__write_marked_packages
(
_type
,
packages
)
def
mark_pending
(
self
,
package
):
...
...
@@ -478,6 +473,7 @@ class InstallDB(lazydb.LazyDB):
config
.
write
(
"{}
\n
"
.
format
(
pkg
))
config
.
close
()
def
__clear_marked_packages
(
self
,
_type
,
package
):
if
package
==
"*"
:
self
.
__write_marked_packages
(
_type
,
[])
...
...
inary/db/packagedb.py
Dosyayı görüntüle @
71782825
...
...
@@ -34,8 +34,8 @@ class PackageDB(lazydb.LazyDB):
def
__init__
(
self
):
lazydb
.
LazyDB
.
__init__
(
self
,
cacheable
=
True
)
#
self.init()
#self.init()
def
init
(
self
):
self
.
__package_nodes
=
{}
# Packages
self
.
__revdeps
=
{}
# Reverse dependencies
...
...
@@ -43,14 +43,12 @@ class PackageDB(lazydb.LazyDB):
self
.
__replaces
=
{}
# Replaces
repodb
=
inary
.
db
.
repodb
.
RepoDB
()
for
repo
in
repodb
.
list_repos
():
doc
=
repodb
.
get_repo_doc
(
repo
)
self
.
__package_nodes
[
repo
]
=
self
.
__generate_packages
(
doc
)
self
.
__revdeps
[
repo
]
=
self
.
__generate_revdeps
(
doc
)
self
.
__obsoletes
[
repo
]
=
self
.
__generate_obsoletes
(
doc
)
self
.
__replaces
[
repo
]
=
self
.
__generate_replaces
(
doc
)
self
.
pdb
=
inary
.
db
.
itembyrepo
.
ItemByRepo
(
self
.
__package_nodes
,
compressed
=
True
)
self
.
rvdb
=
inary
.
db
.
itembyrepo
.
ItemByRepo
(
self
.
__revdeps
)
self
.
odb
=
inary
.
db
.
itembyrepo
.
ItemByRepo
(
self
.
__obsoletes
)
...
...
inary/operations/helper.py
Dosyayı görüntüle @
71782825
...
...
@@ -117,7 +117,6 @@ def calculate_free_space_needed(order):
def
calculate_download_sizes
(
order
):
total_size
=
cached_size
=
0
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
...
...
@@ -205,12 +204,12 @@ def check_config_changes(order, opt=None):
opt
=
"
%03
d"
%
(
int
(
history
.
_get_latest
())
-
1
)
config_changes
=
dict
()
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
ctx
.
config
.
history_dir
(),
opt
)):
return
[]
for
package
in
order
:
all_files
=
in
ary
.
db
.
installdb
.
InstallDB
()
.
get_files
(
package
)
all_files
=
in
stalldb
.
get_files
(
package
)
config_files
=
[
x
for
x
in
all_files
.
list
if
x
.
type
==
'config'
]
config_paths
=
[
"/"
+
str
(
x
.
path
)
for
x
in
config_files
]
...
...
inary/operations/install.py
Dosyayı görüntüle @
71782825
...
...
@@ -56,15 +56,13 @@ def install_pkg_names(A, reinstall=False, extra=False):
if
len
(
A
)
==
0
:
ctx
.
ui
.
info
(
_
(
'No packages to install.'
))
return
True
A
|=
operations
.
upgrade
.
upgrade_base
(
A
)
if
not
ctx
.
config
.
get_option
(
'ignore_dependency'
):
ctx
.
ui
.
info
(
_
(
'Checking dependencies for install...'
),
color
=
"brightpurple"
)
order
=
plan_install_pkg_names
(
A
)
else
:
order
=
list
(
A
)
componentdb
=
inary
.
db
.
componentdb
.
ComponentDB
()
# Bug 4211
...
...
inary/operations/upgrade.py
Dosyayı görüntüle @
71782825
...
...
@@ -354,7 +354,7 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
if
rev_dep
in
G_f
.
vertices
()
or
depinfo
.
satisfied_by_repo
():
continue
if
is_upgradable
(
rev_dep
):
if
is_upgradable
(
rev_dep
,
installdb
,
packagedb
):
Bp
.
add
(
rev_dep
)
G_f
.
add_plain_dep
(
rev_dep
,
pkg
.
name
)
...
...
@@ -368,7 +368,7 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
if
packages
:
for
target_package
in
packages
:
for
name
in
installdb
.
get_rev_dep_names
(
target_package
):
if
name
in
G_f
.
vertices
()
or
not
is_upgradable
(
name
):
if
name
in
G_f
.
vertices
()
or
not
is_upgradable
(
name
,
installdb
,
packagedb
):
continue
Bp
.
add
(
name
)
...
...
@@ -401,6 +401,7 @@ def upgrade_base(A=None):
if
A
is
None
:
A
=
set
()
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
componentdb
=
inary
.
db
.
componentdb
.
ComponentDB
()
if
not
ctx
.
config
.
values
.
general
.
ignore_safety
and
not
ctx
.
get_option
(
'ignore_safety'
):
if
componentdb
.
has_component
(
'system.base'
):
...
...
@@ -414,7 +415,7 @@ def upgrade_base(A=None):
# Will delete G_F and extra_upgrades
install_order
=
operations
.
install
.
plan_install_pkg_names
(
extra_installs
)
extra_upgrades
=
[
x
for
x
in
systembase
-
set
(
install_order
)
if
is_upgradable
(
x
)]
extra_upgrades
=
[
x
for
x
in
systembase
-
set
(
install_order
)
if
is_upgradable
(
x
,
installdb
,
packagedb
)]
upgrade_order
=
[]
extra_upgrades
=
inary
.
blacklist
.
exclude_from
(
extra_upgrades
,
ctx
.
const
.
blacklist
)
...
...
@@ -441,9 +442,7 @@ def upgrade_base(A=None):
ctx
.
ui
.
warning
(
_
(
'Safety switch: The component system.base cannot be found.'
))
return
set
()
def
is_upgradable
(
name
):
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
def
is_upgradable
(
name
,
installdb
,
packagedb
):
if
not
installdb
.
has_package
(
name
):
return
False
...
...
@@ -451,8 +450,6 @@ def is_upgradable(name):
i_release
=
installdb
.
get_release
(
name
)
(
i_distro
,
i_distro_release
)
=
installdb
.
get_distro_release
(
name
)
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
try
:
release
=
packagedb
.
get_release
(
name
,
packagedb
.
which_repo
(
name
))
distro
,
distro_release
=
packagedb
.
get_distro_release
(
name
,
packagedb
.
which_repo
(
name
))
...
...
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