mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
updated for version 1.4.2
This commit is contained in:
parent
519756c8f4
commit
ef3bd795eb
5 changed files with 153 additions and 188 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
03-06-2014
|
||||||
|
Version 1.4.2
|
||||||
|
|
||||||
|
[Updated] - Fix to avoid build package if already installed
|
||||||
|
[Updated] - Fix not download if file already installed
|
||||||
|
|
||||||
|
|
||||||
31-05-2014
|
31-05-2014
|
||||||
Version 1.4.1
|
Version 1.4.1
|
||||||
|
|
||||||
|
|
2
PKG-INFO
2
PKG-INFO
|
@ -1,6 +1,6 @@
|
||||||
Metadata-Version: 1.1
|
Metadata-Version: 1.1
|
||||||
Name: slpkg
|
Name: slpkg
|
||||||
Version: 1.4.1
|
Version: 1.4.2
|
||||||
Author: dslackw
|
Author: dslackw
|
||||||
Author-email: d zlatanidis at gmail com
|
Author-email: d zlatanidis at gmail com
|
||||||
Maintainer: dslackw
|
Maintainer: dslackw
|
||||||
|
|
|
@ -185,10 +185,6 @@ Find slackbuild from network (www.slackbuilds.org):
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|
||||||
This find the slackbuild , source, extra downloads and package requirements !!!
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ slpkg -n bitfighter
|
$ slpkg -n bitfighter
|
||||||
Searching `bitfighter` from slackbuilds.org ...
|
Searching `bitfighter` from slackbuilds.org ...
|
||||||
|
|
||||||
|
|
258
bin/slpkg
258
bin/slpkg
|
@ -51,7 +51,7 @@ import subprocess
|
||||||
|
|
||||||
|
|
||||||
__author__ = "dslackw"
|
__author__ = "dslackw"
|
||||||
__version__ = "1.4.1"
|
__version__ = "1.4.2"
|
||||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||||
__email__ = "d.zlatanidis@gmail.com"
|
__email__ = "d.zlatanidis@gmail.com"
|
||||||
|
|
||||||
|
@ -81,7 +81,6 @@ dep_results = []
|
||||||
dep_links_results = []
|
dep_links_results = []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# SlackBuilds repository link
|
# SlackBuilds repository link
|
||||||
SBo_url = "http://slackbuilds.org/repository/14.1/"
|
SBo_url = "http://slackbuilds.org/repository/14.1/"
|
||||||
|
|
||||||
|
@ -211,7 +210,7 @@ def SBo_search_pkg(name):
|
||||||
find_SBo = re.findall(search_name, url_read(SBo_url_sub))
|
find_SBo = re.findall(search_name, url_read(SBo_url_sub))
|
||||||
|
|
||||||
find_SBo = " ".join(find_SBo) # convert list to string
|
find_SBo = " ".join(find_SBo) # convert list to string
|
||||||
find_SBo = rmv_unused(find_SBo) # remove unused chars > < from find
|
find_SBo = rmv_unused(find_SBo) # remove unused chars '> <'
|
||||||
|
|
||||||
# find sub-category
|
# find sub-category
|
||||||
if name in find_SBo:
|
if name in find_SBo:
|
||||||
|
@ -251,12 +250,6 @@ def SBo_source_dwn(SBo_url, name):
|
||||||
line = line[10:-1]
|
line = line[10:-1]
|
||||||
|
|
||||||
return line
|
return line
|
||||||
if arch != "x86_64":
|
|
||||||
for line in read_info.splitlines():
|
|
||||||
if line.startswith('DOWNLOAD='):
|
|
||||||
line = line[10:-1]
|
|
||||||
|
|
||||||
return line
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -298,19 +291,18 @@ def SBo_dependencies_pkg(name):
|
||||||
if name == "%README%": # avoid to search %README% as dependency
|
if name == "%README%": # avoid to search %README% as dependency
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
find_SBo_url = SBo_search_pkg(name)
|
SBo_url = SBo_search_pkg(name)
|
||||||
if find_SBo_url == None:
|
if SBo_url == None:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
||||||
colors.CYAN, name, colors.RED, colors.ENDC))
|
colors.CYAN, name, colors.RED, colors.ENDC))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
|
SBo_req = SBo_requires_pkg(SBo_url, name)
|
||||||
dependencies = find_SBo_req.split() # convert string to list
|
dependencies = SBo_req.split() # convert string to list
|
||||||
|
|
||||||
if dependencies == []:
|
if dependencies == []:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
dep_results.append(dependencies)
|
dep_results.append(dependencies)
|
||||||
|
|
||||||
|
@ -328,42 +320,37 @@ def SBo_dependencies_links_pkg(name):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
||||||
find_SBo_url = SBo_search_pkg(name)
|
SBo_url = SBo_search_pkg(name)
|
||||||
|
|
||||||
if find_SBo_url == None:
|
if SBo_url == None:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
||||||
colors.CYAN, name, colors.RED, colors.ENDC))
|
colors.CYAN, name, colors.RED, colors.ENDC))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
find_version = SBo_version_pkg(find_SBo_url, name)
|
version = SBo_version_pkg(SBo_url, name).split()
|
||||||
find_SBo_dwn = SBo_slackbuild_dwn(find_SBo_url, name)
|
SBo_dwn = SBo_slackbuild_dwn(SBo_url, name).split()
|
||||||
find_source_dwn = SBo_source_dwn(find_SBo_url, name)
|
source_dwn = SBo_source_dwn(SBo_url, name).split()
|
||||||
find_extra_dwn = SBo_extra_dwn(find_SBo_url, name)
|
extra_dwn = SBo_extra_dwn(SBo_url, name)
|
||||||
find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
|
SBo_req = SBo_requires_pkg(SBo_url, name).split()
|
||||||
|
|
||||||
# create flag to know how much extra source there are
|
# create flag to know how much extra source there are
|
||||||
if find_extra_dwn != []:
|
if extra_dwn != []:
|
||||||
flag = ("extra" + str(len(find_extra_dwn))).split()
|
flag = ("extra" + str(len(extra_dwn))).split()
|
||||||
dep_links_results.append(flag)
|
dep_links_results.append(flag)
|
||||||
|
|
||||||
version = find_version.split()
|
dep_links_results.append(extra_dwn)
|
||||||
SBo_dwn = find_SBo_dwn.split()
|
|
||||||
source_dwn = find_source_dwn.split()
|
|
||||||
dependencies = find_SBo_req.split()
|
|
||||||
|
|
||||||
dep_links_results.append(find_extra_dwn)
|
|
||||||
dep_links_results.append(version)
|
dep_links_results.append(version)
|
||||||
dep_links_results.append(source_dwn)
|
dep_links_results.append(source_dwn)
|
||||||
dep_links_results.append(SBo_dwn)
|
dep_links_results.append(SBo_dwn)
|
||||||
|
|
||||||
if dependencies == []:
|
if SBo_req == []:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
dep_links_results.append(dependencies)
|
dep_links_results.append(SBo_req)
|
||||||
|
|
||||||
for line in dependencies:
|
for line in SBo_req:
|
||||||
print
|
print
|
||||||
SBo_dependencies_links_pkg(line)
|
SBo_dependencies_links_pkg(line)
|
||||||
|
|
||||||
|
@ -520,11 +507,11 @@ def pkg_list(name):
|
||||||
|
|
||||||
# find all dependencies
|
# find all dependencies
|
||||||
def pkg_tracking(name):
|
def pkg_tracking(name):
|
||||||
find_dependencies = SBo_dependencies_pkg(name)
|
dependencies = SBo_dependencies_pkg(name)
|
||||||
if find_dependencies == None:
|
if dependencies == None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif find_dependencies == []:
|
elif dependencies == []:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{}No dependencies\n{}".format(colors.GREEN, colors.ENDC))
|
print ("{}No dependencies\n{}".format(colors.GREEN, colors.ENDC))
|
||||||
else:
|
else:
|
||||||
|
@ -534,12 +521,12 @@ def pkg_tracking(name):
|
||||||
print ("| {}`{}' {}dependencies :{}".format(colors.CYAN, name,
|
print ("| {}`{}' {}dependencies :{}".format(colors.CYAN, name,
|
||||||
colors.YELLOW, colors.ENDC))
|
colors.YELLOW, colors.ENDC))
|
||||||
print ("+" + "=" * pkg_len)
|
print ("+" + "=" * pkg_len)
|
||||||
find_dependencies.reverse()
|
dependencies.reverse()
|
||||||
|
|
||||||
|
|
||||||
print (" |")
|
print (" |")
|
||||||
for i in range(len(find_dependencies)):
|
for i in range(len(dependencies)):
|
||||||
found = " --", str(len(find_dependencies[i])), " ".join(find_dependencies[i])
|
found = " --", str(len(dependencies[i])), " ".join(dependencies[i])
|
||||||
print (" |")
|
print (" |")
|
||||||
print " ".join(found)
|
print " ".join(found)
|
||||||
print
|
print
|
||||||
|
@ -548,36 +535,35 @@ def pkg_tracking(name):
|
||||||
|
|
||||||
# find from SBo repositority www.slackbuild.org
|
# find from SBo repositority www.slackbuild.org
|
||||||
def SBo_network(name):
|
def SBo_network(name):
|
||||||
find_SBo_url = SBo_search_pkg(name)
|
SBo_url = SBo_search_pkg(name)
|
||||||
if find_SBo_url == None:
|
if SBo_url == None:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
print ("{}The {}'{}'{} not found{}\n".format(colors.RED,
|
||||||
colors.CYAN, name, colors.RED, colors.ENDC))
|
colors.CYAN, name, colors.RED, colors.ENDC))
|
||||||
else:
|
else:
|
||||||
# call sbo functions
|
# call sbo functions
|
||||||
find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
|
SBo_req = SBo_requires_pkg(SBo_url, name)
|
||||||
find_SBo_dwn = SBo_slackbuild_dwn(find_SBo_url, name)
|
SBo_dwn = SBo_slackbuild_dwn(SBo_url, name)
|
||||||
find_source_dwn = SBo_source_dwn(find_SBo_url, name)
|
source_dwn = SBo_source_dwn(SBo_url, name)
|
||||||
find_extra_dwn = SBo_extra_dwn(find_SBo_url, name)
|
extra_dwn = "".join(SBo_extra_dwn(SBo_url, name))
|
||||||
find_extra_dwn = " ".join(find_extra_dwn) # convert list to string
|
|
||||||
|
|
||||||
# caclulate the length of the link
|
# caclulate the length of the link
|
||||||
SBo_name_len = len(name)
|
SBo_name_len = len(name)
|
||||||
SBo_url_len = (len(find_SBo_url) + SBo_name_len + 21)
|
SBo_url_len = (len(SBo_url) + SBo_name_len + 21)
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("+" + "=" * SBo_url_len)
|
print ("+" + "=" * SBo_url_len)
|
||||||
print ("| {}The {}`{}`{} found in --> {}".format(colors.GREEN,
|
print ("| {}The {}`{}`{} found in --> {}".format(colors.GREEN,
|
||||||
colors.CYAN, name, colors.GREEN,
|
colors.CYAN, name, colors.GREEN,
|
||||||
colors.ENDC + find_SBo_url))
|
colors.ENDC + SBo_url))
|
||||||
print ("+" + "=" * SBo_url_len)
|
print ("+" + "=" * SBo_url_len)
|
||||||
print ("| {}Download SlackBuild : {}{}".format(colors.GREEN,
|
print ("| {}Download SlackBuild : {}{}".format(colors.GREEN,
|
||||||
colors.ENDC, find_SBo_dwn))
|
colors.ENDC, SBo_dwn))
|
||||||
print ("| {}Source Downloads : {}{}".format(colors.GREEN,
|
print ("| {}Source Downloads : {}{}".format(colors.GREEN,
|
||||||
colors.ENDC, find_source_dwn))
|
colors.ENDC, source_dwn))
|
||||||
print ("| {}Extra Downloads : {}{}".format(colors.GREEN,
|
print ("| {}Extra Downloads : {}{}".format(colors.GREEN,
|
||||||
colors.ENDC, find_extra_dwn))
|
colors.ENDC, extra_dwn))
|
||||||
print ("| {}Package requirements : {}{}".format(colors.YELLOW,
|
print ("| {}Package requirements : {}{}".format(colors.YELLOW,
|
||||||
colors.ENDC, find_SBo_req))
|
colors.ENDC, SBo_req))
|
||||||
print ("+" + "=" * SBo_url_len)
|
print ("+" + "=" * SBo_url_len)
|
||||||
print (" {}R{}EADME View the README file".format(colors.RED, colors.ENDC))
|
print (" {}R{}EADME View the README file".format(colors.RED, colors.ENDC))
|
||||||
print (" {}S{}lackBuild View the SlackBuild file".format(colors.RED, colors.ENDC))
|
print (" {}S{}lackBuild View the SlackBuild file".format(colors.RED, colors.ENDC))
|
||||||
|
@ -590,56 +576,56 @@ def SBo_network(name):
|
||||||
if read == "D" or read == "d":
|
if read == "D" or read == "d":
|
||||||
print
|
print
|
||||||
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
|
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
|
||||||
os.system("wget " + find_SBo_dwn)
|
os.system("wget -nc " + SBo_dwn)
|
||||||
os.system("wget " + find_source_dwn)
|
os.system("wget -nc " + source_dwn)
|
||||||
|
|
||||||
if find_extra_dwn == "":
|
if extra_dwn == "":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
os.system("wget " + find_extra_dwn)
|
os.system("wget " + extra_dwn)
|
||||||
|
|
||||||
|
|
||||||
print ("{}Use {}`slpkg -s`{} to build this package{}\n".format(colors.YELLOW,
|
print ("{}Use {}`slpkg -a`{} to build this package{}\n".format(colors.YELLOW,
|
||||||
colors.CYAN, colors.YELLOW, colors.ENDC))
|
colors.CYAN, colors.YELLOW, colors.ENDC))
|
||||||
break
|
break
|
||||||
|
|
||||||
elif read == "R" or read == "r":
|
elif read == "R" or read == "r":
|
||||||
site = "README"
|
site = "README"
|
||||||
read_readme(find_SBo_url, name, site)
|
read_readme(SBo_url, name, site)
|
||||||
os.system("less /tmp/slpkg/readme/" + name + ".{}".format(site))
|
os.system("less /tmp/slpkg/readme/" + name + ".{}".format(site))
|
||||||
|
|
||||||
elif read == "I" or read == "i":
|
elif read == "I" or read == "i":
|
||||||
site = ".info"
|
site = ".info"
|
||||||
read_info_slackbuild(find_SBo_url, name, site)
|
read_info_slackbuild(SBo_url, name, site)
|
||||||
os.system("less /tmp/slpkg/readme/" + name + "{}".format(site))
|
os.system("less /tmp/slpkg/readme/" + name + "{}".format(site))
|
||||||
|
|
||||||
elif read == "S" or read == "s":
|
elif read == "S" or read == "s":
|
||||||
site = ".SlackBuild"
|
site = ".SlackBuild"
|
||||||
read_info_slackbuild(find_SBo_url, name, site)
|
read_info_slackbuild(SBo_url, name, site)
|
||||||
os.system("less /tmp/slpkg/readme/" + name + "{}".format(site))
|
os.system("less /tmp/slpkg/readme/" + name + "{}".format(site))
|
||||||
|
|
||||||
elif read == "B" or read == "b":
|
elif read == "B" or read == "b":
|
||||||
s_user(getpass.getuser())
|
s_user(getpass.getuser())
|
||||||
script = get_file(find_SBo_dwn, "/")
|
script = get_file(SBo_dwn, "/")
|
||||||
source = get_file(find_source_dwn, "/")
|
source = get_file(source_dwn, "/")
|
||||||
print
|
print
|
||||||
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
|
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
|
||||||
os.system("wget " + find_SBo_dwn)
|
os.system("wget -nc " + SBo_dwn)
|
||||||
os.system("wget " + find_source_dwn)
|
os.system("wget -nc " + source_dwn)
|
||||||
|
|
||||||
if find_extra_dwn == "":
|
if extra_dwn == "":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
os.system("wget " + find_extra_dwn)
|
os.system("wget -nc " + extra_dwn)
|
||||||
find_extra_dwn = find_extra_dwn.split() # convert str to list
|
extra_dwn = extra_dwn.split() # convert str to list
|
||||||
if len(find_extra_dwn) == 1:
|
if len(find_extra_dwn) == 1:
|
||||||
extra = get_file(find_extra_dwn[0], "/")
|
extra = get_file(extra_dwn[0], "/")
|
||||||
build_extra_pkg(script, source, extra)
|
build_extra_pkg(script, source, extra)
|
||||||
break
|
break
|
||||||
|
|
||||||
elif len(find_extra_dwn) == 2:
|
elif len(extra_dwn) == 2:
|
||||||
extra = get_file(find_extra_dwn[0], "/")
|
extra = get_file(extra_dwn[0], "/")
|
||||||
extra2 = get_file(find_extra_dwn[1], "/")
|
extra2 = get_file(extra_dwn[1], "/")
|
||||||
build_extra2_pkg(script, source, extra, extra2)
|
build_extra2_pkg(script, source, extra, extra2)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@ -666,23 +652,23 @@ def SBo_check(name):
|
||||||
colors.CYAN, name, colors.RED, colors.ENDC))
|
colors.CYAN, name, colors.RED, colors.ENDC))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
find_SBo_url = SBo_search_pkg(name)
|
SBo_url = SBo_search_pkg(name)
|
||||||
if find_SBo_url == None:
|
if SBo_url == None:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{}The {}`{}`{} not found{}\n".format(colors.RED,
|
print ("{}The {}`{}`{} not found{}\n".format(colors.RED,
|
||||||
colors.CYAN, name, colors.RED, colors.ENDC))
|
colors.CYAN, name, colors.RED, colors.ENDC))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
find_SBo_version = SBo_version_pkg(find_SBo_url, name)
|
SBo_version = SBo_version_pkg(SBo_url, name)
|
||||||
name_len = len(name)
|
name_len = len(name)
|
||||||
arch_len = len(arch)
|
arch_len = len(arch)
|
||||||
SBo_file = SBo_file[name_len+1:-arch_len-7]
|
SBo_file = SBo_file[name_len+1:-arch_len-7]
|
||||||
|
|
||||||
if find_SBo_version > SBo_file:
|
if SBo_version > SBo_file:
|
||||||
print ("\n")
|
print ("\n")
|
||||||
print ("{} New version is available !!!{}".format(colors.YELLOW, colors.ENDC))
|
print ("{} New version is available !!!{}".format(colors.YELLOW, colors.ENDC))
|
||||||
print ("+" + "=" * 50)
|
print ("+" + "=" * 50)
|
||||||
print ("| {} {}".format(name, find_SBo_version))
|
print ("| {} {}".format(name, SBo_version))
|
||||||
print ("+" + "=" * 50)
|
print ("+" + "=" * 50)
|
||||||
print
|
print
|
||||||
|
|
||||||
|
@ -695,17 +681,17 @@ def SBo_check(name):
|
||||||
# find package and dependencies download, build and install
|
# find package and dependencies download, build and install
|
||||||
def SBo_build(name):
|
def SBo_build(name):
|
||||||
s_user(getpass.getuser())
|
s_user(getpass.getuser())
|
||||||
find_dependencies_links = SBo_dependencies_links_pkg(name)
|
dependencies_links = SBo_dependencies_links_pkg(name)
|
||||||
|
|
||||||
|
|
||||||
if find_dependencies_links == None:
|
if dependencies_links == None:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
elif find_dependencies_links != []:
|
elif dependencies_links != []:
|
||||||
results = []
|
results = []
|
||||||
for i in range(len(find_dependencies_links)):
|
for i in range(len(dependencies_links)):
|
||||||
for j in range(len(find_dependencies_links[i])):
|
for j in range(len(dependencies_links[i])):
|
||||||
results.append(find_dependencies_links[i][j])
|
results.append(dependencies_links[i][j])
|
||||||
|
|
||||||
|
|
||||||
# grep only links from list
|
# grep only links from list
|
||||||
|
@ -722,6 +708,7 @@ def SBo_build(name):
|
||||||
if ver.startswith(str(i)):
|
if ver.startswith(str(i)):
|
||||||
version.append(ver)
|
version.append(ver)
|
||||||
|
|
||||||
|
|
||||||
# upside-down lists
|
# upside-down lists
|
||||||
version .reverse()
|
version .reverse()
|
||||||
dwn_link.reverse()
|
dwn_link.reverse()
|
||||||
|
@ -732,8 +719,7 @@ def SBo_build(name):
|
||||||
for i in range(len(dwn_link)):
|
for i in range(len(dwn_link)):
|
||||||
files.append(get_file(dwn_link[i], "/"))
|
files.append(get_file(dwn_link[i], "/"))
|
||||||
|
|
||||||
|
# removes archive type
|
||||||
# removes archives type
|
|
||||||
filename = []
|
filename = []
|
||||||
y = 0
|
y = 0
|
||||||
for i in range(len(files) / 2):
|
for i in range(len(files) / 2):
|
||||||
|
@ -743,79 +729,66 @@ def SBo_build(name):
|
||||||
filename.append(file)
|
filename.append(file)
|
||||||
y += 2
|
y += 2
|
||||||
|
|
||||||
elif files[y].endswith("tar.bz2"):
|
|
||||||
file = files[y]
|
|
||||||
file = file[:-8]
|
|
||||||
filename.append(file)
|
|
||||||
y += 2
|
|
||||||
|
|
||||||
elif files[y].endswith("zip"):
|
|
||||||
file = files[y]
|
|
||||||
file = file[:-4]
|
|
||||||
filename.append(file)
|
|
||||||
y += 2
|
|
||||||
|
|
||||||
elif files[y].endswith("tar.xz"):
|
|
||||||
file = files[y]
|
|
||||||
file = file[:-7]
|
|
||||||
filename.append(file)
|
|
||||||
y += 2
|
|
||||||
|
|
||||||
|
|
||||||
# link sbo filename with version
|
# link sbo filename with version
|
||||||
filename_version = []
|
filename_version = []
|
||||||
for i in range(len(filename)):
|
for i in range(len(filename)):
|
||||||
filename_version.append(filename[i] + "-" + version[i])
|
filename_version.append(filename[i] + "-" + version[i])
|
||||||
|
|
||||||
wget_links = set(dwn_link) # remove duplicate links
|
|
||||||
|
|
||||||
# dwonload links
|
|
||||||
for link in wget_links:
|
# remove packages links if already installed
|
||||||
if find_package(filename_version[i], packages) == []:
|
i = 0
|
||||||
os.system("wget {}".format(link))
|
for file in filename_version:
|
||||||
print
|
if find_package(file, packages) == []:
|
||||||
print ("{}Start --> \n{}".format(colors.GREEN, colors.ENDC))
|
i += 2
|
||||||
|
else:
|
||||||
|
for j in range(0, 2):
|
||||||
|
dwn_link.pop(i)
|
||||||
|
files.pop(i)
|
||||||
|
|
||||||
|
# create list with packages for install
|
||||||
|
pkg_for_install = []
|
||||||
|
i = 0
|
||||||
|
for i in range(len(filename_version)):
|
||||||
|
if find_package(filename_version[i], packages) == []:
|
||||||
|
pkg_for_install.append(filename_version[i])
|
||||||
else:
|
else:
|
||||||
print
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
dwn_link = set(dwn_link) # remove double links
|
||||||
|
|
||||||
|
# dwonload links
|
||||||
|
for link in dwn_link:
|
||||||
|
print
|
||||||
|
print ("{}Start --> \n{}".format(colors.GREEN, colors.ENDC))
|
||||||
|
os.system("wget -nc {}".format(link))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print ("\n")
|
||||||
# build packages and store slackware files in /tmp directory
|
# build packages and store slackware files in /tmp directory
|
||||||
if results[0] == "extra1": # check how many extra sources
|
if results[0] == "extra1": # check how many extra sources
|
||||||
|
|
||||||
for i in range(len(files) / 2):
|
for i in range(len(files) / 2):
|
||||||
if len(files) < 4:
|
if len(files) < 4:
|
||||||
if find_package(filename_version[i], packages) == []:
|
|
||||||
script = files[0]
|
script = files[0]
|
||||||
source = files[1]
|
source = files[1]
|
||||||
extra = files[2]
|
extra = files[2]
|
||||||
build_extra_pkg(script, source, extra)
|
build_extra_pkg(script, source, extra)
|
||||||
|
|
||||||
install_pkg = tmp + filename_version[i] + SBo_arch + SBo_tag + SBo_filetype
|
install_pkg = tmp + pkg_for_install[i] + SBo_arch + SBo_tag + SBo_filetype
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
|
||||||
print
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
if find_package(filename_version[i], packages) == []:
|
|
||||||
script = files[0]
|
script = files[0]
|
||||||
source = files[1]
|
source = files[1]
|
||||||
build_package(script, source)
|
build_package(script, source)
|
||||||
|
|
||||||
install_pkg = tmp + filename_version[i] + SBo_arch + SBo_tag + SBo_filetype
|
install_pkg = tmp + pkg_for_install[i] + SBo_arch + SBo_tag + SBo_filetype
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
|
||||||
print
|
|
||||||
|
|
||||||
for j in range(0, 2):
|
for j in range(0, 2):
|
||||||
files.pop(0)
|
files.pop(0)
|
||||||
|
|
||||||
|
@ -824,60 +797,49 @@ def SBo_build(name):
|
||||||
|
|
||||||
for i in range(len(files) / 2):
|
for i in range(len(files) / 2):
|
||||||
if len(files) < 5:
|
if len(files) < 5:
|
||||||
if find_package(filename_version[i], packages) == []:
|
|
||||||
script = files[0]
|
script = files[0]
|
||||||
source = files[1]
|
source = files[1]
|
||||||
extra = files[2]
|
extra = files[2]
|
||||||
extra2 = files[3]
|
extra2 = files[3]
|
||||||
build_extra2_pkg(script, source, extra, extra2)
|
build_extra2_pkg(script, source, extra, extra2)
|
||||||
|
|
||||||
install_pkg = tmp + filename_version[i] + SBo_arch + SBo_tag + SBo_filetype
|
install_pkg = tmp + pkg_for_install[i] + SBo_arch + SBo_tag + SBo_filetype
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
|
||||||
print
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
if find_package(filename_version[i], packages) == []:
|
|
||||||
script = files[0]
|
script = files[0]
|
||||||
source = files[1]
|
source = files[1]
|
||||||
build_package(script, source)
|
build_package(script, source)
|
||||||
|
|
||||||
install_pkg = tmp + filename_version[i] + SBo_arch + SBo_tag + SBo_filetype
|
install_pkg = tmp + pkg_for_install[i] + SBo_arch + SBo_tag + SBo_filetype
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
else:
|
|
||||||
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
|
||||||
print
|
|
||||||
|
|
||||||
for j in range(0, 2):
|
for j in range(0, 2):
|
||||||
files.pop(0)
|
files.pop(0)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
for i in range(len(files) / 2):
|
for i in range(len(files) / 2):
|
||||||
|
|
||||||
if find_package(filename_version[i], packages) == []:
|
|
||||||
script = files[0]
|
script = files[0]
|
||||||
source = files[1]
|
source = files[1]
|
||||||
build_package(script, source)
|
build_package(script, source)
|
||||||
|
|
||||||
install_pkg = tmp + filename_version[i] + SBo_arch + SBo_tag + SBo_filetype
|
install_pkg = tmp + pkg_for_install[i] + SBo_arch + SBo_tag + SBo_filetype
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
|
|
||||||
else:
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
|
||||||
print
|
|
||||||
|
|
||||||
for j in range(0, 2):
|
for j in range(0, 2):
|
||||||
files.pop(0)
|
files.pop(0)
|
||||||
|
|
||||||
|
|
||||||
|
for pkg in pkg_for_install:
|
||||||
|
if find_package(pkg, packages) != []:
|
||||||
|
print ("{}The package {}`{}`{} was installed{}".format(colors.GREEN,
|
||||||
|
colors.CYAN, pkg, colors.GREEN, colors.ENDC))
|
||||||
|
print
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# install binary package
|
# install binary package
|
||||||
def pkg_install(name):
|
def pkg_install(name):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ from distutils.core import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'slpkg',
|
name = 'slpkg',
|
||||||
version = "1.4.1",
|
version = "1.4.2",
|
||||||
description = "Python tool to manage Slackware packages",
|
description = "Python tool to manage Slackware packages",
|
||||||
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
|
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
|
||||||
"view", "slackpkg", "tool"],
|
"view", "slackpkg", "tool"],
|
||||||
|
|
Loading…
Reference in a new issue