updated for version 1.1.2

This commit is contained in:
dslackw 2014-05-13 10:09:07 +03:00
parent c3be7283b2
commit 77dbd3b5d1
6 changed files with 48 additions and 15 deletions

View file

@ -1,8 +1,17 @@
12-05-2013
13-05-2014
Version 1.1.2
[Feature] - Added to find already binary packages in /tmp directory
13-05-2014
Version: 1.1.1
[Updated] - Fix list print out
12-05-2014
Version 1.1.0
[Feature] - Added search from SBo and print link for download
[Updated] - Fix list print out
12-05-2014
Version 1.0.9

View file

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

View file

@ -49,7 +49,7 @@ Command Line Tool Usage
.. code-block:: bash
usage: slpkg.py [-h] [-v] [-s script source] [-l all, sbo [all, sbo ...]] [-i]
[-u] [-a] [-r] [-f] [-d]
[-u] [-a] [-b] [-r] [-f] [-d]
Utility to help package management in Slackware
@ -64,6 +64,7 @@ Command Line Tool Usage
-i , --install install binary package
-u , --upgrade install-upgrade package with new
-a , --reinstall reinstall the same package
-b , --binary find already binary packages
-r , --remove remove package
-f , --find find if package installed
-d , --display display the contents of the package
@ -73,12 +74,12 @@ Slpkg Examples
--------------
Find from www.slackbuilds.org the slackbuild by name:
Find slackbuild from network (www.slackbuilds.org):
.. code-block:: bash
$ slpkg -n termcolor
Searching for `termcolor` Please wait ...
Searching for `termcolor` from www.slackbuilds.org Please wait ...
The `termcolor` found in --> http://slackbuilds.org/repository/14.1/python/termcolor/
@ -265,6 +266,7 @@ Remove package:
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/
Done ...
$ slpkg -f termcolor

View file

@ -10,11 +10,13 @@ import argparse
import subprocess
__author__ = "dslackw"
__version__ = "1.1.1"
__version__ = "1.1.2"
__license__ = "GNU General Public License v3 (GPLv3)"
''' path file record '''
packages = "/var/log/packages/"
tmp = "/tmp/"
''' SlackBuilds Repository '''
sbo_url = "http://slackbuilds.org/repository/14.1/"
@ -47,7 +49,7 @@ def find_package(find_pkg):
''' search and found slackbuilds links from http://slackbuilds.org/ '''
def sbo_search_pkg(link):
i = 0
os.system("echo -e 'Searching for {} Please wait ...'".format("`" + link + "`"))
os.system("echo -e 'Searching for {} from www.slackbuilds.org Please wait ...'".format("`" + link + "`"))
link = ">" + link + "<"
for i in repository:
sbo_url_sub = sbo_url + i + "/"
@ -81,6 +83,8 @@ def main():
type=str, metavar=(''))
parser.add_argument("-a", "--reinstall", help="reinstall the same package",
type=str, metavar=(''))
parser.add_argument("-b", "--binary", help="find already binary packages",
type=str, metavar=(''))
parser.add_argument("-r", "--remove", help="remove package",
type=str, metavar=(''))
parser.add_argument("-f", "--find", help="find if package installed",
@ -131,7 +135,8 @@ def main():
else:
print
os.system("echo -e '{}The {} found in --> {}'".format(colors.GREEN,
colors.CYAN + '`' + args.network + '`' + colors.GREEN, colors.ENDC + find_sbo_url))
colors.CYAN + '`' + args.network + '`' + colors.GREEN,
colors.ENDC + find_sbo_url))
print
''' install binary package '''
@ -146,6 +151,17 @@ def main():
if args.reinstall:
os.system("upgradepkg --reinstall {}".format(args.reinstall))
''' search in /tmp directory for already binary packages '''
if args.binary:
try:
find_bin = subprocess.check_output(["ls " + tmp + "{}*.t?z".format(args.binary)],
shell=True)
print (find_bin)
except subprocess.CalledProcessError:
os.system("echo -e '{}No {} package found in /tmp{}'".format(colors.RED,
colors.CYAN + '`' + args.binary + '`' + colors.RED, colors.ENDC))
''' uninstall package '''
if args.remove:
if find_package(args.remove) == "":
@ -156,6 +172,7 @@ def main():
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))
os.system("echo -e '{}Done ...{}'".format(colors.GREEN, colors.ENDC))
''' find if package installed on your system '''
if args.find:
@ -176,7 +193,7 @@ def main():
''' fix null arguments '''
if not any([args.verbose, args.slackbuild, args.network, args.install, args.upgrade, args.reinstall,
args.remove, args.list, args.find, args.display]):
args.binary, args.remove, args.list, args.find, args.display]):
os.system("slpkg -h")

View file

@ -16,7 +16,7 @@
slpkg - Utility to help package management in Slackware
.SH SYNOPSIS
\fBslpkg\fP \fB[-h]\fP \fB[-v]\fP \fB[-s script source]\fP \fB[-l all, sbo [all, sbo ...]]\fP
\fB[-n]\fP \fB[-i]\fP \fB[-u]\fP \fB[-a]\fP \fB[-r]\fP \fB[-f]\fP \fB[-d]\fP
\fB[-n]\fP \fB[-i]\fP \fB[-u]\fP \fB[-a]\fP \fB[-b]\fP \fB[-r]\fP \fB[-f]\fP \fB[-d]\fP
.SH DESCRIPTION
\fBslpkg\fP is a terminal tool written in Python that allows the build, install, upgrade,
remove, find and view Slackware packages contents.
@ -33,6 +33,7 @@ It's a quick and easy way to manage your packages in slackware to a command.
\fB-i , --install install binary package\fP
\fB-u , --upgrade install-upgrade package with new\fP
\fB-a , --reinstall reinstall the same package\fP
\fB=b , --binary find already binary packages\fP
\fB-r , --remove remove package\fP
\fB-f , --find find if package installed\fP
\fB-d , --display display the contents of the package\fP
@ -59,24 +60,28 @@ only for packages SBo.
With this method you can find the SBo script that interests you through
the network. (www.slackbuilds.org)
.SS -i , --install install binary package
\fBslpkg\fP \fB-i\fP <\fIpackage.tgz or .txz\fP>
\fBslpkg\fP \fB-i\fP <\fIpackage.t?z\fP>
.PP
Installs single binary packages designed for use with the
Slackware Linux distribution into your system.
.SS -u , --upgrade install-upgrade package with new
\fBslpkg\fP \fB-u\fP <\fIpackage.tgz or .txz\fP>
\fBslpkg\fP \fB-u\fP <\fIpackage.t?z\fP>
.PP
Normally upgrade only upgrades packages that are already
installed on the system, and will skip any packages that do not
already have a version installed. 'Requires root privileges'
(like slackware command upgradepkg --install-new)
.SS -a --reinstall
\fBslpkg\fP \fB-a\fP <\fIpackage.tgz or .tgz or else\fP>
\fBslpkg\fP \fB-a\fP <\fIpackage.t?z\fP>
.PP
Upgradepkg usually skips packages if the exact same package
(matching name, version, arch, and build number) is already
installed on the system.'Requires root privileges' (like
slackware command upgradepkg --reinstall)
.SS -b --binary
\fBslpkg\fP \fB-b\fP <\fIpackage.t?z\fP>
.PP
Find already binary Slackware packages in /tmp directory
.SS -r , --remove package
\fBslpkg\fP \fB-r\fP <\fIname of package\fP>
.PP

View file

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