mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
updated for version 1.9.8
This commit is contained in:
parent
031421a975
commit
eaf5799577
15 changed files with 262 additions and 196 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Version 1.9.8
|
||||||
|
07-10-2014
|
||||||
|
|
||||||
|
[Updated] - Source code update.
|
||||||
|
|
||||||
Version 1.9.7
|
Version 1.9.7
|
||||||
06-10-2014
|
06-10-2014
|
||||||
|
|
||||||
|
|
2
PKG-INFO
2
PKG-INFO
|
@ -1,6 +1,6 @@
|
||||||
Metadata-Version: 1.1
|
Metadata-Version: 1.1
|
||||||
Name: slpkg
|
Name: slpkg
|
||||||
Version: 1.9.6
|
Version: 1.9.8
|
||||||
Author: dslackw
|
Author: dslackw
|
||||||
Author-email: d zlatanidis at gmail com
|
Author-email: d zlatanidis at gmail com
|
||||||
Maintainer: dslackw
|
Maintainer: dslackw
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
Latest Release:
|
Latest Release:
|
||||||
|
|
||||||
- Version: 1.9.6
|
- Version: 1.9.8
|
||||||
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
|
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
|
||||||
- `Source <https://github.com/dslackw/slpkg/archive/v1.9.6.tar.gz>`_
|
- `Source <https://github.com/dslackw/slpkg/archive/v1.9.8.tar.gz>`_
|
||||||
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
|
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
|
||||||
|
|
||||||
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
|
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
|
||||||
|
@ -96,8 +96,8 @@ Untar the archive and run install.sh script:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ tar xvf slpkg-1.9.6.tar.gz
|
$ tar xvf slpkg-1.9.8.tar.gz
|
||||||
$ cd slpkg-1.9.6
|
$ cd slpkg-1.9.8
|
||||||
$ ./install.sh
|
$ ./install.sh
|
||||||
|
|
||||||
Using `pip <https://pip.pypa.io/en/latest/>`_ :
|
Using `pip <https://pip.pypa.io/en/latest/>`_ :
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
PRGNAM=slpkg
|
PRGNAM=slpkg
|
||||||
VERSION=${VERSION:-1.9.6}
|
VERSION=${VERSION:-1.9.8}
|
||||||
TAG=${TAG:-_dsw}
|
TAG=${TAG:-_dsw}
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
|
@ -26,7 +26,7 @@ import subprocess
|
||||||
|
|
||||||
__all__ = "slpkg"
|
__all__ = "slpkg"
|
||||||
__author__ = "dslackw"
|
__author__ = "dslackw"
|
||||||
__version_info__ = (1, 9, 6)
|
__version_info__ = (1, 9, 8)
|
||||||
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
||||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||||
__email__ = "d.zlatanidis@gmail.com"
|
__email__ = "d.zlatanidis@gmail.com"
|
||||||
|
|
|
@ -26,17 +26,17 @@ import getpass
|
||||||
|
|
||||||
from colors import *
|
from colors import *
|
||||||
from messages import s_user
|
from messages import s_user
|
||||||
|
from blacklist import BlackList
|
||||||
from version import prog_version
|
from version import prog_version
|
||||||
from __metadata__ import path, __version__
|
from __metadata__ import path, __version__
|
||||||
from blacklist import BlackList
|
|
||||||
|
|
||||||
from pkg.manager import PackageManager
|
|
||||||
from pkg.build import build_package
|
from pkg.build import build_package
|
||||||
|
from pkg.manager import PackageManager
|
||||||
|
|
||||||
from sbo.check import sbo_check
|
from sbo.check import sbo_check
|
||||||
from sbo.views import sbo_network
|
from sbo.views import sbo_network
|
||||||
|
from sbo.tracking import track_dep
|
||||||
from sbo.slackbuild import sbo_build
|
from sbo.slackbuild import sbo_build
|
||||||
from sbo.dependency import pkg_tracking
|
|
||||||
|
|
||||||
from slack.patches import patches
|
from slack.patches import patches
|
||||||
from slack.install import install
|
from slack.install import install
|
||||||
|
@ -123,7 +123,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
for opt in usage: print(opt)
|
for opt in usage: print(opt)
|
||||||
elif len(args) == 2 and args[0] == "-t":
|
elif len(args) == 2 and args[0] == "-t":
|
||||||
pkg_tracking(args[1])
|
track_dep(args[1])
|
||||||
elif len(args) == 2 and args[0] == "-n":
|
elif len(args) == 2 and args[0] == "-n":
|
||||||
sbo_network(args[1])
|
sbo_network(args[1])
|
||||||
elif len(args) == 2 and args[0] == "-b" and args[1] == "--list":
|
elif len(args) == 2 and args[0] == "-b" and args[1] == "--list":
|
||||||
|
|
|
@ -34,7 +34,7 @@ from checksum import md5sum
|
||||||
from __metadata__ import log_path
|
from __metadata__ import log_path
|
||||||
from messages import pkg_not_found, template
|
from messages import pkg_not_found, template
|
||||||
|
|
||||||
from sbo.greps import sbo_checksum_pkg
|
from sbo.greps import SBoGrep
|
||||||
|
|
||||||
|
|
||||||
def build_package(script, sources, path):
|
def build_package(script, sources, path):
|
||||||
|
@ -66,7 +66,7 @@ def build_package(script, sources, path):
|
||||||
for src in sources:
|
for src in sources:
|
||||||
# fix build sources with spaces
|
# fix build sources with spaces
|
||||||
src = src.replace("%20", " ")
|
src = src.replace("%20", " ")
|
||||||
sbo_md5 = sbo_checksum_pkg(prgnam)
|
sbo_md5 = SBoGrep(prgnam).checksum()
|
||||||
md5 = md5sum(src)
|
md5 = md5sum(src)
|
||||||
if sbo_md5 != md5:
|
if sbo_md5 != md5:
|
||||||
template(78)
|
template(78)
|
||||||
|
|
|
@ -34,10 +34,10 @@ from downloader import Download
|
||||||
from messages import template, build_FAILED
|
from messages import template, build_FAILED
|
||||||
from __metadata__ import tmp, pkg_path, build_path, sp
|
from __metadata__ import tmp, pkg_path, build_path, sp
|
||||||
|
|
||||||
|
from greps import SBoGrep
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from download import sbo_slackbuild_dwn
|
from download import sbo_slackbuild_dwn
|
||||||
from dependency import sbo_dependencies_pkg
|
from dependency import sbo_dependencies_pkg
|
||||||
from greps import sbo_source_dwn, sbo_version_pkg
|
|
||||||
|
|
||||||
|
|
||||||
def sbo_check():
|
def sbo_check():
|
||||||
|
@ -49,7 +49,7 @@ def sbo_check():
|
||||||
but install the package with maximum build tag if find the
|
but install the package with maximum build tag if find the
|
||||||
some version in /tmp directory.
|
some version in /tmp directory.
|
||||||
'''
|
'''
|
||||||
try:
|
|
||||||
done = "{0}Done{1}\n".format(GREY, ENDC)
|
done = "{0}Done{1}\n".format(GREY, ENDC)
|
||||||
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
||||||
sys.stdout.write(reading_lists)
|
sys.stdout.write(reading_lists)
|
||||||
|
@ -57,9 +57,19 @@ def sbo_check():
|
||||||
init = initialization()
|
init = initialization()
|
||||||
arches = ["-x86_64-", "-i486-", "-arm-", "-noarch-"]
|
arches = ["-x86_64-", "-i486-", "-arm-", "-noarch-"]
|
||||||
index, toolbar_width = int(), 3
|
index, toolbar_width = int(), 3
|
||||||
dependencies, dependencies_list, \
|
[
|
||||||
requires, upgrade, installed, sbo_list, \
|
dependencies,
|
||||||
upg_name, pkg_for_upg, upg_ver, upg_arch = ([] for i in range(10))
|
dependencies_list,
|
||||||
|
requires,
|
||||||
|
upgrade,
|
||||||
|
installed,
|
||||||
|
sbo_list,
|
||||||
|
upg_name,
|
||||||
|
pkg_for_upg,
|
||||||
|
upg_ver,
|
||||||
|
upg_arch
|
||||||
|
] = ([] for i in range(10))
|
||||||
|
try:
|
||||||
for pkg in os.listdir(pkg_path):
|
for pkg in os.listdir(pkg_path):
|
||||||
if pkg.endswith("_SBo"):
|
if pkg.endswith("_SBo"):
|
||||||
sbo_list.append(pkg)
|
sbo_list.append(pkg)
|
||||||
|
@ -84,7 +94,7 @@ def sbo_check():
|
||||||
# search packages if exists in the repository
|
# search packages if exists in the repository
|
||||||
# and it gets to avoidable modified packages
|
# and it gets to avoidable modified packages
|
||||||
# from the user with the tag _SBo
|
# from the user with the tag _SBo
|
||||||
sbo_package = ("{0}-{1}".format(name, sbo_version_pkg(name)))
|
sbo_package = ("{0}-{1}".format(name, SBoGrep(name).version()))
|
||||||
if sbo_package > package:
|
if sbo_package > package:
|
||||||
upg_name.append(name)
|
upg_name.append(name)
|
||||||
sys.stdout.write(done)
|
sys.stdout.write(done)
|
||||||
|
@ -120,7 +130,7 @@ def sbo_check():
|
||||||
# In the end lest a check of the packages that are on the list
|
# In the end lest a check of the packages that are on the list
|
||||||
# are already installed.
|
# are already installed.
|
||||||
for pkg in dependencies_list:
|
for pkg in dependencies_list:
|
||||||
ver = sbo_version_pkg(pkg)
|
ver = SBoGrep(pkg).version()
|
||||||
prgnam = ("{0}-{1}".format(pkg, ver))
|
prgnam = ("{0}-{1}".format(pkg, ver))
|
||||||
pkg_version = ver # if package not installed
|
pkg_version = ver # if package not installed
|
||||||
# take version from repository
|
# take version from repository
|
||||||
|
@ -180,7 +190,7 @@ def sbo_check():
|
||||||
prgnam = ("{0}-{1}".format(name, version))
|
prgnam = ("{0}-{1}".format(name, version))
|
||||||
sbo_url = sbo_search_pkg(name)
|
sbo_url = sbo_search_pkg(name)
|
||||||
sbo_dwn = sbo_slackbuild_dwn(sbo_url)
|
sbo_dwn = sbo_slackbuild_dwn(sbo_url)
|
||||||
src_dwn = sbo_source_dwn(name).split()
|
src_dwn = SBoGrep(name).source().split()
|
||||||
script = sbo_dwn.split("/")[-1] # keep file from script link
|
script = sbo_dwn.split("/")[-1] # keep file from script link
|
||||||
Download(build_path, sbo_dwn).start()
|
Download(build_path, sbo_dwn).start()
|
||||||
sources = []
|
sources = []
|
||||||
|
|
|
@ -24,15 +24,10 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from colors import *
|
from colors import *
|
||||||
from init import initialization
|
|
||||||
from blacklist import BlackList
|
from blacklist import BlackList
|
||||||
from __metadata__ import pkg_path, sp
|
|
||||||
from messages import pkg_not_found, template
|
|
||||||
|
|
||||||
from pkg.find import find_package
|
|
||||||
|
|
||||||
|
from greps import SBoGrep
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from greps import sbo_requires_pkg
|
|
||||||
|
|
||||||
|
|
||||||
dep_results = []
|
dep_results = []
|
||||||
|
@ -46,7 +41,7 @@ def sbo_dependencies_pkg(name):
|
||||||
blacklist = BlackList().packages()
|
blacklist = BlackList().packages()
|
||||||
sbo_url = sbo_search_pkg(name)
|
sbo_url = sbo_search_pkg(name)
|
||||||
if sbo_url:
|
if sbo_url:
|
||||||
requires = sbo_requires_pkg(name)
|
requires = SBoGrep(name).requires()
|
||||||
for req in requires:
|
for req in requires:
|
||||||
# avoid to add %README% as dependency and
|
# avoid to add %README% as dependency and
|
||||||
# if require in blacklist
|
# if require in blacklist
|
||||||
|
@ -63,51 +58,3 @@ def sbo_dependencies_pkg(name):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print # new line at exit
|
print # new line at exit
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def pkg_tracking(name):
|
|
||||||
'''
|
|
||||||
View tree of dependencies and also
|
|
||||||
highlight packages with color green
|
|
||||||
if allready installed and color red
|
|
||||||
if not installed.
|
|
||||||
'''
|
|
||||||
done = "{0}Done{1}\n".format(GREY, ENDC)
|
|
||||||
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
|
||||||
sys.stdout.write(reading_lists)
|
|
||||||
sys.stdout.flush()
|
|
||||||
init = initialization()
|
|
||||||
dependencies_list = sbo_dependencies_pkg(name)
|
|
||||||
if dependencies_list is not None:
|
|
||||||
sys.stdout.write(done)
|
|
||||||
print # new line at start
|
|
||||||
requires, dependencies = [], []
|
|
||||||
# Create one list for all packages
|
|
||||||
for pkg in dependencies_list:
|
|
||||||
requires += pkg
|
|
||||||
requires.reverse()
|
|
||||||
# Remove double dependencies
|
|
||||||
for duplicate in requires:
|
|
||||||
if duplicate not in dependencies:
|
|
||||||
dependencies.append(duplicate)
|
|
||||||
if dependencies == []:
|
|
||||||
dependencies = ["No dependencies"]
|
|
||||||
pkg_len = len(name) + 24
|
|
||||||
template(pkg_len)
|
|
||||||
print("| Package {0}{1}{2} dependencies :".format(CYAN, name, ENDC))
|
|
||||||
template(pkg_len)
|
|
||||||
print("\\")
|
|
||||||
print(" +---{0}[ Tree of dependencies ]{1}".format(YELLOW, ENDC))
|
|
||||||
index = int()
|
|
||||||
for pkg in dependencies:
|
|
||||||
index += 1
|
|
||||||
if find_package(pkg + sp, pkg_path):
|
|
||||||
print(" |")
|
|
||||||
print(" {0}{1}: {2}{3}{4}".format("+--", index, GREEN, pkg, ENDC))
|
|
||||||
else:
|
|
||||||
print(" |")
|
|
||||||
print(" {0}{1}: {2}{3}{4}".format("+--", index, RED, pkg, ENDC))
|
|
||||||
print # new line at end
|
|
||||||
else:
|
|
||||||
sys.stdout.write(done)
|
|
||||||
message = "From slackbuilds.org"
|
|
||||||
pkg_not_found("\n", name, message, "\n")
|
|
||||||
|
|
|
@ -29,102 +29,104 @@ from __metadata__ import arch, lib_path
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
|
|
||||||
|
|
||||||
def sbo_source_dwn(name):
|
class SBoGrep(object):
|
||||||
|
'''
|
||||||
|
Class data grab
|
||||||
|
'''
|
||||||
|
def __init__(self, name):
|
||||||
|
self.name = name
|
||||||
|
arch64 = "x86_64"
|
||||||
|
self.line_name = "SLACKBUILD NAME: "
|
||||||
|
self.line_down = "SLACKBUILD DOWNLOAD: "
|
||||||
|
self.line_down_64 = "SLACKBUILD DOWNLOAD_{0}: ".format(arch64)
|
||||||
|
self.line_req = "SLACKBUILD REQUIRES: "
|
||||||
|
self.line_ver = "SLACKBUILD VERSION: "
|
||||||
|
self.line_md5 = "SLACKBUILD MD5SUM: "
|
||||||
|
self.line_md5_64 = "SLACKBUILD MD5SUM_{0}".format(arch64)
|
||||||
|
self.line_des = "SLACKBUILD SHORT DESCRIPTION: "
|
||||||
|
self.sbo_txt = lib_path + "sbo_repo/SLACKBUILDS.TXT"
|
||||||
|
|
||||||
|
def source(self):
|
||||||
'''
|
'''
|
||||||
Grab sources downloads links
|
Grab sources downloads links
|
||||||
'''
|
'''
|
||||||
if arch == "x86_64":
|
if arch == "x86_64":
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if arch == "x86_64":
|
if line.startswith(self.line_name):
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD DOWNLOAD_x86_64: "):
|
if line.startswith(self.line_down_64):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
if line[28:].strip():
|
if line[28:].strip():
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[28:].strip()
|
return line[28:].strip()
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD DOWNLOAD: "):
|
if line.startswith(self.line_down):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[21:].strip()
|
return line[21:].strip()
|
||||||
|
|
||||||
def sbo_requires_pkg(name):
|
def requires(self):
|
||||||
'''
|
'''
|
||||||
Grab package requirements
|
Grab package requirements
|
||||||
'''
|
'''
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD REQUIRES: "):
|
if line.startswith(self.line_req):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[21:].strip().split()
|
return line[21:].strip().split()
|
||||||
|
|
||||||
def sbo_build_tag(sbo_url, name):
|
def version(self):
|
||||||
# This feature is not yet used
|
|
||||||
# because the program is doing heavy on search.
|
|
||||||
# Looking for the best option to be able to use
|
|
||||||
# the BUILD tag
|
|
||||||
'''
|
'''
|
||||||
Grab .SlackBuild BUILD tag
|
Grab package version
|
||||||
'''
|
'''
|
||||||
read_info = url_read(sbo_url + name + ".SlackBuild")
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in read_info.splitlines():
|
|
||||||
if line.startswith("BUILD=${BUILD:"):
|
|
||||||
return line[15:-1].strip().split()
|
|
||||||
|
|
||||||
def sbo_version_pkg(name):
|
|
||||||
'''
|
|
||||||
Grab package verion
|
|
||||||
'''
|
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD VERSION: "):
|
if line.startswith(self.line_ver):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[20:].strip()
|
return line[20:].strip()
|
||||||
|
|
||||||
def sbo_checksum_pkg(name):
|
def checksum(self):
|
||||||
'''
|
'''
|
||||||
Grab checksum string
|
Grab checksum string
|
||||||
'''
|
'''
|
||||||
if arch == "x86_64":
|
if arch == "x86_64":
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if arch == "x86_64":
|
if line.startswith(self.line_name):
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD MD5SUM_x86_64: "):
|
if line.startswith(self.line_md5_64):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
if line[26:].strip():
|
if line[26:].strip():
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[26:].strip()
|
return line[26:].strip()
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD MD5SUM: "):
|
if line.startswith(self.line_md5):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[19:].strip()
|
return line[19:].strip()
|
||||||
|
|
||||||
def sbo_description_pkg(name):
|
def description(self):
|
||||||
'''
|
'''
|
||||||
Grab package verion
|
Grab package verion
|
||||||
'''
|
'''
|
||||||
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
|
with open(self.sbo_txt, "r") as SLACKBUILDS_TXT:
|
||||||
for line in SLACKBUILDS_TXT:
|
for line in SLACKBUILDS_TXT:
|
||||||
if line.startswith("SLACKBUILD NAME: "):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if line.startswith("SLACKBUILD SHORT DESCRIPTION: "):
|
if line.startswith(self.line_des):
|
||||||
if sbo_name == name:
|
if sbo_name == self.name:
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
return line[31:].strip()
|
return line[31:].strip()
|
||||||
|
|
|
@ -36,10 +36,10 @@ from pkg.find import find_package
|
||||||
from pkg.build import build_package
|
from pkg.build import build_package
|
||||||
from pkg.manager import PackageManager
|
from pkg.manager import PackageManager
|
||||||
|
|
||||||
|
from greps import SBoGrep
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from download import sbo_slackbuild_dwn
|
from download import sbo_slackbuild_dwn
|
||||||
from dependency import sbo_dependencies_pkg
|
from dependency import sbo_dependencies_pkg
|
||||||
from greps import sbo_source_dwn, sbo_version_pkg
|
|
||||||
|
|
||||||
|
|
||||||
def sbo_build(name):
|
def sbo_build(name):
|
||||||
|
@ -48,14 +48,21 @@ def sbo_build(name):
|
||||||
with all dependencies if version is greater than
|
with all dependencies if version is greater than
|
||||||
that established.
|
that established.
|
||||||
'''
|
'''
|
||||||
sbo_ver, pkg_arch, installs, upgraded, \
|
|
||||||
versions, requires, dependencies = ([] for i in range(7))
|
|
||||||
PKG_COLOR = DEP_COLOR = ARCH_COLOR = str()
|
|
||||||
done = "{0}Done{1}\n".format(GREY, ENDC)
|
done = "{0}Done{1}\n".format(GREY, ENDC)
|
||||||
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
||||||
sys.stdout.write(reading_lists)
|
sys.stdout.write(reading_lists)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
init = initialization()
|
init = initialization()
|
||||||
|
[
|
||||||
|
sbo_ver,
|
||||||
|
pkg_arch,
|
||||||
|
installs,
|
||||||
|
upgraded,
|
||||||
|
versions,
|
||||||
|
requires,
|
||||||
|
dependencies
|
||||||
|
] = ([] for i in range(7))
|
||||||
|
PKG_COLOR = DEP_COLOR = ARCH_COLOR = str()
|
||||||
dependencies_list = sbo_dependencies_pkg(name)
|
dependencies_list = sbo_dependencies_pkg(name)
|
||||||
try:
|
try:
|
||||||
if dependencies_list is not None or sbo_search_pkg(name) is not None:
|
if dependencies_list is not None or sbo_search_pkg(name) is not None:
|
||||||
|
@ -74,9 +81,9 @@ def sbo_build(name):
|
||||||
# Create two lists one for package version and one
|
# Create two lists one for package version and one
|
||||||
# for package arch.
|
# for package arch.
|
||||||
for pkg in dependencies:
|
for pkg in dependencies:
|
||||||
version = sbo_version_pkg(pkg)
|
version = SBoGrep(pkg).version()
|
||||||
sbo_ver.append(version)
|
sbo_ver.append(version)
|
||||||
src = sbo_source_dwn(pkg)
|
src = SBoGrep(pkg).source()
|
||||||
pkg_arch.append(select_arch(src))
|
pkg_arch.append(select_arch(src))
|
||||||
sbo_pkg = ("{0}-{1}".format(pkg, version))
|
sbo_pkg = ("{0}-{1}".format(pkg, version))
|
||||||
if find_package(sbo_pkg, pkg_path):
|
if find_package(sbo_pkg, pkg_path):
|
||||||
|
@ -139,7 +146,7 @@ def sbo_build(name):
|
||||||
# before proceed to install
|
# before proceed to install
|
||||||
UNST = ["UNSUPPORTED", "UNTESTED"]
|
UNST = ["UNSUPPORTED", "UNTESTED"]
|
||||||
if src in UNST:
|
if src in UNST:
|
||||||
print("\n{0}The package {1}{2}\n".format(RED, src, ENDC))
|
print("{0}The package {1}{2}\n".format(RED, src, ENDC))
|
||||||
read = ""
|
read = ""
|
||||||
# exit if all packages already installed
|
# exit if all packages already installed
|
||||||
elif pkg_sum == len(dependencies):
|
elif pkg_sum == len(dependencies):
|
||||||
|
@ -161,7 +168,7 @@ def sbo_build(name):
|
||||||
else:
|
else:
|
||||||
sbo_url = sbo_search_pkg(pkg)
|
sbo_url = sbo_search_pkg(pkg)
|
||||||
sbo_link = sbo_slackbuild_dwn(sbo_url)
|
sbo_link = sbo_slackbuild_dwn(sbo_url)
|
||||||
src_link = sbo_source_dwn(pkg).split()
|
src_link = SBoGrep(pkg).source().split()
|
||||||
script = sbo_link.split("/")[-1] # get file from script
|
script = sbo_link.split("/")[-1] # get file from script
|
||||||
Download(build_path, sbo_link).start()
|
Download(build_path, sbo_link).start()
|
||||||
sources = []
|
sources = []
|
||||||
|
@ -236,8 +243,8 @@ def sbo_build(name):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
toolbar_width += 6
|
toolbar_width += 6
|
||||||
sbo_matching.append(sbo_name)
|
sbo_matching.append(sbo_name)
|
||||||
sbo_ver.append(sbo_version_pkg(sbo_name))
|
sbo_ver.append(SBoGrep(sbo_name).version())
|
||||||
src = sbo_source_dwn(sbo_name)
|
src = SBoGrep(sbo_name).source()
|
||||||
pkg_arch.append(select_arch(src))
|
pkg_arch.append(select_arch(src))
|
||||||
SLACKBUILDS_TXT.close()
|
SLACKBUILDS_TXT.close()
|
||||||
sys.stdout.write(done)
|
sys.stdout.write(done)
|
||||||
|
|
81
slpkg/sbo/tracking.py
Executable file
81
slpkg/sbo/tracking.py
Executable file
|
@ -0,0 +1,81 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# tracking.py file is part of slpkg.
|
||||||
|
|
||||||
|
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||||
|
# All rights reserved.
|
||||||
|
|
||||||
|
# Utility for easy management packages in Slackware
|
||||||
|
|
||||||
|
# https://github.com/dslackw/slpkg
|
||||||
|
|
||||||
|
# Slpkg 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.
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from colors import *
|
||||||
|
from messages import template
|
||||||
|
from init import initialization
|
||||||
|
from __metadata__ import pkg_path, sp
|
||||||
|
|
||||||
|
from dependency import sbo_dependencies_pkg
|
||||||
|
|
||||||
|
from pkg.find import find_package
|
||||||
|
|
||||||
|
|
||||||
|
def track_dep(name):
|
||||||
|
'''
|
||||||
|
View tree of dependencies and also
|
||||||
|
highlight packages with color green
|
||||||
|
if allready installed and color red
|
||||||
|
if not installed.
|
||||||
|
'''
|
||||||
|
done = "{0}Done{1}\n".format(GREY, ENDC)
|
||||||
|
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
||||||
|
sys.stdout.write(reading_lists)
|
||||||
|
sys.stdout.flush()
|
||||||
|
init = initialization()
|
||||||
|
dependencies_list = sbo_dependencies_pkg(name)
|
||||||
|
if dependencies_list is not None:
|
||||||
|
sys.stdout.write(done)
|
||||||
|
requires, dependencies = [], []
|
||||||
|
# Create one list for all packages
|
||||||
|
for pkg in dependencies_list:
|
||||||
|
requires += pkg
|
||||||
|
requires.reverse()
|
||||||
|
# Remove double dependencies
|
||||||
|
for duplicate in requires:
|
||||||
|
if duplicate not in dependencies:
|
||||||
|
dependencies.append(duplicate)
|
||||||
|
if dependencies == []:
|
||||||
|
dependencies = ["No dependencies"]
|
||||||
|
pkg_len = len(name) + 24
|
||||||
|
print # new line at start
|
||||||
|
template(pkg_len)
|
||||||
|
print("| Package {0}{1}{2} dependencies :".format(CYAN, name, ENDC))
|
||||||
|
template(pkg_len)
|
||||||
|
print("\\")
|
||||||
|
print(" +---{0}[ Tree of dependencies ]{1}".format(YELLOW, ENDC))
|
||||||
|
index = int()
|
||||||
|
for pkg in dependencies:
|
||||||
|
index += 1
|
||||||
|
if find_package(pkg + sp, pkg_path):
|
||||||
|
print(" |")
|
||||||
|
print(" {0}{1}: {2}{3}{4}".format("+--", index, GREEN, pkg, ENDC))
|
||||||
|
else:
|
||||||
|
print(" |")
|
||||||
|
print(" {0}{1}: {2}{3}{4}".format("+--", index, RED, pkg, ENDC))
|
||||||
|
print # new line at end
|
||||||
|
else:
|
||||||
|
sys.stdout.write(done)
|
||||||
|
print("\nNo package was found to match\n")
|
|
@ -29,7 +29,7 @@ from colors import *
|
||||||
from init import initialization
|
from init import initialization
|
||||||
from downloader import Download
|
from downloader import Download
|
||||||
from __metadata__ import tmp, build_path, pkg_path, sp
|
from __metadata__ import tmp, build_path, pkg_path, sp
|
||||||
from messages import (pkg_not_found, pkg_found, view_sbo,
|
from messages import (pkg_found, view_sbo,
|
||||||
template, build_FAILED)
|
template, build_FAILED)
|
||||||
|
|
||||||
from pkg.build import build_package
|
from pkg.build import build_package
|
||||||
|
@ -37,7 +37,7 @@ from pkg.find import find_package
|
||||||
from pkg.manager import PackageManager
|
from pkg.manager import PackageManager
|
||||||
|
|
||||||
from read import *
|
from read import *
|
||||||
from greps import *
|
from greps import SBoGrep
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from download import sbo_slackbuild_dwn
|
from download import sbo_slackbuild_dwn
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ def sbo_network(name):
|
||||||
init = initialization()
|
init = initialization()
|
||||||
sbo_url = sbo_search_pkg(name)
|
sbo_url = sbo_search_pkg(name)
|
||||||
if sbo_url:
|
if sbo_url:
|
||||||
sbo_desc = sbo_description_pkg(name)[len(name) + 2:-1]
|
sbo_desc = SBoGrep(name).description()[len(name) + 2:-1]
|
||||||
sbo_req = sbo_requires_pkg(name)
|
sbo_req = SBoGrep(name).requires()
|
||||||
sbo_dwn = sbo_slackbuild_dwn(sbo_url)
|
sbo_dwn = sbo_slackbuild_dwn(sbo_url)
|
||||||
source_dwn = sbo_source_dwn(name).split()
|
source_dwn = SBoGrep(name).source().split()
|
||||||
sys.stdout.write(done)
|
sys.stdout.write(done)
|
||||||
view_sbo(name, sbo_url, sbo_desc, sbo_dwn.split("/")[-1], \
|
view_sbo(name, sbo_url, sbo_desc, sbo_dwn.split("/")[-1], \
|
||||||
", ".join([src.split("/")[-1] for src in source_dwn]), \
|
", ".join([src.split("/")[-1] for src in source_dwn]), \
|
||||||
|
@ -110,7 +110,7 @@ def sbo_network(name):
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if not os.path.exists(build_path):
|
if not os.path.exists(build_path):
|
||||||
os.mkdir(build_path)
|
os.mkdir(build_path)
|
||||||
sbo_version = sbo_version_pkg(name)
|
sbo_version = SBoGrep(name).version()
|
||||||
prgnam = ("{0}-{1}".format(name, sbo_version))
|
prgnam = ("{0}-{1}".format(name, sbo_version))
|
||||||
if find_package(prgnam + sp, pkg_path) == []:
|
if find_package(prgnam + sp, pkg_path) == []:
|
||||||
sources = []
|
sources = []
|
||||||
|
@ -145,5 +145,4 @@ def sbo_network(name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sys.stdout.write (done)
|
sys.stdout.write (done)
|
||||||
message = "From slackbuilds.org"
|
print("\nNo package was found to match\n")
|
||||||
pkg_not_found("\n", name, message, "\n")
|
|
||||||
|
|
|
@ -44,13 +44,20 @@ def install(slack_pkg, version):
|
||||||
Install packages from official Slackware distribution
|
Install packages from official Slackware distribution
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
pkg_sum = uni_sum = upg_sum = int()
|
|
||||||
comp_sum, uncomp_sum, names, dwn_list, comp_size, \
|
|
||||||
uncomp_size, install_all, package_name, \
|
|
||||||
package_location = ([] for i in range(9))
|
|
||||||
done = "{0}Done{1}\n".format(GREY, ENDC)
|
done = "{0}Done{1}\n".format(GREY, ENDC)
|
||||||
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
||||||
|
[
|
||||||
|
comp_sum,
|
||||||
|
uncomp_sum,
|
||||||
|
names, dwn_list,
|
||||||
|
comp_size,
|
||||||
|
uncomp_size,
|
||||||
|
install_all,
|
||||||
|
package_name,
|
||||||
|
package_location
|
||||||
|
] = ([] for i in range(9))
|
||||||
arch = COLOR = str()
|
arch = COLOR = str()
|
||||||
|
pkg_sum = uni_sum = upg_sum = int()
|
||||||
# create directories if not exists
|
# create directories if not exists
|
||||||
tmp_path = slpkg_tmp + "packages/"
|
tmp_path = slpkg_tmp + "packages/"
|
||||||
if not os.path.exists(slpkg_tmp):
|
if not os.path.exists(slpkg_tmp):
|
||||||
|
|
|
@ -45,11 +45,19 @@ def patches(version):
|
||||||
Install new patches from official Slackware mirrors
|
Install new patches from official Slackware mirrors
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
slack_arch = str()
|
|
||||||
comp_sum, uncomp_sum, dwn_patches, comp_size, uncomp_size, \
|
|
||||||
upgrade_all, package_name, package_location = ([] for i in range(8))
|
|
||||||
done = "{0}Done{1}\n".format(GREY, ENDC)
|
done = "{0}Done{1}\n".format(GREY, ENDC)
|
||||||
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
reading_lists = "{0}Reading package lists ...{1}".format(GREY, ENDC)
|
||||||
|
[
|
||||||
|
comp_sum,
|
||||||
|
uncomp_sum,
|
||||||
|
dwn_patches,
|
||||||
|
comp_size,
|
||||||
|
uncomp_size,
|
||||||
|
upgrade_all,
|
||||||
|
package_name,
|
||||||
|
package_location
|
||||||
|
] = ([] for i in range(8))
|
||||||
|
slack_arch = str()
|
||||||
patch_path = slpkg_tmp + "patches/"
|
patch_path = slpkg_tmp + "patches/"
|
||||||
if not os.path.exists(slpkg_tmp):
|
if not os.path.exists(slpkg_tmp):
|
||||||
os.mkdir(slpkg_tmp)
|
os.mkdir(slpkg_tmp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue