mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-10 20:48:40 +01:00
slpkg: Updated for version 0.0.3
This commit is contained in:
parent
aee45f809f
commit
2f27cda734
5 changed files with 98 additions and 60 deletions
|
@ -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
|
08-05-2014
|
||||||
Version 0.0.2
|
Version 0.0.2
|
||||||
|
|
||||||
|
|
66
PKG-INFO
66
PKG-INFO
|
@ -1,6 +1,6 @@
|
||||||
Metadata-Version: 1.1
|
Metadata-Version: 1.1
|
||||||
Name: slpkg
|
Name: slpkg
|
||||||
Version: 0.0.1
|
Version: 0.0.3
|
||||||
Author: dslackw
|
Author: dslackw
|
||||||
Author-email: d zlatanidis at gmail com
|
Author-email: d zlatanidis at gmail com
|
||||||
Maintainer: dslackw
|
Maintainer: dslackw
|
||||||
|
@ -16,28 +16,53 @@ Description: Slpkg is a terminal tool , written in Python that allows the
|
||||||
|
|
||||||
Note: the program is being developed.
|
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
|
Command Line Tool Usage
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
.. code-block:: bash
|
.. 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]
|
||||||
|
|
||||||
|
Slpkg is a Slackware tool to upgrade, remove, find and view packages contents
|
||||||
|
|
||||||
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
|
||||||
-u UPGRADE, --upgrade UPGRADE
|
-u UPGRADE, --upgrade UPGRADE
|
||||||
exec command upgradepkg --install-new
|
install-upgrade package with new
|
||||||
|
-a REINSTALL, --reinstall REINSTALL
|
||||||
|
reinstall the same package
|
||||||
-r REMOVE, --remove REMOVE
|
-r REMOVE, --remove REMOVE
|
||||||
exec command slackpkg remove
|
remove package
|
||||||
-l, --list list of installed packages
|
-l, --list list of installed packages
|
||||||
-f FIND, --find FIND find if package installed
|
-f FIND, --find FIND find if package installed
|
||||||
-d DISPLAY, --display DISPLAY
|
-d DISPLAY, --display DISPLAY
|
||||||
display the contents of the package
|
display the contents of the package
|
||||||
|
|
||||||
|
|
||||||
Slpkg Examples
|
Slpkg Examples
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -48,10 +73,6 @@ DISPLAY]
|
||||||
|
|
||||||
$ slpkg -u termcolor-1.1.0-x86_64-1_SBo.tgz
|
$ slpkg -u termcolor-1.1.0-x86_64-1_SBo.tgz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+==========================================================
|
+==========================================================
|
||||||
| Installing new package ./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/
|
||||||
usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info
|
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__/
|
||||||
|
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/lib64/python3.3/site-packages/termcolor.py
|
||||||
usr/doc/
|
usr/doc/
|
||||||
usr/doc/termcolor-1.1.0/
|
usr/doc/termcolor-1.1.0/
|
||||||
|
@ -128,6 +148,9 @@ usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ slpkg -r termcolor
|
$ slpkg -r termcolor
|
||||||
|
!!! WARNING !!!
|
||||||
|
Are you sure to remove this package [y/n] y
|
||||||
|
|
||||||
Package: termcolor-1.1.0-x86_64-1_SBo
|
Package: termcolor-1.1.0-x86_64-1_SBo
|
||||||
Removing...
|
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/PKG-INFO
|
||||||
--> Deleting /usr/doc/termcolor-1.1.0/README.rst
|
--> Deleting /usr/doc/termcolor-1.1.0/README.rst
|
||||||
--> Deleting /usr/doc/termcolor-1.1.0/termcolor.SlackBuild
|
--> Deleting /usr/doc/termcolor-1.1.0/termcolor.SlackBuild
|
||||||
--> Deleting
|
--> Deleting /usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info
|
||||||
/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.py
|
||||||
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.pyc
|
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.pyc
|
||||||
--> Deleting
|
--> Deleting /usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
|
||||||
/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-1.1.0-py3.3.egg-info
|
|
||||||
--> Deleting /usr/lib64/python3.3/site-packages/termcolor.py
|
--> Deleting /usr/lib64/python3.3/site-packages/termcolor.py
|
||||||
--> Deleting empty directory
|
--> Deleting empty directory /usr/lib64/python3.3/site-packages/__pycache__/
|
||||||
/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/site-packages/
|
|
||||||
contains new files
|
|
||||||
WARNING: Unique directory /usr/lib64/python3.3/ contains new files
|
WARNING: Unique directory /usr/lib64/python3.3/ contains new files
|
||||||
--> Deleting empty directory /usr/doc/termcolor-1.1.0/
|
--> Deleting empty directory /usr/doc/termcolor-1.1.0/
|
||||||
|
|
||||||
|
@ -162,7 +180,7 @@ contains new files
|
||||||
The package is not found
|
The package is not found
|
||||||
|
|
||||||
$ slpkg -v
|
$ slpkg -v
|
||||||
0.0.1
|
Version: x.x.x
|
||||||
Keywords: slackware,upgrade,install,remove,find
|
Keywords: slackware,upgrade,install,remove,find
|
||||||
Classifier: Development Status :: 3 - Alpha
|
Classifier: Development Status :: 3 - Alpha
|
||||||
Classifier: Environment :: Console
|
Classifier: Environment :: Console
|
||||||
|
@ -173,5 +191,3 @@ Classifier: Programming Language :: Python :: 2.7
|
||||||
Classifier: Topic :: System
|
Classifier: Topic :: System
|
||||||
Classifier: Topic :: System :: Operating System
|
Classifier: Topic :: System :: Operating System
|
||||||
Classifier: Topic :: Utilities
|
Classifier: Topic :: Utilities
|
||||||
|
|
||||||
|
|
||||||
|
|
21
README.rst
21
README.rst
|
@ -24,7 +24,7 @@ Using pip:
|
||||||
|
|
||||||
$ pip install slpkg
|
$ pip install slpkg
|
||||||
|
|
||||||
and for uninstall
|
uninstall:
|
||||||
|
|
||||||
$ pip uninstall slpkg
|
$ pip uninstall slpkg
|
||||||
|
|
||||||
|
@ -34,17 +34,21 @@ Command Line Tool Usage
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
.. code-block:: bash
|
.. 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:
|
Slpkg is a Slackware tool to upgrade, remove, find and view packages contents
|
||||||
|
|
||||||
|
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
|
||||||
-u UPGRADE, --upgrade UPGRADE
|
-u UPGRADE, --upgrade UPGRADE
|
||||||
exec command upgradepkg --install-new
|
install-upgrade package with new
|
||||||
|
-a REINSTALL, --reinstall REINSTALL
|
||||||
|
reinstall the same package
|
||||||
-r REMOVE, --remove REMOVE
|
-r REMOVE, --remove REMOVE
|
||||||
exec command slackpkg remove
|
remove package
|
||||||
-l, --list list of installed packages
|
-l, --list list of installed packages
|
||||||
-f FIND, --find FIND find if package installed
|
-f FIND, --find FIND find if package installed
|
||||||
-d DISPLAY, --display DISPLAY
|
-d DISPLAY, --display DISPLAY
|
||||||
|
@ -135,6 +139,9 @@ Remove package:
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ slpkg -r termcolor
|
$ slpkg -r termcolor
|
||||||
|
!!! WARNING !!!
|
||||||
|
Are you sure to remove this package [y/n] y
|
||||||
|
|
||||||
Package: termcolor-1.1.0-x86_64-1_SBo
|
Package: termcolor-1.1.0-x86_64-1_SBo
|
||||||
Removing...
|
Removing...
|
||||||
|
|
||||||
|
@ -164,4 +171,4 @@ Remove package:
|
||||||
The package is not found
|
The package is not found
|
||||||
|
|
||||||
$ slpkg -v
|
$ slpkg -v
|
||||||
0.0.1
|
Version: x.x.x
|
||||||
|
|
23
bin/slpkg
23
bin/slpkg
|
@ -7,18 +7,21 @@ import sys
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
__version__ = "0.0.2"
|
__version__ = "0.0.3"
|
||||||
__packages__ = "/var/log/packages/"
|
__author__ = "dslackw"
|
||||||
|
__license__ = "GPLv3"
|
||||||
|
|
||||||
|
''' path file record '''
|
||||||
|
__packages__ = "/var/log/packages/"
|
||||||
|
|
||||||
|
|
||||||
# main function
|
# main function
|
||||||
def main():
|
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 = argparse.ArgumentParser(description=description)
|
||||||
parser.add_argument("-v", "--verbose", help="print version and exit", action="store_true")
|
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("-u", "--upgrade", help="install-upgrade package with new", type=str)
|
||||||
parser.add_argument("-a", "--reinstall", help="upgrade the same package", 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("-r", "--remove", help="remove package", type=str)
|
||||||
parser.add_argument("-l", "--list", help="list of installed packages", action="store_true")
|
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)
|
parser.add_argument("-f", "--find", help="find if package installed", type=str)
|
||||||
|
@ -28,7 +31,6 @@ def main():
|
||||||
# print version and exit
|
# print version and exit
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
print ("Version: " + __version__)
|
print ("Version: " + __version__)
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
# upgrade package with new
|
# upgrade package with new
|
||||||
if args.upgrade:
|
if args.upgrade:
|
||||||
|
@ -40,7 +42,14 @@ def main():
|
||||||
|
|
||||||
# uninstall package
|
# uninstall package
|
||||||
if args.remove:
|
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
|
# view list of installed packages
|
||||||
if args.list:
|
if args.list:
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -6,13 +6,13 @@ from distutils.core import setup
|
||||||
setup(
|
setup(
|
||||||
name='slpkg',
|
name='slpkg',
|
||||||
py_modules=['slpkg'],
|
py_modules=['slpkg'],
|
||||||
version='0.0.1',
|
version='0.0.3',
|
||||||
description="Python tool to manage Slackware packages",
|
description="Python tool to manage Slackware packages",
|
||||||
keywords=["slpkg", "upgrade", "install", "remove", "view", "slackpkg", "tool"],
|
keywords=["slpkg", "upgrade", "install", "remove", "view", "slackpkg", "tool"],
|
||||||
author="dslackw",
|
author="dslackw",
|
||||||
author_email="d.zlatanidis@gmail.com",
|
author_email="d.zlatanidis@gmail.com",
|
||||||
url="https://github.com/dslackw/slpkg",
|
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'],
|
scripts=['bin/slpkg'],
|
||||||
package_data={"": ["LICENSE", "README.rst", "CHANGELOG"]},
|
package_data={"": ["LICENSE", "README.rst", "CHANGELOG"]},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|
Loading…
Add table
Reference in a new issue