updated for version 1.3.9

This commit is contained in:
dslackw 2014-05-30 12:27:34 +03:00
parent f3f4ea6d11
commit f32979f605
6 changed files with 134 additions and 217 deletions

View file

@ -1,3 +1,10 @@
30-05-2014
Version 1.3.9
[Updated] - Remove to search for SBo script no needed
[Updated] - New naming the arguments
[Updated] - source code
30-05-2014 30-05-2014
Version 1.3.8 Version 1.3.8

View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1 Metadata-Version: 1.1
Name: slpkg Name: slpkg
Version: 1.3.8 Version: 1.3.9
Author: dslackw Author: dslackw
Author-email: d zlatanidis at gmail com Author-email: d zlatanidis at gmail com
Maintainer: dslackw Maintainer: dslackw

View file

@ -72,8 +72,8 @@ Command Line Tool Usage
.. code-block:: bash .. code-block:: bash
usage: slpkg [-h] [-v] [-s script [source ...]] [-l all, sbo [all, sbo ...]] usage: slpkg [-h] [-v] [-a script [source ...]] [-l all, sbo [all, sbo ...]]
[-t] [-n] [-c] [-b] [-i [...]] [-u [...]] [-a [...]] [-t] [-n] [-c] [-s] [-i [...]] [-u [...]] [-o [...]]
[-r [...]] [-f [...]] [-d [...]] [-r [...]] [-f [...]] [-d [...]]
Utility to help package management in Slackware Utility to help package management in Slackware
@ -81,17 +81,17 @@ Command Line Tool Usage
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-v, --verbose print version and exit -v, --verbose print version and exit
-s script [source ...] -a script [source ...]
auto build package auto build package
-l all, sbo [all, sbo ...] -l all, sbo [all, sbo ...]
list of installed packages list of installed packages
-t tracking dependencies -t tracking dependencies
-n find from SBo repositority -n find from SBo repositority
-c check if your package is up to date -c check if your package is up to date
-b download, build & install pkg from SBo -s download, build & install pkg from SBo
-i [ ...] install binary packages -i [ ...] install binary packages
-u [ ...] install-upgrade packages with new -u [ ...] install-upgrade packages with new
-a [ ...] reinstall the same packages -o [ ...] reinstall the same packages
-r [ ...] remove packages -r [ ...] remove packages
-f [ ...] find if packages installed -f [ ...] find if packages installed
-d [ ...] display the contents of the packages -d [ ...] display the contents of the packages
@ -106,7 +106,7 @@ build and install with all dependencies :
.. code-block:: bash .. code-block:: bash
$ slpkg -b brasero $ slpkg -s brasero
Searching `brasero` from slackbuilds.org ... Searching `brasero` from slackbuilds.org ...
Searching `libunique` from slackbuilds.org ..... Searching `libunique` from slackbuilds.org .....
Searching `gst1-plugins-bad` from slackbuilds.org ...... Searching `gst1-plugins-bad` from slackbuilds.org ......
@ -155,44 +155,6 @@ Tracking all dependencies of packages:
$ slpkg -t awscli
+========================
| awscli dependencies :
+========================
|
|
-- 2 pysetuptools pyasn1
|
-- 1 %README%
|
-- 2 docutils six
|
-- 1 pysetuptools
|
-- 1 %README%
|
-- 2 pysetuptools six
|
-- 2 python-dateutil jmespath
|
-- 4 botocore colorama bcdoc rsa
$ slpkg -t pylint
+========================
| pylint dependencies :
+========================
|
|
-- 2 pysetuptools logilab-common
|
-- 1 astroid
Check if your packages is up to date (www.slackbuilds.org): Check if your packages is up to date (www.slackbuilds.org):
.. code-block:: bash .. code-block:: bash
@ -225,28 +187,6 @@ Find slackbuild from network (www.slackbuilds.org):
This find the slackbuild , source, extra downloads and package requirements !!! This find the slackbuild , source, extra downloads and package requirements !!!
$ slpkg -n brasero
Searching `brasero` from slackbuilds.org ...
+==================================================================================
| The `brasero` found in --> http://slackbuilds.org/repository/14.1/system/brasero/
+==================================================================================
| Download SlackBuild : http://slackbuilds.org/slackbuilds/14.1/system/brasero.tar.gz
| Source Downloads : https://download.gnome.org/sources/brasero/3.11/brasero-3.11.3.tar.xz
| Extra Downloads :
| Package requirements : libunique gst1-plugins-bad
+==================================================================================
README View the README file
SlackBuild View the SlackBuild file
Info View the Info file
Download Download this package
Build Download and build this package
_
And try again:
.. code-block:: bash .. code-block:: bash
$ slpkg -n bitfighter $ slpkg -n bitfighter
@ -269,27 +209,6 @@ And try again:
_ _
$ slpkg -n termcolor
Searching `termcolor` from slackbuilds.org ...
+======================================================================================
| The `termcolor` found in --> http://slackbuilds.org/repository/14.1/python/termcolor/
+======================================================================================
| Download SlackBuild : http://slackbuilds.org/slackbuilds/14.1/python/termcolor.tar.gz
| Source Downloads : https://pypi.python.org/packages/source/t/termcolor/termcolor-1.1.0.tar.gz
| Extra Downloads :
| Package requirements :
+======================================================================================
README View the README file
SlackBuild View the SlackBuild file
Info View the Info file
Download Download this package
Build Download and build this package
_
Auto build tool to build package: Auto build tool to build package:
.. code-block:: bash .. code-block:: bash
@ -299,7 +218,7 @@ Auto build tool to build package:
Two files termcolor.tar.gz and termcolor-1.1.0.tar.gz Two files termcolor.tar.gz and termcolor-1.1.0.tar.gz
must be in the same directory. must be in the same directory.
$ slpkg -s termcolor.tar.gz termcolor-1.1.0.tar.gz $ slpkg -a termcolor.tar.gz termcolor-1.1.0.tar.gz
termcolor/ termcolor/
termcolor/slack-desc termcolor/slack-desc

