updated for version 1.0.8

This commit is contained in:
dslackw 2014-05-12 09:14:36 +03:00
parent 4c5d98ada4
commit 96aa10d1ee
4 changed files with 62 additions and 42 deletions

View file

@ -48,19 +48,22 @@ Command Line Tool Usage
.. code-block:: bash .. code-block:: bash
usage: slpkg [-h] [-v] [-u] [-a] [-s name script source] [-r] [-l] [-f] [-d] usage: slpkg.py [-h] [-v] [-s script source] [-l all, sbo [all, sbo ...]] [-i]
[-u] [-a] [-r] [-f] [-d]
Utility to help package management in Slackware Utility to help package management in Slackware
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 install-upgrade package with new
-a, --reinstall reinstall the same package
-s script source, --slackbuild script source -s script source, --slackbuild script source
auto build package auto build package
-l all, sbo [all, sbo ...], --list all, sbo [all, sbo ...]
list of installed packages
-i , --install install binary package
-u , --upgrade install-upgrade package with new
-a , --reinstall reinstall the same package
-r , --remove remove package -r , --remove remove package
-l, --list list of installed packages
-f , --find find if package installed -f , --find find if package installed
-d , --display display the contents of the package -d , --display display the contents of the package

View file

@ -29,14 +29,16 @@ def main():
action="store_true") action="store_true")
parser.add_argument("-s", "--slackbuild", help="auto build package", parser.add_argument("-s", "--slackbuild", help="auto build package",
type=str, nargs=2, metavar=('script','source')) type=str, nargs=2, metavar=('script','source'))
parser.add_argument("-l", "--list", help="list of installed packages",
nargs="+", choices="all sbo".split(), metavar=('all, sbo'))
parser.add_argument("-i", "--install", help="install binary package",
type=str, metavar=(''))
parser.add_argument("-u", "--upgrade", help="install-upgrade package with new", parser.add_argument("-u", "--upgrade", help="install-upgrade package with new",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-a", "--reinstall", help="reinstall the same package", parser.add_argument("-a", "--reinstall", help="reinstall the same package",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-r", "--remove", help="remove package", parser.add_argument("-r", "--remove", help="remove package",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-l", "--list", help="list of installed packages",
action="store_true")
parser.add_argument("-f", "--find", help="find if package installed", parser.add_argument("-f", "--find", help="find if package installed",
type=str, metavar=('')) type=str, metavar=(''))
parser.add_argument("-d", "--display", help="display the contents of the package", parser.add_argument("-d", "--display", help="display the contents of the package",
@ -65,6 +67,18 @@ def main():
os.chdir(path + pkg_name) os.chdir(path + pkg_name)
os.system("sh {}{}{}".format(path, pkg_name + "/", pkg_name + ".SlackBuild")) os.system("sh {}{}{}".format(path, pkg_name + "/", pkg_name + ".SlackBuild"))
''' view list of installed packages '''
if args.list:
if "all" in args.list:
os.system("ls " + __packages__ + "* | more")
if "sbo" in args.list:
os.system("ls " + __packages__ + "* | grep 'SBo' | more")
''' install binary package '''
if args.install:
os.system("installpkg {}".format(args.install))
''' upgrade package with new ''' ''' upgrade package with new '''
if args.upgrade: if args.upgrade:
os.system("upgradepkg --install-new {}".format(args.upgrade)) os.system("upgradepkg --install-new {}".format(args.upgrade))
@ -83,10 +97,6 @@ def main():
if remove_pkg == "y" or remove_pkg == "Y": if remove_pkg == "y" or remove_pkg == "Y":
os.system("removepkg {}".format(args.remove)) os.system("removepkg {}".format(args.remove))
''' view list of installed packages '''
if args.list:
os.system("ls " + __packages__ + "* | more")
''' find if package installed on your system ''' ''' find if package installed on your system '''
if args.find: if args.find:
if find_package(args.find) == "": if find_package(args.find) == "":
@ -101,7 +111,7 @@ def main():
else: else:
os.system("cat {}".format(find_package(args.display))) os.system("cat {}".format(find_package(args.display)))
''' fix null arguments ''' ''' fix null arguments '''
if not any([args.verbose, args.upgrade, args.reinstall, args.slackbuild, if not any([args.verbose, args.slackbuild, args.install, args.upgrade, args.reinstall,
args.remove, args.list, args.find, args.display]): args.remove, args.list, args.find, args.display]):
os.system("slpkg -h") os.system("slpkg -h")

View file

@ -24,12 +24,14 @@ It's a quick and easy way to manage your packages in slackware to a command.
.SH EXAMPLES .SH EXAMPLES
\fB-h, --help show this help message and exit\fP \fB-h, --help show this help message and exit\fP
\fB-v, --verbose print version and exit\fP \fB-v, --verbose print version and exit\fP
\fB-u, --upgrade install-upgrade package with new\fP
\fB-a, --reinstall reinstall the same package\fP
\fB-s script source, --slackbuild script source\fP \fB-s script source, --slackbuild script source\fP
\fB auto build package\fP \fB auto build package\fP
\fB-l all, sbo [all, sbo ...], --list all, sbo [all, sbo ...]\fP
\fB list of installed packages\fP
\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-r , --remove remove package\fP \fB-r , --remove remove package\fP
\fB-l, --list list of installed packages\fP
\fB-f , --find find if package installed\fP \fB-f , --find find if package installed\fP
\fB-d , --display display the contents of the package\fP \fB-d , --display display the contents of the package\fP
.SH GLOBAL OPTIONS .SH GLOBAL OPTIONS
@ -39,7 +41,21 @@ Print the version of program and exit.
.SH COMMANDS .SH COMMANDS
.PP .PP
The following commands are available. The following commands are available.
.SS -u --upgrade .SS -s script source, --slackbuild script source
\fBslpkg\fP \fB-s\fP <\fIscript\fP> <\fIsource\fP>
.PP
With this argument, build slackware package quickly and easy.
Support .tar.gz and .tar.bz2 slackbuilds archives.
.SS -l all, sbo [all, sbo ...], --list all, sbo [all, sbo ...]
\fBslpkg\fP \fB-l\fP <\fIall\fP> <\fIsbo\fP>
.PP
Two display options list, one for all packages and another
only for packages SBo.
.SS -i , --install install binary package
\fBslpkg\fP \fB-i\fP <\fIpackage.tgz or .txz\fP>
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.tgz or .txz\fP>
.PP .PP
Normally upgrade only upgrades packages that are already Normally upgrade only upgrades packages that are already
@ -53,12 +69,7 @@ Upgradepkg usually skips packages ifthe exact same package
(matching name, version, arch, and build number) is already (matching name, version, arch, and build number) is already
installed on the system.'Requires root privileges' (like installed on the system.'Requires root privileges' (like
slackware command upgradepkg --reinstall) slackware command upgradepkg --reinstall)
.SS -s name script source .SS -r , --remove package
\fBslpkg\fP \fB-s\fP <\fIscript\fP> <\fIsource\fP>
.PP
With this argument, build slackware package quickly and easy.
Support .tar.gz and .tar.bz2 slackbuilds archives.
.SS -r --remove
\fBslpkg\fP \fB-r\fP <\fIname of package\fP> \fBslpkg\fP \fB-r\fP <\fIname of package\fP>
.PP .PP
Removes a previously installed Slackware package, while writing Removes a previously installed Slackware package, while writing
@ -66,10 +77,6 @@ a progress report to the standard output. A package may be
specified either by the full package name (as you'd see listed in specified either by the full package name (as you'd see listed in
/var/log/packages/), or by the base package name. 'Requires root /var/log/packages/), or by the base package name. 'Requires root
privileges' (like slackware command removepkg) privileges' (like slackware command removepkg)
.SS -l --list
\fBslpkg\fP \fB-l\fP
.PP
List all installed packages.
.SS -f --find .SS -f --find
\fBslpkg\fP \fB-f\fP <\fIname of package\fP> \fBslpkg\fP \fB-f\fP <\fIname of package\fP>
.PP .PP

Binary file not shown.