updated for version 1.1.9

This commit is contained in:
dslackw 2014-05-17 05:25:16 +03:00
parent cfeec05628
commit 3bb7d7d25a
5 changed files with 28 additions and 19 deletions

View file

@ -1,3 +1,9 @@
17-05-2014
Version 1.1.9
[Updated] - Fix notify message if exist package in fuction remove
17-05-2014
Version 1.1.8

View file

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

View file

@ -252,12 +252,13 @@ Find if your packages installed:
$ slpkg -f termcolor lua yetris you-get rar pip
The package `termcolor` is installed on your system
The package `lua` is not installed on your system
The package `yetris` is installed on your system
The package `you-get` is not installed on your system
The package `rar` is installed on your system
The package `pip` is installed on your system
-----> termcolor-1.1.0-x86_64-1_SBo
The package `lua` is not found
-----> yetris-2.0.1-x86_64-1_SBo
The package `you-get` is not found
-----> rar-5.0.1-x86_64-1_SBo
-----> pip-1.5.4-x86_64-1_SBo
Display the contents of the package:

View file

@ -16,10 +16,13 @@ import argparse
import subprocess
__author__ = "dslackw"
__version__ = "1.1.8"
__version__ = "1.1.9"
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
# path file record
packages = "/var/log/packages/"
tmp = "/tmp/"
@ -33,7 +36,8 @@ repository = ("academic", "business", "games", "ham",
"desktop", "gis", "haskell", "multimedia",
"perl", "system", "audio", "development",
"graphics", "lbraries", "network", "python")
import getpass
# print out colors class
class colors:
RED = "\e[31m"
@ -62,7 +66,7 @@ def rmv_unused(name):
return name
# this fuction return the path of the package
# this fuction return if the package exist
def find_package(find_pkg):
results = []
@ -71,10 +75,6 @@ def find_package(find_pkg):
results.append(file)
return results
# find_pkg = subprocess.check_output(["find " + packages + " -name '{}*' 2>
#/dev/null".format(find_pkg)], shell=True)
# return find_pkg
# open url and read page
def url_read(name):
@ -119,6 +119,7 @@ def sbo_slackbuild_dwn(sbo_url, name):
return sbo_url
# find source downloads
def sbo_source_dwn(sbo_url, name):
sbo_url = sbo_url + name + ".info"
@ -231,7 +232,6 @@ def main():
# find from SBo repositority www.slackbuild.org
if args.network:
# call function `sbo_search_pkg`
find_sbo_url = sbo_search_pkg(args.network)
if find_sbo_url == None:
print
@ -266,6 +266,7 @@ def main():
colors.ENDC, find_sbo_req))
print
# install binary package
if args.install:
s_user(getpass.getuser())
@ -287,16 +288,17 @@ def main():
# uninstall package
if args.remove:
s_user(getpass.getuser())
print
os.system("echo -e '{}!!! WARNING !!!{}'".format(colors.YELLOW, colors.ENDC))
remove_pkg = raw_input("Are you sure to remove this package(s) [y/n] ")
if remove_pkg == "y" or remove_pkg == "Y":
for i in range(len(args.remove)):
# call function `find_package`
if find_package(args.remove[i]) == "":
if find_package(args.remove[i]) == []:
os.system("echo -e '{}The package {} is not found{}'".format(colors.RED,
colors.CYAN + '`' + args.remove[i] + '`' + colors.RED, colors.ENDC))
else:
os.system("removepkg {}".format(args.remove[i]))
print
# find if package installed on your system

View file

@ -7,7 +7,7 @@ from distutils.core import setup
setup(
name = 'slpkg',
version = "1.1.8",
version = "1.1.9",
description = "Python tool to manage Slackware packages",
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
"view", "slackpkg", "tool"],