mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-05 11:02:14 +01:00
Fixed typos
This commit is contained in:
parent
d3c251a6db
commit
6d1934a1d9
9 changed files with 39 additions and 41 deletions
|
@ -41,20 +41,20 @@ class AutoBuild:
|
|||
self.sbo_sources = []
|
||||
|
||||
def run(self):
|
||||
"""Build package and fix ordelist per checksum
|
||||
"""Builds package and fix ordelist per checksum
|
||||
"""
|
||||
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
|
||||
# If the list does not have the same order uses from .info
|
||||
# order.
|
||||
BuildPackage(self.script, sources, self.path, auto=True).build()
|
||||
raise SystemExit()
|
||||
|
||||
def info_file(self):
|
||||
"""Grab sources from .info file and store filename
|
||||
"""Grabs sources from .info file and stores filename
|
||||
"""
|
||||
sources = SBoGrep(self.prgnam).source().split()
|
||||
for source in sources:
|
||||
|
|
|
@ -30,7 +30,7 @@ from slpkg.__metadata__ import MetaData as _meta_
|
|||
|
||||
|
||||
class BuildNumber(Utils):
|
||||
"""Get build number from SlackBuild script
|
||||
"""Gets build number from SlackBuild script
|
||||
"""
|
||||
def __init__(self, sbo_url, pkg):
|
||||
self.sbo_url = sbo_url
|
||||
|
|
|
@ -35,7 +35,7 @@ from slpkg.sbo.greps import SBoGrep
|
|||
|
||||
|
||||
def sbo_upgrade(skip, flag):
|
||||
"""Return packages for upgrade
|
||||
"""Returns packages for upgrade
|
||||
"""
|
||||
msg = Msg()
|
||||
black = BlackList()
|
||||
|
@ -58,7 +58,7 @@ def sbo_upgrade(skip, flag):
|
|||
|
||||
|
||||
def sbo_list():
|
||||
"""Return all SBo packages
|
||||
"""Returns all SBo packages
|
||||
"""
|
||||
for pkg in os.listdir(_meta_.pkg_path):
|
||||
if pkg.endswith("_SBo"):
|
||||
|
|
|
@ -23,12 +23,10 @@
|
|||
|
||||
|
||||
class SBoLink:
|
||||
"""Create slackbuild tar.gz archive from url
|
||||
"""Creates slackbuild tar.gz archive from url
|
||||
"""
|
||||
def __init__(self, sbo_url):
|
||||
self.sbo_url = sbo_url
|
||||
|
||||
def tar_gz(self):
|
||||
"""Return link slackbuild tar.gz archive
|
||||
"""
|
||||
return f"{self.sbo_url[:-1]}.tar.gz"
|
||||
|
|
|
@ -44,7 +44,7 @@ class Requires(BlackList):
|
|||
|
||||
@lru_cache
|
||||
def sbo(self, name):
|
||||
"""Build all dependencies of a package
|
||||
"""Builds all dependencies of a package
|
||||
"""
|
||||
if (self.meta.rsl_deps in ["on", "ON"] and
|
||||
"--resolve-off" not in self.flag):
|
||||
|
@ -53,8 +53,8 @@ class Requires(BlackList):
|
|||
requires = SBoGrep(name).requires()
|
||||
if requires:
|
||||
for req in requires:
|
||||
# avoid to add %README% as dependency and
|
||||
# if require in blacklist
|
||||
# avoids adding %README% as dependency and if
|
||||
# requires in the blacklist
|
||||
if "%README%" not in req and req not in self.blacklist:
|
||||
dependencies.append(req)
|
||||
self.deep_check(tuple(dependencies))
|
||||
|
@ -64,7 +64,7 @@ class Requires(BlackList):
|
|||
|
||||
@lru_cache
|
||||
def deep_check(self, dependencies):
|
||||
"""Checking if dependencies are finnished
|
||||
"""Checking if dependencies are finished
|
||||
"""
|
||||
if dependencies:
|
||||
self.dep_results.append(dependencies)
|
||||
|
|
|
@ -28,7 +28,7 @@ from slpkg.__metadata__ import MetaData as _meta_
|
|||
|
||||
|
||||
class SBoGrep(Utils):
|
||||
"""Grab data from SLACKBUILDS.TXT file
|
||||
"""Grabs data from sbo database
|
||||
"""
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
@ -53,7 +53,7 @@ class SBoGrep(Utils):
|
|||
return list(self._names_grabbing())
|
||||
|
||||
def source(self):
|
||||
"""Grab sources downloads links
|
||||
"""Grabs sources downloads links
|
||||
"""
|
||||
source, source64 = self.cur.execute("""SELECT download, download64
|
||||
FROM sbo
|
||||
|
@ -62,7 +62,7 @@ class SBoGrep(Utils):
|
|||
return self._sorting_arch(source, source64)
|
||||
|
||||
def requires(self):
|
||||
"""Grab package requirements
|
||||
"""Grabs package requirements
|
||||
"""
|
||||
requires = self.cur.execute("""SELECT requires
|
||||
FROM sbo
|
||||
|
@ -71,7 +71,7 @@ class SBoGrep(Utils):
|
|||
return requires[0].split()
|
||||
|
||||
def version(self):
|
||||
"""Grab package version
|
||||
"""Grabs package version
|
||||
"""
|
||||
version = self.cur.execute("""SELECT version
|
||||
FROM sbo
|
||||
|
@ -80,7 +80,7 @@ class SBoGrep(Utils):
|
|||
return version[0]
|
||||
|
||||
def checksum(self):
|
||||
"""Grab checksum string
|
||||
"""Grabs checksum string
|
||||
"""
|
||||
md5sum, md5sum64, = [], []
|
||||
mds5, md5s64 = self.cur.execute("""SELECT md5sum, md5sum64
|
||||
|
@ -94,7 +94,7 @@ class SBoGrep(Utils):
|
|||
return self._sorting_arch(md5sum, md5sum64)
|
||||
|
||||
def description(self):
|
||||
"""Grab package description
|
||||
"""Grabs package description
|
||||
"""
|
||||
desc = self.cur.execute("""SELECT short_desc
|
||||
FROM sbo
|
||||
|
@ -103,7 +103,7 @@ class SBoGrep(Utils):
|
|||
return desc[0]
|
||||
|
||||
def files(self):
|
||||
"""Grab files
|
||||
"""Grabs files
|
||||
"""
|
||||
files = self.cur.execute("""SELECT files
|
||||
FROM sbo
|
||||
|
@ -112,8 +112,8 @@ class SBoGrep(Utils):
|
|||
return files[0]
|
||||
|
||||
def _sorting_arch(self, arch, arch64):
|
||||
"""Return sources by arch
|
||||
"""Returns sources by arch
|
||||
"""
|
||||
if self.meta.arch == self.arch64 and arch64:
|
||||
return arch64
|
||||
return arch
|
||||
return arch
|
|
@ -49,7 +49,7 @@ from slpkg.slack.slack_version import slack_ver
|
|||
|
||||
|
||||
class SBoNetwork(BlackList, Utils):
|
||||
"""View SBo site in terminal and also read, build or
|
||||
"""View SBo site in the terminal and also read, build or
|
||||
install packages
|
||||
"""
|
||||
def __init__(self, name, flag):
|
||||
|
@ -224,7 +224,7 @@ class SBoNetwork(BlackList, Utils):
|
|||
raise SystemExit()
|
||||
|
||||
def choice_install(self):
|
||||
"""Download, build and install package
|
||||
"""Download, build and install the package
|
||||
"""
|
||||
pkg_security([self.name])
|
||||
if not find_package(self.prgnam, self.meta.pkg_path):
|
||||
|
@ -313,7 +313,7 @@ class SBoNetwork(BlackList, Utils):
|
|||
pydoc.pager(text)
|
||||
|
||||
def fill_pager(self, page):
|
||||
"""Fix pager spaces
|
||||
"""Fixes pager spaces
|
||||
"""
|
||||
tty_size = os.popen("stty size", "r").read().split()
|
||||
rows = int(tty_size[0]) - 1
|
||||
|
@ -326,8 +326,8 @@ class SBoNetwork(BlackList, Utils):
|
|||
return ""
|
||||
|
||||
def error_uns(self):
|
||||
"""Check if package supported by arch
|
||||
before proceed to install
|
||||
"""Check if the package is supported by an arch
|
||||
before proceeding to install
|
||||
"""
|
||||
self.FAULT = ""
|
||||
UNST = ["UNSUPPORTED", "UNTESTED"]
|
||||
|
@ -335,7 +335,7 @@ class SBoNetwork(BlackList, Utils):
|
|||
self.FAULT = "".join(self.source_dwn)
|
||||
|
||||
def build(self):
|
||||
"""Only build and create Slackware package
|
||||
"""Builds slackware package
|
||||
"""
|
||||
pkg_security([self.name])
|
||||
self.error_uns()
|
||||
|
@ -363,7 +363,7 @@ class SBoNetwork(BlackList, Utils):
|
|||
slack_package(self.prgnam) # check if build
|
||||
|
||||
def install(self):
|
||||
"""Install SBo package found in /tmp directory.
|
||||
"""Installs SBo package found in /tmp directory.
|
||||
"""
|
||||
binary = slack_package(self.prgnam)
|
||||
print(f"[ {self.green}Installing{self.endc} ] --> {self.name}")
|
||||
|
|
|
@ -40,7 +40,7 @@ from slpkg.sbo.slack_find import slack_package
|
|||
|
||||
|
||||
class QueuePkgs(Utils):
|
||||
"""Manage SBo packages, add or remove for building or
|
||||
"""Manages SBo packages, add or removes for building or
|
||||
installation
|
||||
"""
|
||||
def __init__(self):
|
||||
|
@ -57,7 +57,7 @@ class QueuePkgs(Utils):
|
|||
"""Creating the directories and the queue file
|
||||
"""
|
||||
queue_file = [
|
||||
"# In this file you can create a list of\n",
|
||||
"# In this file, you can create a list of\n",
|
||||
"# packages you want to build or install.\n",
|
||||
"#\n"]
|
||||
if not os.path.exists(self.meta.lib_path):
|
||||
|
@ -71,7 +71,7 @@ class QueuePkgs(Utils):
|
|||
self.queued = self.read_file(self.queue_list)
|
||||
|
||||
def packages(self):
|
||||
"""Return queue list from /var/lib/queue/queue_list
|
||||
"""Returns queue list from /var/lib/queue/queue_list
|
||||
file.
|
||||
"""
|
||||
for read in self.queued.splitlines():
|
||||
|
@ -80,7 +80,7 @@ class QueuePkgs(Utils):
|
|||
yield read.replace("\n", "")
|
||||
|
||||
def listed(self):
|
||||
"""Print packages from queue
|
||||
"""Prints packages from queue
|
||||
"""
|
||||
print("Packages in the queue:")
|
||||
for pkg in self.packages():
|
||||
|
@ -88,7 +88,7 @@ class QueuePkgs(Utils):
|
|||
print()
|
||||
|
||||
def add(self, pkgs):
|
||||
"""Add packages in queue if not exist
|
||||
"""Adds packages in queue if not exist
|
||||
"""
|
||||
queue_list = list(self.packages())
|
||||
pkgs = list(OrderedDict.fromkeys(pkgs))
|
||||
|
@ -104,7 +104,7 @@ class QueuePkgs(Utils):
|
|||
print()
|
||||
|
||||
def remove(self, pkgs):
|
||||
"""Remove packages from queue
|
||||
"""Removes packages from the queue
|
||||
"""
|
||||
print("Remove packages from the queue:")
|
||||
with open(self.queue_list, "w") as queue:
|
||||
|
@ -116,7 +116,7 @@ class QueuePkgs(Utils):
|
|||
print()
|
||||
|
||||
def build(self):
|
||||
"""Build packages from queue
|
||||
"""Builds packages from the queue
|
||||
"""
|
||||
sources = []
|
||||
packages = list(self.packages())
|
||||
|
@ -146,7 +146,7 @@ class QueuePkgs(Utils):
|
|||
"building\n")
|
||||
|
||||
def install(self):
|
||||
"""Install packages from queue
|
||||
"""Installs packages from the queue
|
||||
"""
|
||||
packages = list(self.packages())
|
||||
if packages:
|
||||
|
|
|
@ -38,12 +38,12 @@ def sbo_search_pkg(name):
|
|||
con = sqlite3.connect(f"{lib_path}{db}")
|
||||
cur = con.cursor()
|
||||
|
||||
loc = cur.execute("""SELECT location
|
||||
FROM sbo
|
||||
WHERE name = '{}'""".format(name)).fetchone()
|
||||
location = cur.execute("""SELECT location
|
||||
FROM sbo
|
||||
WHERE name = '{}'""".format(name)).fetchone()
|
||||
|
||||
repo = Repo()
|
||||
sbo = repo.default_repository()["sbo"]
|
||||
sbo_url = f"{sbo}{slack_ver()}/"
|
||||
|
||||
return f"{sbo_url}{loc[0][2:]}/"
|
||||
return f"{sbo_url}{location[0][2:]}/"
|
||||
|
|
Loading…
Reference in a new issue