From 1e54be5a516e3962fbcf545c797db4299c315b2c Mon Sep 17 00:00:00 2001 From: dslackw Date: Mon, 21 Jul 2014 02:54:58 +0300 Subject: [PATCH] updated --- README.rst | 61 ++++++++++++++++++++------------------------ man/slpkg.8 | 18 ++++++------- slpkg/pkg/manager.py | 6 +++-- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/README.rst b/README.rst index 3022552b..c16b85b6 100644 --- a/README.rst +++ b/README.rst @@ -5,10 +5,8 @@ .. image:: https://pypip.in/license/slpkg/badge.png :target: https://pypi.python.org/pypi/slpkg - Slpkg is a terminal tool in order to easy use Slackware packages. - .. image:: https://raw.githubusercontent.com/dslackw/slpkg/master/logo/slpkg.png :alt: logo @@ -63,8 +61,6 @@ Using pip: $ pip uninstall slpkg - - Command Line Tool Usage ----------------------- @@ -130,12 +126,12 @@ build and install with all dependencies : Executing install script for brasero-3.11.3-x86_64-1_SBo.tgz. Package brasero-3.11.3-x86_64-1_SBo.tgz installed. - The package `orc` was installed - The package `gstreamer1` was installed - The package `gst1-plugins-base` was installed - The package `gst1-plugins-bad` was installed - The package `libunique` was installed - The package `brasero` was installed + slpkg: package: orc was installed + slpkg: package: gstreamer1 installed + slpkg: package: gst1-plugins-base installed + slpkg: package: gst1-plugins-bad installed + slpkg: package: libunique installed + slpkg: package: brasero installed Tracking all dependencies of packages: @@ -145,7 +141,7 @@ Tracking all dependencies of packages: $ slpkg -t brasero +========================= - | brasero dependencies : + | brasero dependencies : +========================= | | @@ -165,10 +161,10 @@ Check if your packages is up to date (www.slackbuilds.org): $ slpkg -c flashplayer-plugin Searching `flashplayer-plugin` from slackbuilds.org ... - New version is available !!! - +================================================== - | flashplayer-plugin 11.2.202.356 - +================================================== + New version is available: + +============================================================================== + | slpkg: package: flashplayer-plugin 11.2.202.356 --> flashplayer-plugin 11.2.202.394 + +============================================================================== Would you like to install ? [Y/y] @@ -192,14 +188,14 @@ Find slackbuild from network (www.slackbuilds.org): $ slpkg -n bitfighter Searching `bitfighter` from slackbuilds.org ... - +======================================================================================= + +=============================================================================== | The `bitfighter` found in --> http://slackbuilds.org/repository/14.1/games/bitfighter/ - +======================================================================================= + +=============================================================================== | 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 | Package requirements : OpenAL SDL2 speex libmodplug - +======================================================================================= + +=============================================================================== README View the README file SlackBuild View the SlackBuild file Info View the Info file @@ -286,9 +282,6 @@ Auto build tool to build package: Slackware package /tmp/termcolor-1.1.0-x86_64-1_SBo.tgz created. - Use `slpkg -u` to install - upgrade this package - - Upgrade install package: .. code-block:: bash @@ -328,13 +321,12 @@ Find if your packages installed: $ slpkg -f termcolor lua yetris you-get rar pip - found --> termcolor-1.1.0-x86_64-1_SBo - The package `lua` not found - found --> yetris-2.0.1-x86_64-1_SBo - The package `you-get` not found - found --> rar-5.0.1-x86_64-1_SBo - found --> pip-1.5.4-x86_64-1_SBo - + slpkg: package: found --> termcolor-1.1.0 + slpkg: package: lua not found + slpkg: package: found --> yetris-2.0.1 + slpkg: package: you-get not found + slpkg: package: found --> rar-5.0.1 + slpkg: package: found --> pip-1.5.4 Display the contents of the package: @@ -391,6 +383,7 @@ Remove package: $ slpkg -r termcolor These package(s) will be deleted: termcolor-1.1.0-x86_64-1_SBo + 1 package marked Are you sure to remove this package(s) [y/n] y Package: termcolor-1.1.0-x86_64-1_SBo @@ -414,15 +407,15 @@ Remove package: WARNING: Unique directory /usr/lib64/python3.3/ contains new files --> Deleting empty directory /usr/doc/termcolor-1.1.0/ - The package `termcolor` removed - + +============================================================================== + | slpkg: package: termcolor removed + +============================================================================== $ slpkg -f termcolor lua rar - The package `termcolor` not found - The package `lua` not found - found --> rar-5.0.1-x86_64-1_SBo - + slpkg: package: termcolor not found + slpkg: package: lua not found + slpkg: package: found --> rar-5.0.1 $ slpkg -v Version: x.x.x diff --git a/man/slpkg.8 b/man/slpkg.8 index 893bbbe0..f5be7698 100755 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -165,10 +165,10 @@ $ \fBslpkg -s brasero\fP $ \fBslpkg -c flashplayer-plugin\fP Searching `flashplayer-plugin` from slackbuilds.org ... - New version is available !!! - +================================================== - | flashplayer-plugin 11.2.202.356 - +================================================== + New version is available: + +============================================================================== + | slpkg: package: flashplayer-plugin 11.2.202.356 --> flashplayer-plugin 11.2.202.394 + +============================================================================== Would you like to install ? [Y/y] @@ -177,14 +177,14 @@ $ \fBslpkg -n termcolor\fP 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 @@ -218,11 +218,11 @@ $ \fBslpkg -r termcolor yetris\fP $ \fBslpkg -f termcolor\fP - The package 'termcolor' not found + slpkg: package: termcolor not found $ \fBslpkg -d termcolor\fP - The package 'termcolor' not found + slpkg: package: termcolor not found $ \fBslpkg -v\fP diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index 23765ea2..cd84e461 100755 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -65,7 +65,9 @@ def pkg_remove(binary): for pkg in range(len(binary)): pkgs = find_package(binary[pkg], packages) if pkgs != []: - print colors.RED + '\n'.join(pkgs) + colors.ENDC + sbo_tag_len = len(arch) + 7 + found_pkg = pkgs[0][:-sbo_tag_len] + print (colors.RED + found_pkg + colors.ENDC) count.append(pkgs) sum_pkgs = 0 for i in range(len(count)): @@ -81,7 +83,7 @@ def pkg_remove(binary): else: try: print subprocess.check_output('removepkg {0}'.format(binary[pkg]), - shell=True) + shell=True) except subprocess.CalledProcessError: file_not_found(binary[pkg]) results_removed.append(binary[pkg])