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)
0
Konular (issue)
0
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
529d7a21
Kaydet (Commit)
529d7a21
authored
Haz 07, 2006
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* improve check command a little, check installed packages by default
üst
44807cc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
api.py
pisi/api.py
+1
-1
commands.py
pisi/cli/commands.py
+12
-7
No files found.
pisi/api.py
Dosyayı görüntüle @
529d7a21
...
...
@@ -317,7 +317,7 @@ def check(package):
for
file
in
files
.
list
:
if
file
.
hash
and
file
.
type
!=
"config"
\
and
not
os
.
path
.
islink
(
'/'
+
file
.
path
):
ctx
.
ui
.
info
(
_
(
"Checking
%
s
..."
)
%
file
.
path
,
noln
=
Fals
e
,
verbose
=
True
)
ctx
.
ui
.
info
(
_
(
"Checking
%
s
"
)
%
file
.
path
,
noln
=
Tru
e
,
verbose
=
True
)
if
file
.
hash
!=
util
.
sha1_file
(
'/'
+
file
.
path
):
corrupt
.
append
(
file
)
ctx
.
ui
.
info
(
"Corrupt file:
%
s"
%
file
)
...
...
pisi/cli/commands.py
Dosyayı görüntüle @
529d7a21
...
...
@@ -733,13 +733,15 @@ Usage: info <package1> <package2> ... <packagen>
class
Check
(
Command
):
"""Verify installation
Usage: check
<package1> <package2> ... <packagen>
Usage: check
[<package1> <package2> ... <packagen>]
<packagei>: package name
A cryptographic checksum is stored for each installed
file. Check command uses the checksums to verify a package.
Just give the names of packages.
If no packages are given, checks all installed packages.
"""
__metaclass__
=
autocommand
...
...
@@ -749,14 +751,17 @@ Just give the names of packages.
name
=
(
"check"
,
None
)
def
run
(
self
):
if
not
self
.
args
:
self
.
help
()
return
self
.
init
(
database
=
True
,
write
=
False
)
for
pkg
in
self
.
args
:
if
self
.
args
:
pkgs
=
self
.
args
else
:
ctx
.
ui
.
info
(
_
(
'Checking all installed packages'
))
pkgs
=
ctx
.
installdb
.
list_installed
()
for
pkg
in
pkgs
:
if
ctx
.
installdb
.
is_installed
(
pkg
):
pisi
.
api
.
check
(
pkg
)
corrupt
=
pisi
.
api
.
check
(
pkg
)
if
corrupt
:
ctx
.
ui
.
info
(
_
(
'Package
%
s is corrupt.'
)
%
pkg
)
else
:
ctx
.
ui
.
info
(
_
(
'Package
%
s not installed'
)
%
pkg
)
self
.
finalize
()
...
...
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