slpkg: Updated for version 0.0.3

This commit is contained in:
dslackw 2014-05-09 05:19:07 +03:00
parent aee45f809f
commit 2f27cda734
5 changed files with 98 additions and 60 deletions

View file

@ -1,3 +1,9 @@
09-05-2014
Version 0.0.3
[Feature] - Added support warning message if remove package
[Feature] - Replace remove command
08-05-2014
Version 0.0.2

View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: slpkg
Version: 0.0.1
Version: 0.0.3
Author: dslackw
Author-email: d zlatanidis at gmail com
Maintainer: dslackw
@ -15,28 +15,53 @@ Description: Slpkg is a terminal tool , written in Python that allows the
to a command.
Note: the program is being developed.
Installation
------------
Using slackware command:
.. code-block:: bash
Download from http://slackbuilds.org
or
using sbopkg tool http://www.sbopkg.org
Using pip:
.. code-block:: bash
$ pip install slpkg
and for uninstall
$ pip uninstall slpkg
Command Line Tool Usage
-----------------------
.. code-block:: bash
usage: slpkg [-h] [-v] [-u UPGRADE] [-r REMOVE] [-l] [-f FIND] [-d
DISPLAY]
Slackware tool to upgrade, remove, find and view packages contents
optional arguments:
-h, --help show this help message and exit
-v, --verbose print version and exit
-u UPGRADE, --upgrade UPGRADE
exec command upgradepkg --install-new
-r REMOVE, --remove REMOVE
exec command slackpkg remove
-l, --list list of installed packages
-f FIND, --find FIND find if package installed
-d DISPLAY, --display DISPLAY
display the contents of the package
usage: slpkg [-h] [-v] [-u UPGRADE] [-a REINSTALL] [-r REMOVE] [-l] [-f FIND] [-d DISPLAY]
Slpkg is a Slackware tool to upgrade, remove, find and view packages contents
optional arguments:
-h, --help show this help message and exit
-v, --verbose print version and exit
-u UPGRADE, --upgrade UPGRADE
install-upgrade package with new
-a REINSTALL, --reinstall REINSTALL
reinstall the same package
-r REMOVE, --remove REMOVE
remove package
-l, --list list of installed packages
-f FIND, --find FIND find if package installed
-d DISPLAY, --display DISPLAY
display the contents of the package
Slpkg Examples
--------------
@ -47,10 +72,6 @@ DISPLAY]
.. code-block:: bash
$ slpkg -u termcolor-1.1.0-x86_64-1_SBo.tgz
+==========================================================
| Installing new package ./termcolor-1.1.0-x86_64-1_SBo.tgz
@ -109,8 +130,7 @@ DISPLAY]
usr/lib64/python3.3/site-packages/
usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info
usr/lib64/python3.3/site-packages/__pycache__/
usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
usr/lib64/python3.3/site-packages/termcolor.py
usr/doc/
usr/doc/termcolor-1.1.0/
@ -128,6 +148,9 @@ usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
.. code-block:: bash
$ slpkg -r termcolor
!!! WARNING !!!
Are you sure to remove this package [y/n] y
Package: termcolor-1.1.0-x86_64-1_SBo
Removing...
@ -138,19 +161,14 @@ usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
--> Deleting /usr/doc/termcolor-1.1.0/PKG-INFO
--> Deleting /usr/doc/termcolor-1.1.0/README.rst
--> Deleting /usr/doc/termcolor-1.1.0/termcolor.SlackBuild
--> Deleting
/usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info
--> Deleting /usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.py
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.pyc
--> Deleting
/usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
--> Deleting
/usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info
--> Deleting /usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
--> Deleting /usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info
--> Deleting /usr/lib64/python3.3/site-packages/termcolor.py
--> Deleting empty directory
/usr/lib64/python3.3/site-packages/__pycache__/
WARNING: Unique directory /usr/lib64/python3.3/site-packages/
contains new files
--> Deleting empty directory /usr/lib64/python3.3/site-packages/__pycache__/
WARNING: Unique directory /usr/lib64/python3.3/site-packages/ contains new files
WARNING: Unique directory /usr/lib64/python3.3/ contains new files
--> Deleting empty directory /usr/doc/termcolor-1.1.0/
@ -162,7 +180,7 @@ contains new files
The package is not found
$ slpkg -v
0.0.1
Version: x.x.x
Keywords: slackware,upgrade,install,remove,find
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
@ -173,5 +191,3 @@ Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: System
Classifier: Topic :: System :: Operating System
Classifier: Topic :: Utilities

View file

