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