216
bin/slpkg
View file

@ -51,7 +51,7 @@ import subprocess
__author__ = "dslackw" __author__ = "dslackw"
__version__ = "1.3.8" __version__ = "1.3.9"
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"
@ -76,7 +76,7 @@ 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/"
# create repository list # create repository list
@ -182,10 +182,10 @@ def url_read(name):
# read SBo README # read SBo README
def read_readme(sbo_url, name, site): def read_readme(SBo_url, name, site):
sbo_url = sbo_url + site SBo_url = SBo_url + site
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
readme = url_read(sbo_url) readme = url_read(SBo_url)
file = open("/tmp/slpkg/readme/" + name + "." + site, "w") file = open("/tmp/slpkg/readme/" + name + "." + site, "w")
file.write(readme) file.write(readme)
@ -194,10 +194,10 @@ def read_readme(sbo_url, name, site):
# read SBo .info # read SBo .info
def read_info_slackbuild(sbo_url, name, site): def read_info_slackbuild(SBo_url, name, site):
sbo_url = sbo_url + name + site SBo_url = SBo_url + name + site
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
info = url_read(sbo_url) info = url_read(SBo_url)
file = open("/tmp/slpkg/readme/" + name + site, "w") file = open("/tmp/slpkg/readme/" + name + site, "w")
file.write(info) file.write(info)
@ -206,7 +206,7 @@ def read_info_slackbuild(sbo_url, name, site):
# search and found slackbuilds packages links from http://slackbuilds.org # search and found slackbuilds packages links from http://slackbuilds.org
def sbo_search_pkg(name): def SBo_search_pkg(name):
i = 0 i = 0
search_name = re.escape(name) # escapes characters from names like `+` search_name = re.escape(name) # escapes characters from names like `+`
search_name = ">" + search_name + "<" # add special characters to name >< for clean searching result search_name = ">" + search_name + "<" # add special characters to name >< for clean searching result
@ -222,45 +222,35 @@ def sbo_search_pkg(name):
# update the bar # update the bar
sys.stdout.write(".") sys.stdout.write(".")
sys.stdout.flush() sys.stdout.flush()
sbo_url_sub = sbo_url + i + "/" SBo_url_sub = SBo_url + i + "/"
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 > < from find
# find sub-category # find sub-category
if name in find_sbo: if name in find_SBo:
name = sbo_url_sub + name + "/" name = SBo_url_sub + name + "/"
return name return name
# find slackbuild download # find slackbuild download
def sbo_slackbuild_dwn(sbo_url, name): def SBo_slackbuild_dwn(SBo_url, name):
search_name = re.escape(name) # escapes characters from names like `+`
search_name = ">" + search_name + ".tar.gz<"
find_sbo = re.findall(search_name, url_read(sbo_url)) SBo_url = SBo_url.replace(name + "/", name + ".tar.gz")
find_sbo = " ".join(find_sbo) # convert list to string SBo_url = SBo_url.replace("repository", "slackbuilds")
find_sbo = rmv_unused(find_sbo) # remove unused chars > < from find
if find_sbo == name + ".tar.gz": return SBo_url
sbo_url = sbo_url.replace(name + "/", name + ".tar.gz")
else:
sbo_url = sbo_url.replace(name + "/", name + ".tar.bz2")
sbo_url = sbo_url.replace("repository", "slackbuilds")
return sbo_url
# find source downloads # find source downloads
def sbo_source_dwn(sbo_url, name): def SBo_source_dwn(SBo_url, name):
sbo_url = sbo_url + name + ".info" SBo_url = SBo_url + name + ".info"
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
read_info = url_read(sbo_url) read_info = url_read(SBo_url)
# read lines from .info files grep download line and return source link # read lines from .info files grep download line and return source link
if arch == "x86_64": if arch == "x86_64":
@ -287,10 +277,10 @@ def sbo_source_dwn(sbo_url, name):
# find extra source downloads # find extra source downloads
def sbo_extra_dwn(sbo_url, name): def SBo_extra_dwn(SBo_url, name):
sbo_url = sbo_url + name + ".info" SBo_url = SBo_url + name + ".info"
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
read_info = url_read(sbo_url) read_info = url_read(SBo_url)
results = [] results = []
@ -305,11 +295,11 @@ def sbo_extra_dwn(sbo_url, name):
# search for package requirements # search for package requirements
def sbo_requires_pkg(sbo_url, name): def SBo_requires_pkg(SBo_url, name):
sbo_url = sbo_url + name + ".info" SBo_url = SBo_url + name + ".info"
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
read_info = url_read(sbo_url) read_info = url_read(SBo_url)
for line in read_info.splitlines(): for line in read_info.splitlines():
if line.startswith('REQUIRES="'): if line.startswith('REQUIRES="'):
@ -321,19 +311,19 @@ def sbo_requires_pkg(sbo_url, name):
# search for package dependencies # search for package dependencies
def sbo_dependencies_pkg(name): 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) find_SBo_url = SBo_search_pkg(name)
if find_sbo_url == None: if find_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) find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
dependencies = find_sbo_req.split() # convert string to list dependencies = find_SBo_req.split() # convert string to list
if dependencies == []: if dependencies == []:
pass pass
@ -343,31 +333,31 @@ def sbo_dependencies_pkg(name):
for line in dependencies: for line in dependencies:
print print
sbo_dependencies_pkg(line) SBo_dependencies_pkg(line)
return dep_results return dep_results
# search for package dependencies # search for package dependencies
def sbo_dependencies_links_pkg(name): def SBo_dependencies_links_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) find_SBo_url = SBo_search_pkg(name)
if find_sbo_url == None: if find_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) find_version = SBo_version_pkg(find_SBo_url, name)
find_sbo_dwn = sbo_slackbuild_dwn(find_sbo_url, name) find_SBo_dwn = SBo_slackbuild_dwn(find_SBo_url, name)
find_source_dwn = sbo_source_dwn(find_sbo_url, name) find_source_dwn = SBo_source_dwn(find_SBo_url, name)
find_extra_dwn = sbo_extra_dwn(find_sbo_url, name) find_extra_dwn = SBo_extra_dwn(find_SBo_url, name)
find_sbo_req = sbo_requires_pkg(find_sbo_url, name) find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
# 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 find_extra_dwn != []:
@ -375,15 +365,14 @@ def sbo_dependencies_links_pkg(name):
dep_links_results.append(flag) dep_links_results.append(flag)
version = find_version.split() version = find_version.split()
sbo_dwn = find_sbo_dwn.split() SBo_dwn = find_SBo_dwn.split()
source_dwn = find_source_dwn.split() source_dwn = find_source_dwn.split()
dependencies = find_sbo_req.split() dependencies = find_SBo_req.split()
dep_links_results.append(find_extra_dwn) 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 dependencies == []:
pass pass
@ -393,7 +382,7 @@ def sbo_dependencies_links_pkg(name):
for line in dependencies: for line in dependencies:
print print
sbo_dependencies_links_pkg(line) SBo_dependencies_links_pkg(line)
return dep_links_results return dep_links_results
@ -401,10 +390,10 @@ def sbo_dependencies_links_pkg(name):
# find from www.slackbuilds.org the version of the package # find from www.slackbuilds.org the version of the package
def sbo_version_pkg(sbo_url, name): def SBo_version_pkg(SBo_url, name):
sbo_url = sbo_url + name + ".info" SBo_url = SBo_url + name + ".info"
sbo_url = sbo_url.replace("repository", "slackbuilds") SBo_url = SBo_url.replace("repository", "slackbuilds")
read_info = url_read(sbo_url) read_info = url_read(SBo_url)
for line in read_info.splitlines(): for line in read_info.splitlines():
if line.startswith('VERSION="'): if line.startswith('VERSION="'):
@ -548,7 +537,7 @@ def pkg_list(name):
# find all dependencies # find all dependencies
def pkg_tracking(name): def pkg_tracking(name):
find_dependencies = sbo_dependencies_pkg(name) find_dependencies = SBo_dependencies_pkg(name)
if find_dependencies == None: if find_dependencies == None:
pass pass
@ -575,38 +564,38 @@ 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) find_SBo_url = SBo_search_pkg(name)
if find_sbo_url == None: if find_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) find_SBo_req = SBo_requires_pkg(find_SBo_url, name)
find_sbo_dwn = sbo_slackbuild_dwn(find_sbo_url, name) find_SBo_dwn = SBo_slackbuild_dwn(find_SBo_url, name)
find_source_dwn = sbo_source_dwn(find_sbo_url, name) find_source_dwn = SBo_source_dwn(find_SBo_url, name)
find_extra_dwn = sbo_extra_dwn(find_sbo_url, name) find_extra_dwn = SBo_extra_dwn(find_SBo_url, name)
find_extra_dwn = " ".join(find_extra_dwn) # convert list to string 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(find_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 + find_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, find_SBo_dwn))
print ("| {}Source Downloads : {}{}".format(colors.GREEN, print ("| {}Source Downloads : {}{}".format(colors.GREEN,
colors.ENDC, find_source_dwn)) colors.ENDC, find_source_dwn))
print ("| {}Extra Downloads : {}{}".format(colors.GREEN, print ("| {}Extra Downloads : {}{}".format(colors.GREEN,
colors.ENDC, find_extra_dwn)) colors.ENDC, find_extra_dwn))
print ("| {}Package requirements : {}{}".format(colors.YELLOW, print ("| {}Package requirements : {}{}".format(colors.YELLOW,
colors.ENDC, find_sbo_req)) colors.ENDC, find_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))
print (" {}I{}nfo View the Info file".format(colors.RED, colors.ENDC)) print (" {}I{}nfo View the Info file".format(colors.RED, colors.ENDC))
@ -618,7 +607,7 @@ 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 " + find_SBo_dwn)
os.system("wget " + find_source_dwn) os.system("wget " + find_source_dwn)
if find_extra_dwn == "": if find_extra_dwn == "":
@ -633,26 +622,26 @@ def sbo_network(name):
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(find_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(find_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(find_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(find_SBo_dwn)
source = get_file(find_source_dwn) source = get_file(find_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 " + find_SBo_dwn)
os.system("wget " + find_source_dwn) os.system("wget " + find_source_dwn)
if find_extra_dwn == "": if find_extra_dwn == "":
@ -686,31 +675,31 @@ def sbo_network(name):
# check if packages from www.slackbuilds.org is up to date # check if packages from www.slackbuilds.org is up to date
def sbo_check(name): def SBo_check(name):
sbo_file = " ".join(find_package(name, packages)) SBo_file = " ".join(find_package(name, packages))
if sbo_file == "": if SBo_file == "":
print print
print (" {}The package {}`{}`{} not found on your system{}\n".format(colors.RED, print (" {}The package {}`{}`{} not found on your system{}\n".format(colors.RED,
colors.CYAN, name, colors.RED, colors.ENDC)) colors.CYAN, name, colors.RED, colors.ENDC))
else: else:
find_sbo_url = sbo_search_pkg(name) find_SBo_url = SBo_search_pkg(name)
if find_sbo_url == None: if find_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) find_SBo_version = SBo_version_pkg(find_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 find_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, find_SBo_version))
print ("+" + "=" * 50) print ("+" + "=" * 50)
print print
@ -721,9 +710,9 @@ 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) find_dependencies_links = SBo_dependencies_links_pkg(name)
if find_dependencies_links == None: if find_dependencies_links == None:
@ -754,14 +743,15 @@ def sbo_build(name):
version .reverse() version .reverse()
dwn_link.reverse() dwn_link.reverse()
# get tar archives from link
files = [] files = []
for i in range(len(dwn_link)): for i in range(len(dwn_link)):
files.append(get_file(dwn_link[i])) # get tar archives from link files.append(get_file(dwn_link[i]))
# removes archives type # removes archives type
filename = [] filename = []
y = 0 y = 0
for i in range(len(files) / 2): for i in range(len(files) / 2):
if files[y].endswith("tar.gz"): if files[y].endswith("tar.gz"):
@ -950,7 +940,7 @@ def main():
parser.add_argument("-v", "--verbose", help="print version and exit", parser.add_argument("-v", "--verbose", help="print version and exit",
action="store_true") action="store_true")
parser.add_argument("-s", help="auto build package", parser.add_argument("-a", help="auto build package",
type=str, nargs="+", metavar=('script','source')) type=str, nargs="+", metavar=('script','source'))
parser.add_argument("-l", help="list of installed packages", parser.add_argument("-l", help="list of installed packages",
@ -965,7 +955,7 @@ def main():
parser.add_argument("-c", help="check if your package is up to date", parser.add_argument("-c", help="check if your package is up to date",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-b", help="download, build & install pkg from SBo", parser.add_argument("-s", help="download, build & install pkg from SBo",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-i", help="install binary packages", parser.add_argument("-i", help="install binary packages",
@ -974,7 +964,7 @@ def main():
parser.add_argument("-u", help="install-upgrade packages with new", parser.add_argument("-u", help="install-upgrade packages with new",
type=str, nargs="+", metavar=('')) type=str, nargs="+", metavar=(''))
parser.add_argument("-a", help="reinstall the same packages", parser.add_argument("-o", help="reinstall the same packages",
type=str, nargs="+", metavar=('')) type=str, nargs="+", metavar=(''))
parser.add_argument("-r", help="remove packages", parser.add_argument("-r", help="remove packages",
@ -993,8 +983,8 @@ def main():
pkg_version() pkg_version()
if args.s: if args.a:
pkg_slackbuild(args.s) pkg_slackbuild(args.a)
if args.l: if args.l:
@ -1006,15 +996,15 @@ def main():
if args.n: if args.n:
sbo_network(args.n) SBo_network(args.n)
if args.c: if args.c:
sbo_check(args.c) SBo_check(args.c)
if args.b: if args.s:
sbo_build(args.b) SBo_build(args.s)
if args.i: if args.i:
@ -1025,8 +1015,8 @@ def main():
pkg_upgrade(args.u) pkg_upgrade(args.u)
if args.a: if args.o:
pkg_reinstall(args.a) pkg_reinstall(args.o)
if args.r: if args.r:
@ -1041,7 +1031,7 @@ def main():
pkg_display(args.d) pkg_display(args.d)
if not any([args.verbose, args.s, args.t, args.c, args.n, args.b, args.i, args.u, args.a, if not any([args.verbose, args.s, args.t, args.c, args.n, args.o, args.i, args.u, args.a,
args.r, args.l, args.f, args.d]): args.r, args.l, args.f, args.d]):
os.system("slpkg -h") os.system("slpkg -h")

View file

@ -15,8 +15,9 @@
.SH NAME .SH NAME
slpkg - Utility to help package management in Slackware slpkg - Utility to help package management in Slackware
.SH SYNOPSIS .SH SYNOPSIS
\fBslpkg\fP \fB-h\fP \fB-v\fP \fB-s script [source ...]\fP \fB-l all, sbo [all, sbo ...]\fP \fBslpkg\fP \fB-h\fP \fB-v\fP \fB-a script [source ...]\fP \fB-l all, sbo [all, sbo ...]\fP
\fB-t\fP \fB-n\fP \fB-c\fP \fB-b\fP \fB-i [...]\fP \fB-u [...]\fP \fB-a [...]\fP \fB-r [...]\fP \fB-f [...]\fP \fB-d [...]\fP \fB-t\fP \fB-n\fP \fB-c\fP \fB-s\fP \fB-i [...]\fP \fB-u [...]\fP \fB-o [...]\fP \fB-r [...]\fP \fB-f
[...]\fP \fB-d [...]\fP
.SH DESCRIPTION .SH DESCRIPTION
\fBslpkg\fP is a terminal tool in order to easy use Slackware packages. \fBslpkg\fP is a terminal tool in order to easy use Slackware packages.
.PP .PP
@ -24,17 +25,17 @@ It's a quick and easy way to manage your packages in slackware to a command.
.SH EXAMPLES .SH EXAMPLES
\fB-h, --help show this help message and exit\fP \fB-h, --help show this help message and exit\fP
\fB-v, --verbose print version and exit\fP \fB-v, --verbose print version and exit\fP
\fB-s script [source ...]\fP \fB-a script [source ...]\fP
\fB auto build package\fP \fB auto build package\fP
\fB-l all, sbo [all, sbo ...]\fP \fB-l all, sbo [all, sbo ...]\fP
\fB list of installed packages\fP \fB list of installed packages\fP
\fB-t tracking dependencies\fP \fB-t tracking dependencies\fP
\fB-n find from SBo repositority\fP \fB-n find from SBo repositority\fP
\fB-c check if your package is up to date\fP \fB-c check if your package is up to date\fP
\fB-b download, build & install pkg from SBo\fP \fB-s download, build & install pkg from SBo\fP
\fB-i [ ...] install binary packages\fP \fB-i [ ...] install binary packages\fP
\fB-u [ ...] install-upgrade packages with new\fP \fB-u [ ...] install-upgrade packages with new\fP
\fB-a [ ...] reinstall the same packages\fP \fB-o [ ...] reinstall the same packages\fP
\fB-r [ ...] remove packages\fP \fB-r [ ...] remove packages\fP
\fB-f [ ...] find if packages installed\fP \fB-f [ ...] find if packages installed\fP
\fB-d [ ...] display the contents of the packages\fP \fB-d [ ...] display the contents of the packages\fP
@ -46,8 +47,8 @@ Print the version of program and exit.
.SH COMMANDS .SH COMMANDS
.PP .PP
The following commands are available. The following commands are available.
.SS -s script source extra .SS -a script source extra
\fBslpkg\fP \fB-s\fP <\fIscript\fP> <\fIsource\fP> <\fIextra sources\fP> \fBslpkg\fP \fB-a\fP <\fIscript\fP> <\fIsource\fP> <\fIextra sources\fP>
.PP .PP
With this argument, build slackware package quickly and easy. With this argument, build slackware package quickly and easy.
Support .tar.gz and .tar.bz2 slackbuilds archives. Support .tar.gz and .tar.bz2 slackbuilds archives.
@ -70,8 +71,8 @@ the network. (www.slackbuilds.org)
\fBslpkg\fP \fB-c\fP <\fIname of package\fP> \fBslpkg\fP \fB-c\fP <\fIname of package\fP>
.PP .PP
Check if your packages from www.slackbuilds.org is updated. Check if your packages from www.slackbuilds.org is updated.
.SS -b , find, download, build and install package with all dependencies .SS -s , find, download, build and install package with all dependencies
\fBslpkg\fP \fB-b\fP <\fIname of package\fP> \fBslpkg\fP \fB-s\fP <\fIname of package\fP>
.PP .PP
Find package from slackbuild.org with all dependencies, Find package from slackbuild.org with all dependencies,
download, build and install them. download, build and install them.
@ -87,8 +88,8 @@ Normally upgrade only upgrades packages that are already
installed on the system, and will skip any packages that do not installed on the system, and will skip any packages that do not
already have a version installed. 'Requires root privileges' already have a version installed. 'Requires root privileges'
(like slackware command upgradepkg --install-new) (like slackware command upgradepkg --install-new)
.SS -a reinstall binary package .SS -o reinstall binary package
\fBslpkg\fP \fB-a\fP <\fIpackages.t?z\fP> \fBslpkg\fP \fB-o\fP <\fIpackages.t?z\fP>
.PP .PP
Upgradepkg usually skips packages if the exact same package Upgradepkg usually skips packages if the exact same package
(matching name, version, arch, and build number) is already (matching name, version, arch, and build number) is already
@ -134,7 +135,7 @@ $ \fBslpkg -t brasero\fP
| |
-- 2 libunique gst1-plugins-bad -- 2 libunique gst1-plugins-bad
$ \fBslpkg -b flexget\fP $ \fBslpkg -s brasero\fP
Searching `brasero` from slackbuilds.org ... Searching `brasero` from slackbuilds.org ...
Searching `libunique` from slackbuilds.org ... Searching `libunique` from slackbuilds.org ...
Searching `gst1-plugins-bad` from slackbuilds.org ... Searching `gst1-plugins-bad` from slackbuilds.org ...
@ -192,7 +193,7 @@ $ \fBslpkg -n termcolor\fP
Two files termcolor.tar.gz and termcolor-1.1.0.tar.gz Two files termcolor.tar.gz and termcolor-1.1.0.tar.gz
must be in the same directory. must be in the same directory.
$ \fBslpkg -s termcolor.tar.gz termcolor-1.1.0.tar.gz\fP $ \fBslpkg -a termcolor.tar.gz termcolor-1.1.0.tar.gz\fP
Slackware package /tmp/termcolor-1.1.0-x86_64-1_SBo.tgz created. Slackware package /tmp/termcolor-1.1.0-x86_64-1_SBo.tgz created.

View file

@ -7,7 +7,7 @@ from distutils.core import setup
setup( setup(
name = 'slpkg', name = 'slpkg',
version = "1.3.8", version = "1.3.9",
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"],