updated for version 1.0.3

This commit is contained in:
dslackw 2014-05-10 00:48:25 +03:00
parent 4f3128f41d
commit ba79a09004
4 changed files with 22 additions and 11 deletions

View file

@ -1,3 +1,9 @@
10-05-2014
Version 1.0.3
[Updated] - bin/slpkg added function find_package
10-05-2014
Version 1.0.2

View file

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

View file

@ -7,7 +7,7 @@ import sys
import argparse
import subprocess
__version__ = "1.0.2"
__version__ = "1.0.3"
__author__ = "dslackw"
__license__ = "GPLv3"
@ -15,6 +15,14 @@ __license__ = "GPLv3"
__packages__ = "/var/log/packages/"
# this fuction return the path of the package
def find_package(find_pkg):
find_pkg = subprocess.check_output(["find " + __packages__ + " -name '{}*' 2> /dev/null".format(find_pkg)],shell=True)
return find_pkg
# main function
def main():
description = "Slpkg is a Slackware tool to upgrade, remove, find and view packages contents"
@ -42,8 +50,7 @@ def main():
# uninstall package
if args.remove:
find_pkg = subprocess.check_output(["find " + __packages__ + " -name '{}*' 2> /dev/null".format(args.remove)],shell=True)
if find_pkg == "":
if find_package(args.remove) == "":
os.system("echo -e '\e[31mThe package is not found\e[39m'")
else:
os.system("echo -e '\e[93m!!! WARNING !!!\e[39m'")
@ -57,19 +64,17 @@ def main():
# find if packages installed on your system
if args.find:
find_pkg = subprocess.check_output(["find " + __packages__ + " -name '{}*' 2> /dev/null".format(args.find)],shell=True)
if find_pkg == "":
if find_package(args.find) == "":
os.system("echo -e '\e[31mThe package is not installed on your system\e[39m'")
else:
os.system("echo -e '\e[32mThe package is installed on your system\e[39m'")
# print the package contents
if args.display:
find_pkg = subprocess.check_output(["find " + __packages__ + " -name '{}*' 2> /dev/null".format(args.display)],shell=True)
if find_pkg == "":
if find_package(args.display) == "":
os.system("echo -e '\e[31mThe package is not found\e[39m'")
else:
os.system("cat {}".format(find_pkg))
os.system("cat {}".format(find_package(args.display)))
main()

View file

@ -8,13 +8,13 @@ from distutils.core import setup
setup(
name='Slpkg',
py_modules=['slpkg'],
version='1.0.2',
version='1.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/v1.0.2.tar.gz",
download_url="https://github.com/dslackw/slpkg/archive/v1.0.3.tar.gz",
scripts=['bin/slpkg'],
package_data={"": ["LICENSE", "README.rst", "CHANGELOG"]},
classifiers=[