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