code stringlengths 52 7.75k | docs stringlengths 1 5.85k |
|---|---|
def _rmv_deps(self, dependencies, package):
removes = []
dependencies.append(package)
self._check_if_used(dependencies)
for dep in dependencies:
if dep not in self.skip and GetFromInstalled(dep).name():
ver = GetFromInstalled(dep).version()
... | Remove dependencies |
def _rmv_pkg(self, package):
removes = []
if GetFromInstalled(package).name() and package not in self.skip:
ver = GetFromInstalled(package).version()
removes.append(package + ver)
self._removepkg(package)
return removes | Remove one signle package |
def _skip_remove(self):
if "--checklist" not in self.extra:
self.msg.template(78)
print("| Insert packages to exception remove:")
self.msg.template(78)
try:
self.skip = raw_input(" > ").split()
except EOFError:
... | Skip packages from remove |
def _check_if_used(self, removes):
if "--check-deps" in self.extra:
package, dependency, pkg_dep = [], [], []
for pkg in find_package("", self.dep_path):
deps = Utils().read_file(self.dep_path + pkg)
for rmv in removes:
if GetF... | Check package if dependencies for another package
before removed |
def _reference_rmvs(self, removes):
print("")
self.msg.template(78)
msg_pkg = "package"
if len(removes) > 1:
msg_pkg = "packages"
print("| Total {0} {1} removed".format(len(removes), msg_pkg))
self.msg.template(78)
for pkg in removes:
... | Prints all removed packages |
def find(self, flag):
matching, pkg_cache, match_cache = 0, "", ""
print("\nPackages with matching name [ {0}{1}{2} ]\n".format(
self.meta.color["CYAN"], ", ".join(self.binary),
self.meta.color["ENDC"]))
for pkg in self.binary:
for match in find_packa... | Find installed Slackware packages |
def _sizes(self, package):
data = Utils().read_file(self.meta.pkg_path + package)
for line in data.splitlines():
if line.startswith("UNCOMPRESSED PACKAGE SIZE:"):
digit = float((''.join(re.findall(
"[-+]?\d+[\.]?\d*[eE]?[-+]?\d*", line[26:]))))
... | Package size summary |
def display(self):
for pkg in self.binary:
name = GetFromInstalled(pkg).name()
ver = GetFromInstalled(pkg).version()
find = find_package("{0}{1}{2}".format(name, ver, self.meta.sp),
self.meta.pkg_path)
if find:
... | Print the Slackware packages contents |
def package_list(self, repo, name, INDEX, installed):
tty_size = os.popen("stty size", "r").read().split()
row = int(tty_size[0]) - 2
try:
all_installed_names = []
index, page, pkg_list = 0, row, []
r = self.list_lib(repo)
pkg_list = self.... | List with the installed packages |
def _splitting_packages(self, pkg, repo, name):
if name and repo != "sbo":
pkg = split_package(pkg)[0]
elif not name and repo != "sbo":
pkg = pkg[:-4]
return pkg | Return package name from repositories |
def list_greps(self, repo, packages):
pkg_list, pkg_size = [], []
for line in packages.splitlines():
if repo == "sbo":
if line.startswith("SLACKBUILD NAME: "):
pkg_list.append(line[17:].strip())
pkg_size.append("0 K")
... | Grep packages |
def list_lib(self, repo):
packages = ""
if repo == "sbo":
if (os.path.isfile(
self.meta.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(
repo))):
packages = Utils().read_file(self.meta.lib_path + "{0}_repo/"
... | Return package lists |
def list_color_tag(self, pkg):
name = GetFromInstalled(pkg).name()
find = name + self.meta.sp
if pkg.endswith(".txz") or pkg.endswith(".tgz"):
find = pkg[:-4]
if find_package(find, self.meta.pkg_path):
pkg = "{0}{1}{2}".format(self.meta.color["GREEN"], pk... | Tag with color installed packages |
def list_of_installed(self, repo, name):
all_installed_names = []
all_installed_packages = find_package("", self.meta.pkg_path)
for inst in all_installed_packages:
if repo == "sbo" and inst.endswith("_SBo"):
name = split_package(inst)[0]
all_i... | Return installed packages |
def repo_data(PACKAGES_TXT, repo, flag):
(name, location, size, unsize,
rname, rlocation, rsize, runsize) = ([] for i in range(8))
for line in PACKAGES_TXT.splitlines():
if _meta_.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag:
status(0.000005)
if line.startswith(... | Grap data packages |
def rlw_filter(name, location, size, unsize):
arch = _meta_.arch
if arch.startswith("i") and arch.endswith("86"):
arch = "i486"
(fname, flocation, fsize, funsize) = ([] for i in range(4))
for n, l, s, u in zip(name, location, size, unsize):
loc = l.split("/")
if arch == loc[... | Filter rlw repository data |
def alien_filter(name, location, size, unsize):
(fname, flocation, fsize, funsize) = ([] for i in range(4))
for n, l, s, u in zip(name, location, size, unsize):
if "slackbuilds" != l:
fname.append(n)
flocation.append(l)
fsize.append(s)
funsize.append(... | Fix to avoid packages include in slackbuilds folder |
def rested_filter(name, location, size, unsize):
ver = slack_ver()
if _meta_.slack_rel == "current":
ver = "current"
path_pkg = "pkg"
if _meta_.arch == "x86_64":
path_pkg = "pkg64"
(fname, flocation, fsize, funsize) = ([] for i in range(4))
for n, l, s, u in zip(name, locati... | Filter Alien"s repository data |
def get_deps(self):
if self.repo == "rlw":
dependencies = {}
rlw_deps = Utils().read_file(_meta_.conf_path + "rlworkman.deps")
for line in rlw_deps.splitlines():
if line and not line.startswith("#"):
pkgs = line.split(":")
... | Grap package requirements from repositories |
def _req_fix(self, line):
deps = []
for dep in line[18:].strip().split(","):
dep = dep.split("|")
if self.repo == "slacky":
if len(dep) > 1:
for d in dep:
deps.append(d.split()[0])
dep = "".join(... | Fix slacky and salix requirements because many dependencies splitting
with "," and others with "|" |
def run(self):
self.find_new()
for n in self.news:
print("{0}".format(n))
print("")
self.msg.template(78)
print("| Installed {0} new configuration files:".format(
len(self.news)))
self.msg.template(78)
self.choices() | print .new configuration files |
def find_new(self):
print("\nSearch for .new configuration files:\n")
for path, dirs, files in os.walk(self.etc):
del dirs # delete unsed
for f in files:
if f.endswith(".new"):
self.news.append(os.path.join(path, f))
if not ... | Find all '.new' files from /etc/ folder
and subfolders |
def choices(self):
print("| {0}K{1}{2}eep the old and .new files, no changes".format(
self.red, self.endc, self.br))
print("| {0}O{1}{2}verwrite all old configuration files with new "
"ones".format(self.red, self.endc, self.br))
print("| The old files will be ... | Menu options for new configuration files |
def prompt(self):
self.msg.template(78)
print("| Choose what to do file by file:")
print("| {0}K{1}{2}eep, {3}O{4}{5}verwrite, {6}R{7}{8}emove, "
"{9}D{10}{11}iff, {12}M{13}{14}erge, {15}Q{16}{17}uit".format(
self.red, self.endc, self.br, self.red, self.e... | Select file |
def question(self, n):
print("")
prompt_ask = raw_input("{0} [K/O/R/D/M/Q]? ".format(n))
print("")
if prompt_ask in ("K", "k"):
self.keep()
elif prompt_ask in ("O", "o"):
self._overwrite(n)
elif prompt_ask in ("R", "r"):
self._... | Choose what do to file by file |
def _remove(self, n):
if os.path.isfile(n):
os.remove(n)
if not os.path.isfile(n):
print("File '{0}' removed".format(n)) | Remove one single file |
def _overwrite(self, n):
if os.path.isfile(n[:-4]):
shutil.copy2(n[:-4], n[:-4] + ".old")
print("Old file {0} saved as {1}.old".format(
n[:-4].split("/")[-1], n[:-4].split("/")[-1]))
if os.path.isfile(n):
shutil.move(n, n[:-4])
pri... | Overwrite old file with new and keep file with suffix .old |
def diff(self, n):
if os.path.isfile(n[:-4]):
diff1 = Utils().read_file(n[:-4]).splitlines()
if os.path.isfile(n):
diff2 = Utils().read_file(n).splitlines()
lines, l, c = [], 0, 0
for a, b in itertools.izip_longest(diff1, diff2):
l += 1
... | Print the differences between the two files |
def merge(self, n):
if os.path.isfile(n[:-4]):
old = Utils().read_file(n[:-4]).splitlines()
if os.path.isfile(n):
new = Utils().read_file(n).splitlines()
with open(n[:-4], "w") as out:
for l1, l2 in itertools.izip_longest(old, new):
if... | Merge new file into old |
def status_bar(self):
print("")
self.msg.template(78)
print("| Repository Status")
self.msg.template(78) | Top view bar status |
def run(self):
if (self.repo in self.meta.default_repositories and
self.repo in self.meta.repositories):
try:
self.check = self.all_repos[self.repo]()
except OSError:
usage(self.repo)
raise SystemExit()
elif... | Run and check if new in ChangeLog.txt |
def status(self):
self.count_repo += 1
if self.check == 1:
self.count_news += 1
self.st = "{0}News in ChangeLog.txt{1}".format(
self.meta.color["GREEN"], self.meta.color["ENDC"])
elif self.check == 0:
self.st = "No changes in ChangeLog... | Set messages |
def print_status(self, repo):
print(" {0}{1}{2}".format(repo, " " * (19 - len(repo)), self.st)) | Print status |
def summary(self):
print("\nSummary")
print("=" * 79)
cmd = "All repositories are updated."
if self.count_repo == 1:
cmd = "Repository is updated."
if self.count_news > 0:
cmd = "Run the command 'slpkg update'."
print("{0}From {1} reposito... | Print summary |
def md5(source):
# fix passing char '+' from source
source = source.replace("%2B", "+")
with open(source) as file_to_check:
data = file_to_check.read()
return hashlib.md5(data).hexdigest() | Return MD5 Checksum |
def repositories(self):
if self.repo == "sbo":
self.sbo_case_insensitive()
self.find_pkg = sbo_search_pkg(self.name)
if self.find_pkg:
self.dependencies_list = Requires(self.flag).sbo(self.name)
else:
PACKAGES_TXT = Utils().read_fi... | Get dependencies by repositories |
def sbo_case_insensitive(self):
if "--case-ins" in self.flag:
data = SBoGrep(name="").names()
data_dict = Utils().case_sensitive(data)
for key, value in data_dict.iteritems():
if key == self.name.lower():
self.name = value | Matching packages distinguish between uppercase and
lowercase for sbo repository |
def bin_case_insensitive(self):
if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.names)
for key, value in data_dict.iteritems():
if key == self.name.lower():
self.name = value | Matching packages distinguish between uppercase and
lowercase |
def check_used(self, pkg):
used = []
dep_path = self.meta.log_path + "dep/"
logs = find_package("", dep_path)
for log in logs:
deps = Utils().read_file(dep_path + log)
for dep in deps.splitlines():
if pkg == dep:
used.a... | Check if dependencies used |
def deps_tree(self):
dependencies = self.dependencies + [self.name]
if self.repo == "sbo":
for dep in dependencies:
deps = Requires(flag="").sbo(dep)
if dep not in self.deps_dict.values():
self.deps_dict[dep] = Utils().dimensional_... | Package dependencies image map file |
def deps_used(self, pkg, used):
if find_package(pkg + self.meta.sp, self.meta.pkg_path):
if pkg not in self.deps_dict.values():
self.deps_dict[pkg] = used
else:
self.deps_dict[pkg] += used | Create dependencies dictionary |
def version(self):
if self.find:
return self.meta.sp + split_package(self.find)[1]
return "" | Return version from installed packages |
def if_all_installed(self):
count_inst = 0
for inst in (self.dep_install + self.install):
if (os.path.isfile(self.meta.pkg_path + inst[:-4]) and
"--download-only" not in self.flag):
count_inst += 1
if (count_inst == len(self.dep_install + ... | Check if all packages is already installed |
def case_insensitive(self):
if "--case-ins" in self.flag:
data = []
data = Utils().package_name(self.PACKAGES_TXT)
data_dict = Utils().case_sensitive(data)
for pkg in self.packages:
index = self.packages.index(pkg)
for key,... | Matching packages distinguish between uppercase and
lowercase |
def update_deps(self):
for dep in self.dependencies:
deps = Utils().dimensional_list(Dependencies(
self.repo, self.blacklist).binary(
dep, self.flag))
self.deps_dict[dep] = deps | Update dependencies dictionary with all package |
def clear_masters(self):
packages = []
for mas in Utils().remove_dbs(self.packages):
if mas not in self.dependencies:
packages.append(mas)
self.packages = packages | Clear master packages if already exist in dependencies
or if added to install two or more times |
def install_packages(self):
installs, upgraded = [], []
for inst in (self.dep_install + self.install):
package = (self.tmp_path + inst).split()
pkg_ver = "{0}-{1}".format(split_package(inst)[0],
split_package(inst)[1])
s... | Install or upgrade packages |
def not_downgrade(self, package):
name = split_package(package)[0]
rep_ver = split_package(package)[1]
ins_ver = GetFromInstalled(name).version()[1:]
if not ins_ver:
ins_ver = "0"
if LooseVersion(rep_ver) < LooseVersion(ins_ver):
self.msg.template... | Don't downgrade packages if repository version is lower than
installed |
def checksums(self, install):
check_md5(pkg_checksum(install, self.repo), self.tmp_path + install) | Checksums before install |
def resolving_deps(self):
requires = []
if (self.meta.rsl_deps in ["on", "ON"] and
self.flag != "--resolve-off"):
self.msg.resolving()
for dep in self.packages:
status(0.05)
dependencies = []
dependencies = Utils().dimensio... | Return package dependencies |
def _fix_deps_repos(self, dependencies):
requires = []
for dep in dependencies:
if dep in self.repo_pkg_names:
requires.append(dep)
return requires | Fix store deps include in repository |
def views(self, install, comp_sum):
pkg_sum = uni_sum = upg_sum = 0
# fix repositories align
repo = self.repo + (" " * (6 - (len(self.repo))))
for pkg, comp in zip(install, comp_sum):
pkg_repo = split_package(pkg[:-4])
if find_package(pkg[:-4], self.meta.... | Views packages |
def top_view(self):
self.msg.template(78)
print("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}".format(
"| Package", " " * 17,
"New Version", " " * 8,
"Arch", " " * 4,
"Build", " " * 2,
"Repos", " " * 10,
"Size"))
self.msg.tem... | Print packages status bar |
def store(self, packages):
dwn, install, comp_sum, uncomp_sum = ([] for i in range(4))
# name = data[0]
# location = data[1]
# size = data[2]
# unsize = data[3]
for pkg in packages:
for pk, loc, comp, uncomp in zip(self.data[0], self.data[1],
... | Store and return packages for install |
def patches(self, dwn, install, comp_sum, uncomp_sum):
dwnp, installp, comp_sump, uncomp_sump = ([] for i in range(4))
for d, i, c, u in zip(dwn, install, comp_sum, uncomp_sum):
if "_slack" + slack_ver() in i:
dwnp.append(d)
dwn.remove(d)
... | Seperates packages from patches/ directory |
def pkg_checksum(binary, repo):
md5 = "None"
if repo == "slack_patches" and _meta_.slack_rel == "stable":
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
elif repo == "slack_patches" and _meta_.slack_rel == "current":
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", ""))... | Return checksum from CHECKSUMS.md5 file by repository |
def library(repo):
pkg_list, packages = [], ""
if repo == "sbo":
if (os.path.isfile(
_meta_.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(repo))):
packages = Utils().read_file(_meta_.lib_path + "{0}_repo/"
"SLACKBUILDS.TXT".format(... | Load packages from slpkg library and from local |
def info(self, name, sbo_file):
return URL(self.sbo_url + name + sbo_file).reading() | Read info file |
def slackbuild(self, name, sbo_file):
return URL(self.sbo_url + name + sbo_file).reading() | Read SlackBuild file |
def run(self):
self.files_exist()
self.info_file()
sources = self.sources
if len(sources) > 1 and self.sbo_sources != sources:
sources = self.sbo_sources
# If the list does not have the same order use from .info
# order.
BuildPackage(self.scri... | Build package and fix ordelist per checksum |
def info_file(self):
sources = SBoGrep(self.prgnam).source().split()
for source in sources:
self.sbo_sources.append(source.split("/")[-1]) | Grab sources from .info file and store filename |
def files_exist(self):
if not os.path.isfile(self.path + self.script):
print("\nslpkg: Error: SlackBuild archive.tar.gz not found\n")
raise SystemExit()
for src in self.sources:
if not os.path.isfile(self.path + src):
print("\nslpkg: Error: So... | Check if SlackBuild archive.tar.gz and sources exist |
def help_version(self):
if (len(self.args) == 1 and self.args[0] in ["-h", "--help"] and
self.args[1:] == []):
options()
elif (len(self.args) == 1 and self.args[0] in ["-v", "--version"] and
self.args[1:] == []):
prog_version()
els... | Help and version info |
def command_update(self):
if len(self.args) == 1 and self.args[0] == "update":
Update().repository(only="")
elif (len(self.args) == 2 and self.args[0] == "update" and
self.args[1].startswith("--only=")):
repos = self.args[1].split("=")[-1].split(",")
... | Update package lists repositories |
def command_repo_enable(self):
if len(self.args) == 1 and self.args[0] == "repo-enable":
RepoEnable().choose()
else:
usage("") | Repositories enable/disable |
def command_repo_list(self):
if len(self.args) == 1 and self.args[0] == "repo-list":
RepoList().repos()
else:
usage("") | Repositories list |
def command_repo_add(self):
if len(self.args) == 3 and self.args[0] == "repo-add":
Repo().add(self.args[1], self.args[2])
else:
usage("") | Add custom repositories |
def command_repo_remove(self):
if len(self.args) == 2 and self.args[0] == "repo-remove":
Repo().remove(self.args[1])
else:
usage("") | Remove custom repositories |
def command_upgrade(self):
if len(self.args) == 1 and self.args[0] == "upgrade":
Initialization(False).upgrade(only="")
elif (len(self.args) == 2 and self.args[0] == "upgrade" and
self.args[1].startswith("--only=")):
repos = self.args[1].split("=")[-1].sp... | Recreate repositories package lists |
def command_repo_info(self):
if (len(self.args) == 2 and self.args[0] == "repo-info" and
self.args[1] in RepoList().all_repos):
del RepoList().all_repos
RepoInfo().view(self.args[1])
elif (len(self.args) > 1 and self.args[0] == "repo-info" and
... | Repositories informations |
def command_health(self):
if len(self.args) == 1 and self.args[0] == "health":
PackageHealth(mode="").test()
elif (len(self.args) == 2 and self.args[0] == "health" and
self.args[1] == "--silent"):
PackageHealth(mode=self.args[1]).test()
else:
... | Check package health |
def command_deps_status(self):
image = ""
for arg in self.args:
if arg.startswith("--graph="):
image = arg.split("=")[1]
if len(self.args) == 1 and self.args[0] == "deps-status":
DependenciesStatus(image).show()
elif len(self.args) == 2 an... | Print dependencies status |
def command_new_config(self):
if len(self.args) == 1 and self.args[0] == "new-config":
NewConfig().run()
else:
usage("") | Manage .new configuration files |
def auto_build(self):
options = [
"-a",
"--autobuild"
]
if len(self.args) >= 3 and self.args[0] in options:
AutoBuild(self.args[1], self.args[2:], self.meta.path).run()
else:
usage("") | Auto built tool |
def pkg_list(self):
options = [
"-l",
"--list"
]
flag = ["--index", "--installed", "--name"]
name = INDEX = installed = False
for arg in self.args[2:]:
if flag[0] == arg:
INDEX = True
if flag[1] in arg:
... | List of packages by repository |
def pkg_upgrade(self):
options = [
"-c",
"--check"
]
flags = [
"--upgrade",
"--skip=",
"--resolve-off",
"--checklist",
"--rebuild"
]
flag, skip = self.__pkg_upgrade_flags(flags)
i... | Check and upgrade packages by repository |
def __pkg_upgrade_flags(self, flags):
flag, skip = [], ""
if flags[0] in self.args:
for arg in self.args[3:]:
if arg.startswith(flags[1]):
skip = Regex(arg.split("=")[1]).get()
self.args.remove(arg)
if arg in fl... | Manage flags for package upgrade option |
def pkg_install(self):
flag = []
options = [
"-s",
"--sync"
]
additional_options = [
"--resolve-off",
"--download-only",
"--directory-prefix=",
"--case-ins",
"--rebuild",
"--reinstall... | Install packages by repository |
def pkg_tracking(self):
flag = []
options = [
"-t",
"--tracking"
]
additional_options = [
"--check-deps",
"--graph=",
"--case-ins"
]
for arg in self.args[2:]:
if arg.startswith(additional_opt... | Tracking package dependencies |
def sbo_network(self):
flag = []
options = [
"-n",
"--network"
]
additional_options = [
"--checklist",
"--case-ins"
]
for add in additional_options:
if add in self.args:
flag.append(add)
... | View slackbuilds packages |
def pkg_blacklist(self):
blacklist = BlackList()
options = [
"-b",
"--blacklist"
]
flag = [
"--add",
"--remove"
]
command = ["list"]
if (len(self.args) == 2 and self.args[0] in options and
se... | Manage blacklist packages |
def pkg_queue(self):
queue = QueuePkgs()
options = [
"-q",
"--queue"
]
flag = [
"--add",
"--remove"
]
command = [
"list",
"build",
"install",
"build-install"
]... | Manage packages in queue |
def bin_install(self):
packages = self.args[1:]
options = [
"-i",
"--installpkg"
]
flag = ""
flags = [
"--warn",
"--md5sum",
"--root",
"--infobox",
"--menu",
"--terse",
... | Install Slackware binary packages |
def bin_upgrade(self):
packages = self.args[1:]
options = [
"-u",
"--upgradepkg"
]
flag = ""
flags = [
"--dry-run",
"--install-new",
"--reinstall",
"--verbose"
]
if len(self.args) > 1... | Install-upgrade Slackware binary packages |
def bin_remove(self):
packages = self.args[1:]
options = [
"-r",
"--removepkg"
]
additional_options = [
"--deps",
"--check-deps",
"--tag",
"--checklist"
]
flag, extra = "", []
flags =... | Remove Slackware packages |
def bin_find(self):
flag = []
options = [
"-f",
"--find"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(arg)
self.args.remove(arg)
packages ... | Find installed packages |
def pkg_desc(self):
options = [
"-p",
"--desc"
]
flag = ["--color="]
colors = [
"red",
"green",
"yellow",
"cyan",
"grey"
]
tag = ""
for arg in self.args:
if ar... | Print slack-desc by repository |
def pkg_find(self):
flag = []
options = [
"-F",
"--FIND"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(arg)
self.args.remove(arg)
packages ... | Find packages from all enabled repositories |
def pkg_contents(self):
packages = self.args[1:]
options = [
"-d",
"--display"
]
if len(self.args) > 1 and self.args[0] in options:
PackageManager(packages).display()
else:
usage("") | Print packages contents |
def congiguration(self):
options = [
"-g",
"--config"
]
command = [
"print",
"edit",
"reset"
]
conf = Config()
if (len(self.args) == 2 and self.args[0] in options and
self.args[1] == comm... | Manage slpkg configuration file |
def auto_detect(self, args):
suffixes = [
".tgz",
".txz",
".tbz",
".tlz"
]
if (not args[0].startswith("-") and args[0] not in self.commands and
args[0].endswith(tuple(suffixes))):
packages, not_found = [], []
... | Check for already Slackware binary packages exist |
def search_pkg(name, repo):
PACKAGES_TXT = Utils().read_file(_meta_.lib_path + "{0}_repo/"
"PACKAGES.TXT".format(repo))
names = Utils().package_name(PACKAGES_TXT)
blacklist = BlackList().packages(pkgs=names, repo=repo)
for line in PACKAGES_TXT.splitlines():
... | Search if package exists in PACKAGES.TXT file
and return the name. |
def data(self):
for pkg in self.installed:
if os.path.isfile(self.meta.pkg_path + pkg):
name = split_package(pkg)[0]
for log in self.logs:
deps = Utils().read_file(self.dep_path + log)
for dep in deps.splitlines():
... | Check all installed packages and create
dictionary database |
def count_packages(self):
packages = []
for pkg in self.dmap.values():
packages += pkg
self.count_dep += 1
self.count_pkg = len(set(packages)) | Count dependencies and packages |
def show(self):
self.data()
print("")
self.msg.template(78)
print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
self.msg.template(78)
for key, value in self.dmap.iteritems():
print(" {0}{1}{2}{3}{4}".format(
self.green, ... | Show dependencies status |
def tree(self):
self.msg.template(78)
print("| Dependencies\n"
"| -- Packages")
self.msg.template(78)
self.data()
for pkg, dep in self.dmap.iteritems():
print("+ {0}{1}{2}".format(self.green, pkg, self.endc))
print("|")
f... | Like tree view mode |
def summary(self):
print("\nStatus summary")
print("=" * 79)
print("{0}found {1} dependencies in {2} packages.{3}\n".format(
self.grey, self.count_dep, self.count_pkg, self.endc)) | Summary by packages and dependencies |
def find(self, pkg, flag):
print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
self.cyan, ", ".join(pkg), self.endc))
Msg().template(78)
print("| {0} {1}{2}{3}".format("Repository", "Package", " " * 54,
"Size"))
Msg(... | Start to find packages and print |
def sbo_version(self, repo, find):
ver = ""
if repo == "sbo":
ver = "-" + SBoGrep(find).version()
return ver | Add version to SBo packages |
def slack_ver():
if _meta_.slackware_version in ["off", "OFF"]:
sv = Utils().read_file("/etc/slackware-version")
version = re.findall(r"\d+", sv)
if len(sv) > 2:
return (".".join(version[:2]))
else:
return (".".join(version))
else:
return _me... | Open file and read Slackware version |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.