@ -24,7 +24,7 @@ Using pip:
$ pip install slpkg
and for uninstall
uninstall:
$ pip uninstall slpkg
@ -34,20 +34,24 @@ Command Line Tool Usage
-----------------------
.. code-block:: bash
usage: slpkg [-h] [-v] [-u UPGRADE] [-r REMOVE] [-l] [-f FIND] [-d DISPLAY]
Slackware tool to upgrade, remove, find and view packages contents
usage: slpkg [-h] [-v] [-u UPGRADE] [-a REINSTALL] [-r REMOVE] [-l] [-f FIND]
[-d DISPLAY]
optional arguments:
-h, --help show this help message and exit
-v, --verbose print version and exit
-u UPGRADE, --upgrade UPGRADE
exec command upgradepkg --install-new
-r REMOVE, --remove REMOVE
exec command slackpkg remove
-l, --list list of installed packages
-f FIND, --find FIND find if package installed
-d DISPLAY, --display DISPLAY
Slpkg is a Slackware tool to upgrade, remove, find and view packages contents
optional arguments:
-h, --help show this help message and exit
-v, --verbose print version and exit
-u UPGRADE, --upgrade UPGRADE
install-upgrade package with new
-a REINSTALL, --reinstall REINSTALL
reinstall the same package
-r REMOVE, --remove REMOVE
remove package
-l, --list list of installed packages
-f FIND, --find FIND find if package installed
-d DISPLAY, --display DISPLAY
display the contents of the package
Slpkg Examples
@ -135,6 +139,9 @@ Remove package:
.. code-block:: bash
$ slpkg -r termcolor
!!! WARNING !!!
Are you sure to remove this package [y/n] y
Package: termcolor-1.1.0-x86_64-1_SBo
Removing...
@ -164,4 +171,4 @@ Remove package:
The package is not found
$ slpkg -v
0.0.1
Version: x.x.x

View file

@ -7,18 +7,21 @@ import sys
import argparse
import subprocess
__version__ = "0.0.2"
__packages__ = "/var/log/packages/"
__version__ = "0.0.3"
__author__ = "dslackw"
__license__ = "GPLv3"
''' path file record '''
__packages__ = "/var/log/packages/"
# main function
def main():
description = "Slackware tool to upgrade, remove, find and view packages contents"
description = "Slpkg is a Slackware tool to upgrade, remove, find and view packages contents"
parser = argparse.ArgumentParser(description=description)
parser.add_argument("-v", "--verbose", help="print version and exit", action="store_true")
parser.add_argument("-u", "--upgrade", help="upgrade package with new", type=str)
parser.add_argument("-a", "--reinstall", help="upgrade the same package", type=str)
parser.add_argument("-u", "--upgrade", help="install-upgrade package with new", type=str)
parser.add_argument("-a", "--reinstall", help="reinstall the same package", type=str)
parser.add_argument("-r", "--remove", help="remove package", type=str)
parser.add_argument("-l", "--list", help="list of installed packages", action="store_true")
parser.add_argument("-f", "--find", help="find if package installed", type=str)
@ -28,7 +31,6 @@ def main():
# print version and exit
if args.verbose:
print ("Version: " + __version__)
sys.exit()
# upgrade package with new
if args.upgrade:
@ -40,7 +42,14 @@ def main():
# uninstall package
if args.remove:
os.system("slackpkg remove {}".format(args.remove))
find_pkg = subprocess.check_output(["find " + __packages__ + " -name '{}*' 2> /dev/null".format(args.remove)],shell=True)
if find_pkg == "":
os.system("echo -e '\e[31mThe package is not found\e[39m'")
else:
os.system("echo -e '\e[93m!!! WARNING !!!\e[39m'")
remove_pkg = raw_input("Are you sure to remove this package [y/n] ")
if remove_pkg == "y" or remove_pkg == "Y":
os.system("removepkg {}".format(args.remove))
# view list of installed packages
if args.list:

View file

@ -6,13 +6,13 @@ from distutils.core import setup
setup(
name='slpkg',
py_modules=['slpkg'],
version='0.0.1',
version='0.0.3',
description="Python tool to manage Slackware packages",
keywords=["slpkg", "upgrade", "install", "remove", "view", "slackpkg", "tool"],
author="dslackw",
author_email="d.zlatanidis@gmail.com",
url="https://github.com/dslackw/slpkg",
download_url="https://github.com/dslackw/slpkg/archive/v0.0.1.tar.gz",
download_url="https://github.com/dslackw/slpkg/archive/v0.0.3.tar.gz",
scripts=['bin/slpkg'],
package_data={"": ["LICENSE", "README.rst", "CHANGELOG"]},
classifiers=[