code string | signature string | docstring string | loss_without_docstring float64 | loss_with_docstring float64 | factor float64 |
|---|---|---|---|---|---|
check_md5(pkg_checksum(install, self.repo), self.tmp_path + install) | def checksums(self, install) | Checksums before install | 20.484859 | 18.390093 | 1.113907 |
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().dimensional_list(Dependencies(
... | def resolving_deps(self) | Return package dependencies | 16.242922 | 15.03619 | 1.080255 |
requires = []
for dep in dependencies:
if dep in self.repo_pkg_names:
requires.append(dep)
return requires | def _fix_deps_repos(self, dependencies) | Fix store deps include in repository | 5.094503 | 4.209036 | 1.210373 |
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.pkg_path):
pkg_sum +... | def views(self, install, comp_sum) | Views packages | 3.771507 | 3.719879 | 1.013879 |
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.template(78) | def top_view(self) | Print packages status bar | 5.311376 | 4.601352 | 1.154308 |
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],
... | def store(self, packages) | Store and return packages for install | 2.58974 | 2.544326 | 1.017849 |
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)
installp.append(i)
install.remove(i... | def patches(self, dwn, install, comp_sum, uncomp_sum) | Seperates packages from patches/ directory | 2.676635 | 2.551698 | 1.048962 |
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", "")).reading()
elif repo == "slp... | def pkg_checksum(binary, repo) | Return checksum from CHECKSUMS.md5 file by repository | 4.419917 | 4.072096 | 1.085416 |
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(repo))
else:
... | def library(repo) | Load packages from slpkg library and from local | 3.080245 | 3.084007 | 0.99878 |
return URL(self.sbo_url + name + sbo_file).reading() | def info(self, name, sbo_file) | Read info file | 19.758808 | 18.253471 | 1.082469 |
return URL(self.sbo_url + name + sbo_file).reading() | def slackbuild(self, name, sbo_file) | Read SlackBuild file | 19.05665 | 16.780773 | 1.135624 |
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.script, sources, se... | def run(self) | Build package and fix ordelist per checksum | 14.387447 | 12.734792 | 1.129775 |
sources = SBoGrep(self.prgnam).source().split()
for source in sources:
self.sbo_sources.append(source.split("/")[-1]) | def info_file(self) | Grab sources from .info file and store filename | 24.317396 | 16.552408 | 1.469115 |
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: Source file '{0}' not fou... | def files_exist(self) | Check if SlackBuild archive.tar.gz and sources exist | 5.160633 | 3.150666 | 1.63795 |
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()
else:
usage("") | def help_version(self) | Help and version info | 2.843632 | 2.755863 | 1.031848 |
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(",")
for rp in repos:
... | def command_update(self) | Update package lists repositories | 3.937719 | 3.47728 | 1.132414 |
if len(self.args) == 1 and self.args[0] == "repo-enable":
RepoEnable().choose()
else:
usage("") | def command_repo_enable(self) | Repositories enable/disable | 7.869969 | 7.612581 | 1.033811 |
if len(self.args) == 1 and self.args[0] == "repo-list":
RepoList().repos()
else:
usage("") | def command_repo_list(self) | Repositories list | 6.455902 | 5.81974 | 1.109311 |
if len(self.args) == 3 and self.args[0] == "repo-add":
Repo().add(self.args[1], self.args[2])
else:
usage("") | def command_repo_add(self) | Add custom repositories | 3.885162 | 3.724145 | 1.043236 |
if len(self.args) == 2 and self.args[0] == "repo-remove":
Repo().remove(self.args[1])
else:
usage("") | def command_repo_remove(self) | Remove custom repositories | 4.709549 | 4.438668 | 1.061028 |
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].split(",")
for rp... | def command_upgrade(self) | Recreate repositories package lists | 4.199105 | 3.689325 | 1.138177 |
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
self.args[1] not in Repo... | def command_repo_info(self) | Repositories informations | 3.041203 | 3.027297 | 1.004594 |
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:
usage("") | def command_health(self) | Check package health | 4.214287 | 3.572974 | 1.17949 |
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 and self.args[0] == "deps-status"... | def command_deps_status(self) | Print dependencies status | 2.299273 | 2.228057 | 1.031963 |
if len(self.args) == 1 and self.args[0] == "new-config":
NewConfig().run()
else:
usage("") | def command_new_config(self) | Manage .new configuration files | 6.142718 | 5.510956 | 1.114637 |
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("") | def auto_build(self) | Auto built tool | 6.325989 | 5.464892 | 1.157569 |
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:
installe... | def pkg_list(self) | List of packages by repository | 4.663862 | 4.409404 | 1.057708 |
options = [
"-c",
"--check"
]
flags = [
"--upgrade",
"--skip=",
"--resolve-off",
"--checklist",
"--rebuild"
]
flag, skip = self.__pkg_upgrade_flags(flags)
if (len(self.args) == 3 ... | def pkg_upgrade(self) | Check and upgrade packages by repository | 3.977856 | 3.79751 | 1.04749 |
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 flags:
flag.append(a... | def __pkg_upgrade_flags(self, flags) | Manage flags for package upgrade option | 4.578173 | 4.247441 | 1.077866 |
flag = []
options = [
"-s",
"--sync"
]
additional_options = [
"--resolve-off",
"--download-only",
"--directory-prefix=",
"--case-ins",
"--rebuild",
"--reinstall",
"--patch... | def pkg_install(self) | Install packages by repository | 4.739071 | 4.459813 | 1.062617 |
flag = []
options = [
"-t",
"--tracking"
]
additional_options = [
"--check-deps",
"--graph=",
"--case-ins"
]
for arg in self.args[2:]:
if arg.startswith(additional_options[1]):
... | def pkg_tracking(self) | Tracking package dependencies | 4.14718 | 4.006065 | 1.035225 |
flag = []
options = [
"-n",
"--network"
]
additional_options = [
"--checklist",
"--case-ins"
]
for add in additional_options:
if add in self.args:
flag.append(add)
self.ar... | def sbo_network(self) | View slackbuilds packages | 6.478794 | 5.973228 | 1.084639 |
blacklist = BlackList()
options = [
"-b",
"--blacklist"
]
flag = [
"--add",
"--remove"
]
command = ["list"]
if (len(self.args) == 2 and self.args[0] in options and
self.args[1] == command[0])... | def pkg_blacklist(self) | Manage blacklist packages | 2.667629 | 2.537411 | 1.051319 |
queue = QueuePkgs()
options = [
"-q",
"--queue"
]
flag = [
"--add",
"--remove"
]
command = [
"list",
"build",
"install",
"build-install"
]
if (len(self... | def pkg_queue(self) | Manage packages in queue | 2.111588 | 2.057153 | 1.026462 |
packages = self.args[1:]
options = [
"-i",
"--installpkg"
]
flag = ""
flags = [
"--warn",
"--md5sum",
"--root",
"--infobox",
"--menu",
"--terse",
"--ask",
... | def bin_install(self) | Install Slackware binary packages | 5.473251 | 5.341376 | 1.024689 |
packages = self.args[1:]
options = [
"-u",
"--upgradepkg"
]
flag = ""
flags = [
"--dry-run",
"--install-new",
"--reinstall",
"--verbose"
]
if len(self.args) > 1 and self.args[0] in op... | def bin_upgrade(self) | Install-upgrade Slackware binary packages | 4.581892 | 4.3538 | 1.052389 |
packages = self.args[1:]
options = [
"-r",
"--removepkg"
]
additional_options = [
"--deps",
"--check-deps",
"--tag",
"--checklist"
]
flag, extra = "", []
flags = [
"-warn"... | def bin_remove(self) | Remove Slackware packages | 4.633308 | 4.342307 | 1.067015 |
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 = self.args[1:]
... | def bin_find(self) | Find installed packages | 5.507959 | 5.147748 | 1.069975 |
options = [
"-p",
"--desc"
]
flag = ["--color="]
colors = [
"red",
"green",
"yellow",
"cyan",
"grey"
]
tag = ""
for arg in self.args:
if arg.startswith(flag[0]... | def pkg_desc(self) | Print slack-desc by repository | 3.184527 | 2.995205 | 1.063208 |
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 = self.args[1:]
... | def pkg_find(self) | Find packages from all enabled repositories | 6.812266 | 6.308432 | 1.079867 |
packages = self.args[1:]
options = [
"-d",
"--display"
]
if len(self.args) > 1 and self.args[0] in options:
PackageManager(packages).display()
else:
usage("") | def pkg_contents(self) | Print packages contents | 7.066288 | 5.861547 | 1.205533 |
options = [
"-g",
"--config"
]
command = [
"print",
"edit",
"reset"
]
conf = Config()
if (len(self.args) == 2 and self.args[0] in options and
self.args[1] == command[1]):
conf... | def congiguration(self) | Manage slpkg configuration file | 3.172593 | 2.988956 | 1.061438 |
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 = [], []
for pkg in args:
... | def auto_detect(self, args) | Check for already Slackware binary packages exist | 4.058553 | 3.948528 | 1.027865 |
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():
status(0)
if lin... | def search_pkg(name, repo) | Search if package exists in PACKAGES.TXT file
and return the name. | 7.26369 | 6.735557 | 1.07841 |
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():
... | def data(self) | Check all installed packages and create
dictionary database | 4.635922 | 4.201473 | 1.103404 |
packages = []
for pkg in self.dmap.values():
packages += pkg
self.count_dep += 1
self.count_pkg = len(set(packages)) | def count_packages(self) | Count dependencies and packages | 7.275875 | 6.371673 | 1.14191 |
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, key, self.endc, ... | def show(self) | Show dependencies status | 6.370645 | 5.868479 | 1.08557 |
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("|")
for d in dep:
... | def tree(self) | Like tree view mode | 6.762445 | 6.680066 | 1.012332 |
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)) | def summary(self) | Summary by packages and dependencies | 7.565184 | 5.416412 | 1.396715 |
if repo and repo not in _meta_.repositories:
error_repo = ""
all_repos = RepoList().all_repos.keys()
del RepoList().all_repos
if repo in all_repos:
error_repo = ("slpkg: Error: Repository '{0}' is not activated"
"\n".format(repo))
el... | def usage(repo) | Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
Commands:
[update, --only=[...]]
[upgrade, --only=[...]]
[repo-add [repository name] [URL]]
[repo-remove [repository]]
[repo-enable]
[repo-list]
[repo-info [re... | 5.718247 | 5.067289 | 1.128463 |
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().template(78)
for ... | def find(self, pkg, flag) | Start to find packages and print | 4.677001 | 4.595005 | 1.017845 |
ver = ""
if repo == "sbo":
ver = "-" + SBoGrep(find).version()
return ver | def sbo_version(self, repo, find) | Add version to SBo packages | 13.195763 | 10.173599 | 1.297059 |
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 _meta_.slackware_ver... | def slack_ver() | Open file and read Slackware version | 6.312181 | 5.284366 | 1.194501 |
repo_name = []
if not url.endswith("/"):
url = url + "/"
for line in self.custom_repositories_list.splitlines():
line = line.lstrip()
if line and not line.startswith("#"):
repo_name.append(line.split()[0])
if (repo in self.meta... | def add(self, repo, url) | Write custom repository name and url in a file | 3.812556 | 3.656416 | 1.042703 |
rem_repo = False
with open(self.custom_repo_file, "w") as repos:
for line in self.custom_repositories_list.splitlines():
repo_name = line.split()[0]
if repo_name != repo:
repos.write(line + "\n")
else:
... | def remove(self, repo) | Remove custom repository | 3.192427 | 3.028886 | 1.053994 |
custom_dict_repo = {}
for line in self.custom_repositories_list.splitlines():
line = line.lstrip()
if not line.startswith("#"):
custom_dict_repo[line.split()[0]] = line.split()[1]
return custom_dict_repo | def custom_repository(self) | Return dictionary with repo name and url (used external) | 3.308022 | 2.654041 | 1.24641 |
default_dict_repo = {}
for line in self.default_repositories_list.splitlines():
line = line.lstrip()
if not line.startswith("#"):
if line.split()[0] in self.DEFAULT_REPOS_NAMES:
default_dict_repo[line.split()[0]] = line.split()[1]
... | def default_repository(self) | Return dictionary with default repo name and url | 4.292311 | 3.852198 | 1.11425 |
default = "http://mirrors.slackware.com/slackware/"
if self.meta.arch.startswith("arm"):
default = "http://ftp.arm.slackware.com/slackwarearm/"
if os.path.isfile("/etc/slpkg/slackware-mirrors"):
mirrors = Utils().read_file(
self.meta.conf_path + "... | def slack(self) | Official slackware repository | 5.651353 | 5.12101 | 1.103562 |
if _meta_.checkmd5 in ["on", "ON"]:
print("")
md5s = md5(src_file)
if pkg_md5 != md5s:
Msg().template(78)
print("| MD5SUM check for {0} [ {1}FAILED{2} ]".format(
src_file.split("/")[-1], _meta_.color["RED"],
_meta_.color["ENDC"]))
... | def check_md5(pkg_md5, src_file) | MD5 Checksum | 3.275264 | 3.175304 | 1.03148 |
if self.sbo_url and self.name not in self.blacklist:
self.prgnam = ("{0}-{1}".format(self.name, self.sbo_version))
self.view_sbo()
while True:
self.read_choice()
choice = {
"r": self.choice_README,
... | def view(self) | View SlackBuild package, read or install them
from slackbuilds.org | 2.931696 | 2.685453 | 1.091695 |
if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.data)
for key, value in data_dict.iteritems():
if key == self.name.lower():
self.name = value | def case_insensitive(self) | Matching packages distinguish between uppercase and
lowercase | 8.462008 | 8.380131 | 1.00977 |
commands = {
"r": "README",
"R": "README",
"s": "{0}.SlackBuild".format(self.name),
"S": "{0}.SlackBuild".format(self.name),
"f": "{0}.info".format(self.name),
"F": "{0}.info".format(self.name),
"o": "doinst.sh",
... | def read_choice(self) | Return choice | 2.684319 | 2.667436 | 1.006329 |
README = ReadSBo(self.sbo_url).readme("README")
fill = self.fill_pager(README)
self.pager(README + fill) | def choice_README(self) | View README file | 31.355621 | 32.559303 | 0.963031 |
SlackBuild = ReadSBo(self.sbo_url).slackbuild(self.name, ".SlackBuild")
fill = self.fill_pager(SlackBuild)
self.pager(SlackBuild + fill) | def choice_SlackBuild(self) | View .SlackBuild file | 23.687658 | 19.798552 | 1.196434 |
info = ReadSBo(self.sbo_url).info(self.name, ".info")
fill = self.fill_pager(info)
self.pager(info + fill) | def choice_info(self) | View .info file | 25.839899 | 22.472145 | 1.149863 |
if "doinst.sh" in self.sbo_files.split():
doinst_sh = ReadSBo(self.sbo_url).doinst("doinst.sh")
fill = self.fill_pager(doinst_sh)
self.pager(doinst_sh + fill) | def choice_doinst(self) | View doinst.sh file | 10.407247 | 8.712225 | 1.194557 |
Download(path="", url=self.dwn_srcs, repo="sbo").start()
raise SystemExit() | def choice_download(self) | Download script.tar.gz and sources | 57.238209 | 49.736732 | 1.150824 |
pkg_security([self.name])
if not find_package(self.prgnam, self.meta.pkg_path):
self.build()
self.install()
delete(self.build_folder)
raise SystemExit()
else:
self.msg.template(78)
self.msg.pkg_found(self.prgnam)
... | def choice_install(self) | Download, build and install package | 9.402738 | 8.894361 | 1.057157 |
sbo_url = self.sbo_url.replace("/slackbuilds/", "/repository/")
br1, br2, fix_sp = "", "", " "
if self.meta.use_colors in ["off", "OFF"]:
br1 = "("
br2 = ")"
fix_sp = ""
print("") # new line at start
self.msg.template(78)
pri... | def view_sbo(self) | View slackbuild.org | 3.410525 | 3.309501 | 1.030525 |
data = []
if self.name == "ALL":
data = self.data
else:
for name in self.data:
if self.name in name:
data.append(name)
if data:
text = "Press 'spacebar' to choose SlackBuild for view"
title = " S... | def with_checklist(self) | Using dialog and checklist option | 8.112592 | 7.825838 | 1.036642 |
tty_size = os.popen("stty size", "r").read().split()
rows = int(tty_size[0]) - 1
lines = sum(1 for line in page.splitlines())
diff = rows - lines
fill = "\n" * diff
if diff > 0:
return fill
else:
return "" | def fill_pager(self, page) | Fix pager spaces | 3.507476 | 3.201821 | 1.095463 |
self.FAULT = ""
UNST = ["UNSUPPORTED", "UNTESTED"]
if "".join(self.source_dwn) in UNST:
self.FAULT = "".join(self.source_dwn) | def error_uns(self) | Check if package supported by arch
before proceed to install | 11.897141 | 10.69365 | 1.112543 |
pkg_security([self.name])
self.error_uns()
if self.FAULT:
print("")
self.msg.template(78)
print("| Package {0} {1} {2} {3}".format(self.prgnam, self.red,
self.FAULT, self.endc))
self.msg... | def build(self) | Only build and create Slackware package | 5.833673 | 5.501323 | 1.060413 |
binary = slack_package(self.prgnam)
print("[ {0}Installing{1} ] --> {2}".format(self.green, self.endc,
self.name))
PackageManager(binary).upgrade(flag="--install-new") | def install(self) | Install SBo package found in /tmp directory. | 23.470852 | 19.899929 | 1.179444 |
queue_list = []
for read in self.queued.splitlines():
read = read.lstrip()
if not read.startswith("#"):
queue_list.append(read.replace("\n", ""))
return queue_list | def packages(self) | Return queue list from /var/lib/queue/queue_list
file. | 5.372668 | 3.777515 | 1.422276 |
print("\nPackages in the queue:\n")
for pkg in self.packages():
if pkg:
print("{0}{1}{2}".format(self.meta.color["GREEN"], pkg,
self.meta.color["ENDC"]))
self.quit = True
if self.quit:
print... | def listed(self) | Print packages from queue | 6.689288 | 4.637473 | 1.442443 |
queue_list = self.packages()
pkgs = list(OrderedDict.fromkeys(pkgs))
print("\nAdd packages in the queue:\n")
with open(self.queue_list, "a") as queue:
for pkg in pkgs:
find = sbo_search_pkg(pkg)
if pkg not in queue_list and find is not... | def add(self, pkgs) | Add packages in queue if not exist | 3.512359 | 3.228109 | 1.088055 |
print("\nRemove packages from the queue:\n")
with open(self.queue_list, "w") as queue:
for line in self.queued.splitlines():
if line not in pkgs:
queue.write(line + "\n")
else:
print("{0}{1}{2}".format(self.meta... | def remove(self, pkgs) | Remove packages from queue | 4.095567 | 3.732302 | 1.09733 |
packages = self.packages()
if packages:
for pkg in packages:
if not os.path.exists(self.meta.build_path):
os.mkdir(self.meta.build_path)
if not os.path.exists(self._SOURCES):
os.mkdir(self._SOURCES)
... | def build(self) | Build packages from queue | 4.652709 | 4.304288 | 1.080947 |
packages = self.packages()
if packages:
print("") # new line at start
for pkg in packages:
ver = SBoGrep(pkg).version()
prgnam = "{0}-{1}".format(pkg, ver)
if find_package(prgnam, self.meta.output):
bi... | def install(self) | Install packages from queue | 8.073865 | 7.35328 | 1.097995 |
Msg().checking()
PACKAGES_TXT = RepoInit(repo).fetch()[0]
pkgs_for_upgrade = []
# name = data[0]
# location = data[1]
# size = data[2]
# unsize = data[3]
data = repo_data(PACKAGES_TXT, repo, flag="")
for pkg in installed():
status(0.0005)
inst_pkg = split_package... | def pkg_upgrade(repo, skip, flag) | Checking packages for upgrade | 6.175432 | 6.023824 | 1.025168 |
name = ver = arch = build = []
split = package.split("-")
if len(split) > 2:
build = split[-1]
build_a, build_b = "", ""
build_a = build[:1]
if build[1:2].isdigit():
build_b = build[1:2]
build = build_a + build_b
arch = split[-2]
ver =... | def split_package(package) | Split package in name, version
arch and build tag. | 2.986266 | 2.700936 | 1.105641 |
repos = []
for repo in repositories:
if repo in default_repositories:
repos.append(repo)
return repos | def remove_repositories(repositories, default_repositories) | Remove no default repositories | 2.84862 | 2.819452 | 1.010345 |
repo_file = "{0}custom-repositories".format(conf_path)
if os.path.isfile(repo_file):
f = open(repo_file, "r")
repositories_list = f.read()
f.close()
for line in repositories_list.splitlines():
line = line.lstrip()
if line and not line.startswith("#"):... | def update_repositories(repositories, conf_path) | Upadate with user custom repositories | 2.627045 | 2.359568 | 1.113358 |
for i, repo in enumerate(repositories):
if repos in repo:
sub = repositories[i].replace(repos, "")
repositories[i] = repos
return sub
return "" | def grab_sub_repo(repositories, repos) | Grab SUB_REPOSITORY | 4.890974 | 4.529104 | 1.079899 |
pkg_names = []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
pkg_names.append(line[17:].strip())
return pkg_names | def names(self) | Grab all packages name | 6.925401 | 5.535249 | 1.251145 |
source, source64, = "", ""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_down):
if sbo_name == self.name and line[21:].strip():
... | def source(self) | Grab sources downloads links | 4.313531 | 4.244541 | 1.016254 |
src = ""
if self.meta.arch == "x86_64":
if source64:
src = source64
else:
src = source
if self.meta.skip_unst in self.answer and source64 in self.unst:
src = source
else:
if source:
... | def _select_source_arch(self, source, source64) | Return sources by arch | 3.381522 | 3.254326 | 1.039085 |
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_req):
if sbo_name == self.name:
return line[21:].strip().split() | def requires(self) | Grab package requirements | 6.590211 | 6.136045 | 1.074016 |
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_ver):
if sbo_name == self.name:
return line[20:].strip() | def version(self) | Grab package version | 6.326642 | 6.096407 | 1.037766 |
md5sum, md5sum64, = [], []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_md5_64):
if sbo_name == self.name and line[26:].strip():
... | def checksum(self) | Grab checksum string | 3.765327 | 3.662173 | 1.028168 |
if md5sum and md5sum64:
if self.meta.arch == "x86_64":
return md5sum64
else:
return md5sum
if md5sum:
return md5sum
else:
return md5sum64 | def _select_md5sum_arch(self, md5sum, md5sum64) | Return checksums by arch | 2.288804 | 2.192011 | 1.044157 |
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_des):
if sbo_name == self.name:
return line[31:].strip() | def description(self) | Grab package verion | 6.632921 | 6.365201 | 1.04206 |
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_files):
if sbo_name == self.name:
return line[18:].strip() | def files(self) | Grab files | 6.475302 | 6.431502 | 1.00681 |
pkg_list = "PACKAGES.TXT"
if repo == "sbo":
pkg_list = "SLACKBUILDS.TXT"
if check_for_local_repos(repo) is True:
pkg_list = "PACKAGES.TXT"
return ""
if not os.path.isfile("{0}{1}{2}".format(
_meta_.lib_path, repo, "_repo/{0}".format(pkg_list))):
return re... | def check_exists_repositories(repo) | Checking if repositories exists by PACKAGES.TXT file | 6.95399 | 6.085326 | 1.142747 |
repos_dict = Repo().default_repository()
if repo in repos_dict:
repo_url = repos_dict[repo]
if repo_url.startswith("file:///"):
return True | def check_for_local_repos(repo) | Check if repository is local | 4.87464 | 4.698305 | 1.037532 |
log = self.log_path + "slack/"
lib = self.lib_path + "slack_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_file = "CHECKSUMS.md5"
log_file = "ChangeLog.txt"
if not os.path.exists(log):
os.mkdir... | def slack(self) | Creating slack local libraries | 2.531 | 2.529542 | 1.000577 |
repo = self.def_repos_dict["conrad"]
log = self.log_path + "conrad/"
lib = self.lib_path + "conrad_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_file = "CHECKSUMS.md5"
log_file = "ChangeLog.txt"
i... | def conrad(self) | Creating slackers local library | 3.358171 | 3.32282 | 1.010639 |
filename = link.split("/")[-1]
if not os.path.isfile(path + filename):
Download(path, link.split(), repo).start() | def down(self, path, link, repo) | Download files | 7.506957 | 7.356096 | 1.020508 |
log_path = args[0]
ChangeLog_txt = args[1]
lib_path = args[2]
PACKAGES_TXT = args[3]
CHECKSUMS_MD5 = args[4]
FILELIST_TXT = args[5]
repo = args[6]
if self.checks_logs(log_path, ChangeLog_txt):
# remove old files
self.file_... | def remote(self, *args) | Remove and recreate files | 2.650199 | 2.562018 | 1.034418 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.