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
1fe8e56c
Kaydet (Commit)
1fe8e56c
authored
Eyl 06, 2020
tarafından
Your Name
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix inary cr
üst
a94f7c51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
2 deletions
+97
-2
checkrelation.py
inary/cli/checkrelation.py
+2
-2
checkrelation.py~
inary/cli/checkrelation.py~
+94
-0
files.py
inary/util/files.py
+1
-0
No files found.
inary/cli/checkrelation.py
Dosyayı görüntüle @
1fe8e56c
...
...
@@ -74,7 +74,7 @@ Usage: check-relation
for
pkg
in
installed
:
for
p
in
self
.
installdb
.
get_package
(
pkg
)
.
runtimeDependencies
():
sys
.
stderr
.
write
(
_
(
"Checking: {}"
)
.
format
(
p
)
+
"
\r
"
)
sys
.
stderr
.
write
(
"
\x1b
[K"
+
_
(
"Checking: {}"
)
.
format
(
p
)
+
"
\r
"
)
if
not
self
.
installdb
.
has_package
(
str
(
p
.
package
)):
need_reinstall
.
append
(
p
.
package
)
sys
.
stderr
.
write
(
...
...
@@ -85,7 +85,7 @@ Usage: check-relation
for
pkg
in
installed
:
pkgname
=
pkg
files
=
self
.
installdb
.
get_files
(
pkg
)
sys
.
stderr
.
write
(
_
(
"Checking: {}"
)
.
format
(
pkg
)
+
"
\r
"
)
sys
.
stderr
.
write
(
"
\x1b
[K"
+
_
(
"Checking: {}"
)
.
format
(
pkg
)
+
"
\r
"
)
for
f
in
files
.
list
:
if
not
os
.
path
.
exists
(
"/"
+
f
.
path
):
need_reinstall
.
append
(
pkg
)
...
...
inary/cli/checkrelation.py~
0 → 100644
Dosyayı görüntüle @
1fe8e56c
# -*- coding:utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2020, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import os
import sys
import inary.db
import inary.util as util
import inary.context as ctx
import inary.cli.command as command
import optparse
# Gettext Library
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
class CheckRelation(command.Command, metaclass=command.autocommand):
__doc__ = _("""Check packages and system relations
Usage: check-relation
""")
def __init__(self, args):
super(CheckRelation, self).__init__(args)
self.installdb = inary.db.installdb.InstallDB()
self.componentdb = inary.db.componentdb.ComponentDB()
name = ("check-relation", "cr")
def options(self):
group = optparse.OptionGroup(self.parser, _("list-installed options"))
group.add_option("-f", "--force", action="store_true",
default=False, help=_("Deep scan mode"))
self.parser.add_option_group(group)
def fix_reinstall(self, need_reinstall):
need_reinstall = util.unique_list(need_reinstall)
if len(need_reinstall) > 0:
sys.stderr.write(
_("This packages broken and need to reinstall.")+"\n\n")
for pkg in need_reinstall:
sys.stderr.write("{} ".format(pkg))
from inary.operations import install
ctx.set_option("ignore_dependency", True)
install.install(need_reinstall, reinstall=True)
sys.stderr.write("\n")
def run(self):
self.init(database=True, write=False)
installed = self.installdb.list_installed()
component = ctx.get_option('component')
if component:
component_pkgs = self.componentdb.get_union_packages(
component, walk=True)
installed = list(set(installed) & set(component_pkgs))
installed.sort()
need_reinstall = []
for pkg in installed:
for p in self.installdb.get_package(pkg).runtimeDependencies():
sys.stderr.write("\x1b[K"+_("Checking: {}").format(p)+"\r")
if not self.installdb.has_package(str(p.package)):
need_reinstall.append(p.package)
sys.stderr.write(
_("Missing: - {}").format(p.package)+"\n")
self.fix_reinstall(need_reinstall)
if self.options.force:
for pkg in installed:
pkgname = pkg
files = self.installdb.get_files(pkg)
sys.stderr.write("\x1b[K"+_("Checking: {}").format(pkg)+"\r")
for f in files.list:
if not os.path.exists("/"+f.path):
need_reinstall.append(pkg)
sys.stderr.write(
_("Missing: /{} - {}").format(f.path, pkg)+"\n")
self.fix_reinstall(need_reinstall)
inary/util/files.py
Dosyayı görüntüle @
1fe8e56c
...
...
@@ -17,6 +17,7 @@
from
inary.errors
import
FileError
,
FilePermissionDeniedError
,
Error
from
inary.util.strings
import
remove_prefix
from
inary.util.process
import
run_batch
from
inary.util.path
import
join_path
import
fnmatch
import
hashlib
import
shutil
...
...
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