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
20b68f6b
Kaydet (Commit)
20b68f6b
authored
Agu 08, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rebuild-DB için api çağırılmayacak
Fonksiyon api içinden filesdb içine taşındı.
üst
2b097d7e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
33 deletions
+30
-33
shelltools.py
inary/actionsapi/shelltools.py
+0
-3
api.py
inary/api.py
+1
-21
__init__.py
inary/cli/__init__.py
+1
-1
addrepo.py
inary/cli/addrepo.py
+4
-1
listupgrades.py
inary/cli/listupgrades.py
+0
-1
rebuilddb.py
inary/cli/rebuilddb.py
+2
-2
filesdb.py
inary/db/filesdb.py
+20
-0
file.py
inary/file.py
+1
-1
install.py
inary/operations/install.py
+0
-2
search.py
inary/operations/search.py
+1
-1
No files found.
inary/actionsapi/shelltools.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -272,9 +272,6 @@ def dirName(filePath):
"""return the directory name of pathname path"""
return
os
.
path
.
dirname
(
filePath
)
##FIXME:there are an important error in here please##
## fix here tomorrow (don't forget) ##
def
system
(
command
):
# command an list but should be an str
sys
.
stdout
.
write
(
command
+
"
\n
"
)
...
...
inary/api.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -148,30 +148,10 @@ def set_options(options):
ctx
.
config
.
set_options
(
options
)
# FIXME: rebuild_db is only here for filesdb and it really is ugly. we should not need any rebuild.
@inary.util.locked
def
rebuild_db
():
# save parameters and shutdown inary
options
=
ctx
.
config
.
options
ui
=
ctx
.
ui
scom
=
ctx
.
scom
from
inary
import
_cleanup
_cleanup
()
ctx
.
filesdb
.
close
()
ctx
.
filesdb
.
destroy
()
ctx
.
filesdb
=
inary
.
db
.
filesdb
.
FilesDB
()
ctx
.
filesdb
.
update
()
# reinitialize everything
ctx
.
ui
=
ui
ctx
.
config
.
set_options
(
options
)
ctx
.
scom
=
scom
# The following are INARY operations which constitute the INARY API
# Within functions
from
inary.analyzer.conflict
import
calculate_conflicts
from
inary.db.filesdb
import
rebuild_db
from
inary.data.index
import
index
from
inary.data.pgraph
import
package_graph
from
inary.fetcher
import
fetch
...
...
inary/cli/__init__.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -62,7 +62,7 @@ class CLI(inary.ui.UI):
def
output
(
self
,
msg
,
err
=
False
,
verbose
=
False
):
if
(
verbose
and
self
.
show_verbose
)
or
(
not
verbose
):
if
isinstance
(
type
(
msg
),
type
(
bytes
)
):
if
isinstance
(
msg
,
bytes
):
msg
=
msg
.
decode
(
'utf-8'
)
if
err
:
sys
.
stderr
.
write
(
str
(
msg
))
...
...
inary/cli/addrepo.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -72,8 +72,11 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
'checking the distribution of the repository.
\n
'
'Do you want to continue?'
)
.
format
(
name
)):
return
if
indexuri
.
endswith
(
".xml.xz"
)
or
indexuri
.
endswith
(
".xml"
):
repository
.
add_repo
(
name
,
indexuri
,
ctx
.
get_option
(
'at'
))
else
:
raise
Exception
(
_
(
"Extension of URI must be
\"
.xml.xz
\"
or
\"
.xml
\"
"
))
repository
.
add_repo
(
name
,
indexuri
,
ctx
.
get_option
(
'at'
))
else
:
self
.
help
()
...
...
inary/cli/listupgrades.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -66,7 +66,6 @@ Lists the packages that will be upgraded.
component
=
ctx
.
get_option
(
'component'
)
if
component
:
# FIXME: INARY api is insufficient to do this
component_pkgs
=
self
.
componentdb
.
get_union_packages
(
component
,
walk
=
True
)
upgradable_pkgs
=
list
(
set
(
upgradable_pkgs
)
&
set
(
component_pkgs
))
...
...
inary/cli/rebuilddb.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -21,7 +21,7 @@ _ = __trans.gettext
import
inary.cli.command
as
command
import
inary.context
as
ctx
import
inary.
api
import
inary.
db.filesdb
class
RebuildDb
(
command
.
Command
,
metaclass
=
command
.
autocommand
):
...
...
@@ -51,4 +51,4 @@ dirs under /var/lib/inary
def
run
(
self
):
self
.
init
(
database
=
True
)
if
ctx
.
ui
.
confirm
(
str
(
_
(
'Rebuild INARY databases?'
))):
inary
.
api
.
rebuild_db
()
inary
.
db
.
filesdb
.
rebuild_db
()
inary/db/filesdb.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -18,6 +18,7 @@ import shelve
import
inary.context
as
ctx
import
inary.db
import
inary.db.lazydb
as
lazydb
import
inary.util
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
...
...
@@ -119,3 +120,22 @@ class FilesDB(lazydb.LazyDB):
files_db
=
os
.
path
.
join
(
ctx
.
config
.
info_dir
(),
ctx
.
const
.
files_db
)
os
.
remove
(
files_db
)
self
.
__check_filesdb
()
@inary.util.locked
def
rebuild_db
():
# save parameters and shutdown inary
options
=
ctx
.
config
.
options
ui
=
ctx
.
ui
scom
=
ctx
.
scom
from
inary
import
_cleanup
_cleanup
()
ctx
.
filesdb
.
close
()
ctx
.
filesdb
.
destroy
()
ctx
.
filesdb
=
inary
.
db
.
filesdb
.
FilesDB
()
ctx
.
filesdb
.
update
()
# reinitialize everything
ctx
.
ui
=
ui
ctx
.
config
.
set_options
(
options
)
ctx
.
scom
=
scom
inary/file.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -54,7 +54,7 @@ class Error(inary.errors.Error):
class
InvalidSignature
(
inary
.
errors
.
Error
):
def
__init__
(
self
,
url
):
inary
.
errors
.
Exception
.
__init__
(
self
,
_
(
" invalid for {}"
)
.
format
(
url
))
inary
.
errors
.
Exception
.
__init__
(
self
,
_
(
"
GPG Signature is
invalid for {}"
)
.
format
(
url
))
self
.
url
=
url
...
...
inary/operations/install.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -38,8 +38,6 @@ def install_pkg_names(A, reinstall=False, extra=False):
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
A
=
[
str
(
x
)
for
x
in
A
]
# FIXME: why do we still get unicode input here? :/
# A was a list, remove duplicates
A_0
=
A
=
set
(
A
)
...
...
inary/operations/search.py
Dosyayı görüntüle @
20b68f6b
...
...
@@ -79,6 +79,6 @@ def search_file(term):
>>> [("kvm", (["lib/modules/2.6.18.8-86/extra/kvm-amd.ko","lib/modules/2.6.18.8-86/extra/kvm-intel.ko"])),]
"""
if
term
.
startswith
(
"/"
):
# FIXME: why? why?
if
term
.
startswith
(
"/"
):
term
=
term
[
1
:]
return
ctx
.
filesdb
.
search_file
(
term
)
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