diff --git a/CHANGELOG b/CHANGELOG index ca62d138..3073e33a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +19-05-2014 +Version 1.2.4 + +[Feature] - Added download source code by pc arcitecture + 19-05-2014 Version 1.2.3 diff --git a/PKG-INFO b/PKG-INFO index ffb2c455..7b114843 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: slpkg -Version: 1.2.3 +Version: 1.2.4 Author: dslackw Author-email: d zlatanidis at gmail com Maintainer: dslackw diff --git a/README.rst b/README.rst index 4bc17adf..e2ffd132 100644 --- a/README.rst +++ b/README.rst @@ -87,7 +87,7 @@ Check if your packages is up to date (www.slackbuilds.org): $ slpkg -c flashplayer-plugin - Searching for `flashplayer-plugin` from www.slackbuilds.org Please wait ... + Searching for `flashplayer-plugin` from www.slackbuilds.org > Please wait ... New version is available !!! +================================================== @@ -96,22 +96,16 @@ Check if your packages is up to date (www.slackbuilds.org): $ slpkg -c ranger - Searching for `ranger` from www.slackbuilds.org Please wait ... + Searching for `ranger` from www.slackbuilds.org > Please wait ... Your package is up to date $ slpkg -c termcolor - Searching for `termcolor` from www.slackbuilds.org Please wait ... + Searching for `termcolor` from www.slackbuilds.org > Please wait ... The package `termcolor` not found on your system - New version is available !!! - +================================================== - | termcolor 1.1.0 - +================================================== - - Find slackbuild from network (www.slackbuilds.org): @@ -121,7 +115,7 @@ Find slackbuild from network (www.slackbuilds.org): This find the slackbuild , source, extra downloads and package requirements !!! $ slpkg -n brasero - Searching for `brasero` from www.slackbuilds.org Please wait ... + Searching for `brasero` from www.slackbuilds.org > Please wait ... +================================================================================= | The `brasero` found in --> http://slackbuilds.org/repository/14.1/system/brasero/ @@ -129,7 +123,7 @@ Find slackbuild from network (www.slackbuilds.org): 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 : [] + Extra Downloads : Package requirements : libunique gst1-plugins-bad @@ -139,7 +133,7 @@ And try again: .. code-block:: bash $ slpkg -n bitfighter - Searching for `bitfighter` from www.slackbuilds.org Please wait ... + Searching for `bitfighter` from www.slackbuilds.org > Please wait ... +====================================================================================== | The `bitfighter` found in --> http://slackbuilds.org/repository/14.1/games/bitfighter/ @@ -147,12 +141,12 @@ And try again: Download SlackBuild : http://slackbuilds.org/slackbuilds/14.1/games/bitfighter.tar.gz Source Downloads : http://bitfighter.org/files/bitfighter-019c.tar.gz - Extra Downloads : [https://bitfighter.googlecode.com/files/classic_level_pack.zip] + Extra Downloads : https://bitfighter.googlecode.com/files/classic_level_pack.zip Package requirements : OpenAL SDL2 speex libmodplug $ slpkg -n termcolor - Searching for `termcolor` from www.slackbuilds.org Please wait ... + Searching for `termcolor` from www.slackbuilds.org > Please wait ... +====================================================================================== | The `termcolor` found in --> http://slackbuilds.org/repository/14.1/python/termcolor/ @@ -160,7 +154,7 @@ And try again: 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 : [] + Extra Downloads : Package requirements : diff --git a/bin/slpkg b/bin/slpkg index 9e1bfbae..b17fe45d 100755 --- a/bin/slpkg +++ b/bin/slpkg @@ -16,11 +16,14 @@ import argparse import subprocess __author__ = "dslackw" -__version__ = "1.2.3" +__version__ = "1.2.4" __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" +# grep computer architecture +uname = os.uname() +arch = (uname[4]) # path file record @@ -130,12 +133,19 @@ def sbo_source_dwn(sbo_url, name): sbo_url = sbo_url.replace("repository", "slackbuilds") # read lines from .info files grep download line and return source link - for line in url_read(sbo_url).splitlines(): - if line.startswith('DOWNLOAD='): - line = line[10:-1] - - return line + if arch == "x86_64": + for line in url_read(sbo_url).splitlines(): + if line.startswith('DOWNLOAD_x86_64='): + line = line[17:-1] + return line + + if arch != "x86_64": + for line in url_read(sbo_url).splitlines(): + if line.startswith('DOWNLOAD='): + line = line[10:-1] + + return line # find extra source downloads @@ -253,6 +263,7 @@ def main(): if args.network: find_sbo_url = sbo_search_pkg(args.network) if find_sbo_url == None: + print ("\n") print ("{}The {}'{}'{} not found{}".format(colors.RED, colors.CYAN, args.network, colors.RED, colors.ENDC)) print @@ -286,42 +297,39 @@ def main(): # check if packages from www.slackbuilds.org is up to date if args.check: find_sbo_url = sbo_search_pkg(args.check) - print if find_sbo_url == None: - print + print ("\n") print ("{}The {}`{}`{} not found{}".format(colors.RED, colors.CYAN, args.check, colors.RED, colors.ENDC)) print else: find_sbo_version = sbo_version_pkg(find_sbo_url, args.check) - if find_package(args.check) == []: - print + print ("\n") print (" {}The package {}`{}`{} not found on your system{}".format(colors.RED, colors.CYAN, args.check, colors.RED, colors.ENDC)) sbo_file = "" + print else: sbo_file = "".join(find_package(args.check)) # convert list to string name_len = len(args.check) - uname = os.uname() - arch = (uname[4]) # get computer architecture arch_len = len(arch) sbo_file = sbo_file[name_len+1:-arch_len-7] - if find_sbo_version > sbo_file: - print - print ("{} New version is available !!!{}".format(colors.YELLOW, colors.ENDC)) - print ("+" + "=" * 50) - print ("| {} {}".format(args.check, find_sbo_version)) - print ("+" + "=" * 50) - print - else: - print - print ("{}Your package is up to date{}".format(colors.GREEN, colors.ENDC)) - print - + if find_sbo_version > sbo_file: + print ("\n") + print ("{} New version is available !!!{}".format(colors.YELLOW, colors.ENDC)) + print ("+" + "=" * 50) + print ("| {} {}".format(args.check, find_sbo_version)) + print ("+" + "=" * 50) + print + else: + print ("\n") + print ("{}Your package is up to date{}".format(colors.GREEN, colors.ENDC)) + print + # install binary package if args.install: s_user(getpass.getuser()) diff --git a/man/slpkg.8 b/man/slpkg.8 index 4aa11970..3f65fb8b 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -134,7 +134,7 @@ $ \fBslpkg -n termcolor\fP 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 : [] + Extra Downloads : Package requirements : Etc. download from www.slackbuilds.org the package termcolor diff --git a/setup.py b/setup.py index 87655059..65168b81 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from distutils.core import setup setup( name = 'slpkg', - version = "1.2.3", + version = "1.2.4", description = "Python tool to manage Slackware packages", keywords = ["slackware", "slpkg", "upgrade", "install", "remove", "view", "slackpkg", "tool"],