updated for version 2.0.5

This commit is contained in:
Dimitris Zlatanidis 2014-11-18 13:30:58 +02:00
parent 9133dd9f7d
commit bb2860f942
31 changed files with 408 additions and 210 deletions

View file

@ -1,3 +1,15 @@
Version 2.0.5
15-11-2014
[Feature] - Add /etc/slpkg.conf file.
- Move "--current" switch in /etc/slpkg.conf file.
- Add local PACKAGES.TXT for Slackware repository.
- Add options to view package description.
- Add all repositories in tracking dependencies options '-t'.
- Add configuration file managment
[Updated] - Bugfix upgrading binary packages.
Version 2.0.4 Version 2.0.4
07-11-2014 07-11-2014

View file

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

View file

@ -11,9 +11,9 @@
Latest Release: Latest Release:
- Version: 2.0.4 - Version: 2.0.5
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_ - `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.4.tar.gz>`_ - `Source <https://github.com/dslackw/slpkg/archive/v2.0.5.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_ - `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
@ -102,8 +102,8 @@ Untar the archive and run install.sh script:
.. code-block:: bash .. code-block:: bash
$ tar xvf slpkg-2.0.4.tar.gz $ tar xvf slpkg-2.0.5.tar.gz
$ cd slpkg-2.0.4 $ cd slpkg-2.0.5
$ ./install.sh $ ./install.sh
Using `pip <https://pip.pypa.io/en/latest/>`_ : Using `pip <https://pip.pypa.io/en/latest/>`_ :
@ -123,7 +123,7 @@ Download binary package from `SourceForge <https://sourceforge.net/projects/slpk
Slackware Current Slackware Current
----------------- -----------------
For Slackware 'current' users must change the VERSION in /etc/slpkg.conf file. For Slackware 'current' users must change the variable VERSION in /etc/slpkg.conf file.
Command Line Tool Usage Command Line Tool Usage
----------------------- -----------------------
@ -137,31 +137,24 @@ Command Line Tool Usage
-v, --version print version and exit -v, --version print version and exit
-a, script.tar.gz [source...] auto build SBo packages -a, script.tar.gz [source...] auto build SBo packages
-b, --list, [package...] --add, --remove add, remove packages in blacklist -b, --list, [package...] --add, --remove add, remove packages in blacklist
-q, --list, [package...] --add, --remove add, remove packages in queue -q, --list, [package...] --add, --remove add, remove SBo packages in queue
--build, --install, --build-install build or install from queue --build, --install, --build-install build or install packages from queue
-l, <repository>, all, noarch list of installed packages -g, --config, --config=[editor] configuration file management
-c, <repository> --upgrade check for updated packages -l, [repository], all, noarch list of installed packages
-s, <repository> <package> download, build & install -c, [repository] --upgrade check for updated packages
-t, <repository> <package> tracking dependencies -s, [repository] [package] download, build & install
-p, <repository> <package> --color= print package description -t, [repository] [package] tracking dependencies
red, green, yellow, cyan, grey colors support -p, [repository] [package] --color=[] print package description
-f, <package> find installed packages -f, [package] find installed packages
-n, <package> view packages from SBo -n, [package] view packages from SBo
-i, [package...] install binary packages -i, [package...] install binary packages
-u, [package...] upgrade binary packages -u, [package...] upgrade binary packages
-o, [package...] reinstall binary packages -o, [package...] reinstall binary packages
-r, [package...] remove binary packages -r, [package...] remove binary packages
-d, [package...] display the contents -d, [package...] display the contents
Note: '-q' options is working only for SBo repository Repositories: <slack, sbo, alien, slacky, rlw>
Colors = [red, green, yellow, cyan, grey]
Repositories:
Slackware = slack
Alien = alien
SlackBuilds = sbo
Slacky = slacky
Robby's = rlw
Slpkg Examples Slpkg Examples
-------------- --------------

View file

@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-2.0.4} VERSION=${VERSION:-2.0.5}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
cd .. cd ..

View file

@ -19,12 +19,12 @@ slpkg - Utility for easy management packages in Slackware
[-b --list, --add, --remove [...]] [-b --list, --add, --remove [...]]
[-q --list, [...] --add, --remove] [-q --list, [...] --add, --remove]
[ --build, --install, --build-install] [ --build, --install, --build-install]
[-l <repository>, all, noarch] [-g --config, --config=[editor]]
[-c <repository> --upgrade] [-l [repository], all, noarch]
[-s <repository> <package>] [-c [repository] --upgrade]
[-t <repository> <package>] [-s [repository] [package][
[-p <repository> <package> --color=] [-t [repository] [package]]
[ red, green, yellow, cyan, grey] [-p [repository] [package] --color=]
[-f] [-n] [-i [...]] [-u [...]] [-f] [-n] [-i [...]] [-u [...]]
[-o [...]] [-r [...]] [-d [...]]\fp [-o [...]] [-r [...]] [-d [...]]\fp
@ -33,37 +33,32 @@ slpkg - Utility for easy management packages in Slackware
.PP .PP
It's a quick and easy way to manage your packages in slackware to a command. It's a quick and easy way to manage your packages in slackware to a command.
.SH EXAMPLES .SH EXAMPLES
\fBUtility for easy management packages in Slackware \fB
Utility for easy management packages in Slackware
Optional arguments: Optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-v, --version print version and exit -v, --version print version and exit
-a, script.tar.gz [source...] auto build SBo packages -a, script.tar.gz [source...] auto build SBo packages
-b, --list, [package...] --add, --remove add, remove packages in blacklist -b, --list, [package...] --add, --remove add, remove packages in blacklist
-q, --list, [package...] --add, --remove add, remove packages in queue -q, --list, [package...] --add, --remove add, remove SBo packages in queue
--build, --install, --build-install build or install from queue --build, --install, --build-install build or install packages from queue
-l, <repository>, all, noarch list of installed packages -g, --config, --config=<editor> configuration file management
-c, <repository> --upgrade check for updated packages -l, [repository], all, noarch list of installed packages
-s, <repository> <package> download, build & install -c, [repository] --upgrade check for updated packages
-t, <repository> <package> tracking dependencies -s, [repository] [package] download, build & install
-p, <repository> <package> --color= view package description -t, [repository] [package] tracking dependencies
red, green, yellow, cyan, grey colors support -p, [repository] [package] --color=[] print package description
-f, <package> find installed packages -f, [package] find installed packages
-n, <package> view packages from SBo -n, [package] view packages from SBo
-i, [package...] install binary packages -i, [package...] install binary packages
-u, [package...] upgrade binary packages -u, [package...] upgrade binary packages
-o, [package...] reinstall binary packages -o, [package...] reinstall binary packages
-r, [package...] remove binary packages -r, [package...] remove binary packages
-d, [package...] display the contents -d, [package...] display the contents
Note: '-q' options is working only for SBo repository Repositories: <slack, sbo, alien, slacky, rlw>
Colors = [red, green, yellow, cyan, grey]\fP
Repositories:
Slackware = slack
Alien = alien
SlackBuilds = sbo
Slacky = slacky
Robby's = rlw\fP
.SH GLOBAL OPTIONS .SH GLOBAL OPTIONS
.TP .TP
@ -72,62 +67,77 @@ Print the version of program and exit.
.SH COMMANDS .SH COMMANDS
.PP .PP
The following commands are available. The following commands are available.
.SS -a script source extra
.SS -a, auto build packages
\fBslpkg\fP \fB-a\fP <\fIscript\fP> <\fIsources\fP> \fBslpkg\fP \fB-a\fP <\fIscript\fP> <\fIsources\fP>
.PP .PP
With this argument, build slackware package from source quickly and easy. With this argument, build slackware package from source quickly and easy.
.SS -b , --list <packages> -- add --remove
.SS -b , add, remove, view packages in blacklist
\fBslpkg\fP \fB-b\fP \fB--list\fP <\fIpackages\fP> \fB--add\fP \fB--remove\fP \fBslpkg\fP \fB-b\fP \fB--list\fP <\fIpackages\fP> \fB--add\fP \fB--remove\fP
.PP .PP
List, add or remove packages from blacklist file. The settings here affect List, add or remove packages from blacklist file. The settings here affect
all repositories. all repositories.
.SS -q , --list <packages> --add, --remove, --build, --install, --build-install
.SS -q , add, remove, view packages in queue
\fBslpkg\fP \fB-q\fP \fB--list\fP <\fIpackages\fP> \fB--add\fP \fB--remove\fP \fBslpkg\fP \fB-q\fP \fB--list\fP <\fIpackages\fP> \fB--add\fP \fB--remove\fP
.TP
\fBslpkg\fP \fB-q\fP \fB--build\fP \fB--install\fP \fB--build-install\fP
.PP .PP
List, add, or remove sbo packages from queue. If you want to remove all the packages List, add, or remove sbo packages from queue. If you want to remove all the packages
from the list 'slpkg -q all --remove'. (these arguments only working for the sbo repository) from the list 'slpkg -q all --remove'. (these arguments only working for the sbo repository)
.PP
\fBslpkg\fP \fB-q\fP \fB--build\fP \fB--install\fP \fB--build-install\fP
.PP
Build or install or build and install packages are queued. Build or install or build and install packages are queued.
.SS -l all, sbo, slack, noarch
\fBslpkg\fP \fB-l\fP \fIall\fP \fIsbo\fP \fIslack\fP \fInoarch\fP .SS -g , configuration file management
\fBslpkg\fP \fB--config\fP \fB--config=[editor]\fP
.PP .PP
Four display options list, sbo, slack, noarch and all packages Print configuration file or edit with editor.
items that are installed on the system.
.SS -c , <repository> check if your packages is up to date .SS -l , list of installed packages per repository
\fBslpkg\fP \fB-l\fP <\fIrepository\fP> \fIall\fP \fInoarch\fP
.PP
List of installed packages per repository or all.
.SS -c , check if your packages is up to date
\fBslpkg\fP \fB-c\fP <\fIrepository\fP> \fI--upgrade\f \fBslpkg\fP \fB-c\fP <\fIrepository\fP> \fI--upgrade\f
.PP .PP
Check your packages is up to date. Check your packages is up to date.
.SS -s , <repository> download, build and install package with all dependencies
.SS -s , download, build and install package with all dependencies
\fBslpkg\fP \fB-s\fP <\fIrepository\fP> <\fIname of package\fP> \fBslpkg\fP \fB-s\fP <\fIrepository\fP> <\fIname of package\fP>
.PP .PP
Installs or upgrade packages from the repositories with automatically resolving all Installs or upgrade packages from the repositories with automatically resolving all
dependencies of the package. Also installs the official distribution Slackware dependencies of the package. Also installs the official distribution Slackware
packages. packages.
.SS -t , tracking dependencies .SS -t , tracking dependencies
\fBslpkg\fP \fB-t\fP <\fIrepository\fP> <\fIname of package\fP> \fBslpkg\fP \fB-t\fP <\fIrepository\fP> <\fIname of package\fP>
.PP .PP
Tracking all dependencies of that package. Tracking all dependencies of that package.
The sequence shown is that you must follow to correctly install package. The sequence shown is that you must follow to correctly install package.
.SS -p , print packages description .SS -p , print packages description
\fBslpkg\fP \fB-p\fP <\fIrepository\fP> <\fIname of package\fP> \fBslpkg\fP \fB-p\fP <\fIrepository\fP> <\fIname of package\fP>
.PP .PP
Print package description Print package description
.SS -f find packages .SS -f find packages
\fBslpkg\fP \fB-f\fP <\fIname of package\fP> \fBslpkg\fP \fB-f\fP <\fIname of package\fP>
.PP .PP
Find installed packages with view total file size. Find installed packages with view total file size.
.SS -n , find packages from SBo repositority .SS -n , find packages from SBo repositority
\fBslpkg\fP \fB-n\fP <\fIname of package\fP> \fBslpkg\fP \fB-n\fP <\fIname of package\fP>
.PP .PP
With this method you can find the SBo script that interests you through With this method you can find the SBo script that interests you through
the network. (www.slackbuilds.org) the network. (www.slackbuilds.org)
.SS -i , install binary packages .SS -i , install binary packages
\fBslpkg\fP \fB-i\fP <\fIpackages.t?z\fP> \fBslpkg\fP \fB-i\fP <\fIpackages.t?z\fP>
.PP .PP
Installs single binary packages designed for use with the Installs single binary packages designed for use with the
Slackware Linux distribution into your system. Slackware Linux distribution into your system.
.SS -u , install-upgrade packages with new .SS -u , install-upgrade packages with new
\fBslpkg\fP \fB-u\fP <\fIpackages.t?z\fP> \fBslpkg\fP \fB-u\fP <\fIpackages.t?z\fP>
.PP .PP
@ -135,6 +145,7 @@ Normally upgrade only upgrades packages that are already
installed on the system, and will skip any packages that do not installed on the system, and will skip any packages that do not
already have a version installed. 'Requires root privileges' already have a version installed. 'Requires root privileges'
(like slackware command upgradepkg --install-new) (like slackware command upgradepkg --install-new)
.SS -o , reinstall binary packages .SS -o , reinstall binary packages
\fBslpkg\fP \fB-o\fP <\fIpackages.t?z\fP> \fBslpkg\fP \fB-o\fP <\fIpackages.t?z\fP>
.PP .PP
@ -142,6 +153,7 @@ Upgradepkg usually skips packages if the 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 -r , remove packages .SS -r , remove packages
\fBslpkg\fP \fB-r\fP <\fIname of packages\fP> \fBslpkg\fP \fB-r\fP <\fIname of packages\fP>
.PP .PP
@ -153,10 +165,12 @@ packages with command 'slpkg -s sbo <package>' then write a file
in /var/log/slpkg/dep/ with all dependencies and it allows you in /var/log/slpkg/dep/ with all dependencies and it allows you
can remove them all together. 'Requires root can remove them all together. 'Requires root
privileges' (like slackware command removepkg) privileges' (like slackware command removepkg)
.SS -d , display contents .SS -d , display contents
\fBslpkg\fP \fB-d\fP <\fIname of packages\fP> \fBslpkg\fP \fB-d\fP <\fIname of packages\fP>
.PP .PP
Display the contents of the package with all descriptions. Display the contents of the package with all descriptions.
.SH HELP OPTION .SH HELP OPTION
Specifying the help option displays help for slpkg itself, or a Specifying the help option displays help for slpkg itself, or a
command. command.

View file

@ -93,7 +93,7 @@ gzip -9 man/$PRGNAM.8
install -D -m0644 man/$PRGNAM.8.gz $PKG/usr/man/man8/$PRGNAM.8.gz install -D -m0644 man/$PRGNAM.8.gz $PKG/usr/man/man8/$PRGNAM.8.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.rst CHANGELOG LICENSE CONTRIBUTING ISSUES $PKG/usr/doc/$PRGNAM-$VERSION cp -a README.rst CHANGELOG LICENSE TESTING ISSUES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install mkdir -p $PKG/install

View file

@ -22,9 +22,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import getpass
from config import slpkg_conf from config import config_file
from messages import s_user
__all__ = "slpkg" __all__ = "slpkg"
__author__ = "dslackw" __author__ = "dslackw"
@ -33,6 +34,7 @@ __version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"
s_user(getpass.getuser())
# temponary path # temponary path
tmp = "/tmp/" tmp = "/tmp/"
@ -42,7 +44,7 @@ if not os.path.exists("/etc/slpkg/"):
if not os.path.isfile("/etc/slpkg/slpkg.conf"): if not os.path.isfile("/etc/slpkg/slpkg.conf"):
with open("/etc/slpkg/slpkg.conf", "w") as conf: with open("/etc/slpkg/slpkg.conf", "w") as conf:
for line in slpkg_conf: for line in config_file():
conf.write(line) conf.write(line)
conf.close() conf.close()

View file

@ -40,15 +40,15 @@ def options():
"in queue", "in queue",
" --build, --install, --build-install build or install packages " " --build, --install, --build-install build or install packages "
"from queue", "from queue",
" -g, --config, --config=<editor> configuration file " + " -g, --config, --config=[editor] configuration file " +
"management", "management",
" -l, <repository>, all, noarch list of installed " + " -l, [repository], all, noarch list of installed " +
"packages", "packages",
" -c, <repository> --upgrade check for updated " + " -c, [repository] --upgrade check for updated " +
"packages", "packages",
" -s, <repository> [package] download, build & install", " -s, [repository] [package] download, build & install",
" -t, <repository> [package] tracking dependencies", " -t, [repository] [package] tracking dependencies",
" -p, <repository> [package] --color=[] print package description", " -p, [repository] [package] --color=[] print package description",
" -f, [package] find installed packages", " -f, [package] find installed packages",
" -n, [package] view packages from SBo", " -n, [package] view packages from SBo",
" -i, [package...] install binary packages", " -i, [package...] install binary packages",
@ -70,15 +70,14 @@ def usage():
" [-b --list, [...] --add, --remove]", " [-b --list, [...] --add, --remove]",
" [-q --list, [...] --add, --remove]", " [-q --list, [...] --add, --remove]",
" [ --build, --install, --build-install]", " [ --build, --install, --build-install]",
" [-g --config, --config=<editor>]", " [-g --config, --config=[editor]]",
" [-l <repository>, all, noarch]", " [-l [repository], all, noarch]",
" [-c <repository> --upgrade]", " [-c [repository] --upgrade]",
" [-s <repository> <package>]", " [-s [repository] [package]",
" [-t <repository> <package>]", " [-t [repository] [package]",
" [-p <repository> <package> --color=]", " [-p [repository] [package] --color=[]]",
" [ red, green, yellow, cyan, grey]",
" [-f] [-n] [-i [...]] [-u [...]]", " [-f] [-n] [-i [...]] [-u [...]]",
" [-o [...]] [-r [...]] [-d [...]]\n" " [-o [...]] [-r [...]] [-d [...]]\n",
"For more information try 'slpkg --help'\n" "For more information try 'slpkg --help'\n"
] ]
for usg in view: for usg in view:

View file

@ -24,7 +24,11 @@
import os import os
from __metadata__ import bls_path from __metadata__ import bls_path
from colors import RED, GREEN, ENDC from colors import (
RED,
GREEN,
ENDC
)
class BlackList(object): class BlackList(object):

View file

@ -24,66 +24,75 @@
import os import os
import subprocess import subprocess
from colors import CYAN, ENDC from colors import (
CYAN,
ENDC
)
slpkg_conf = [
"# Configuration file for slpkg\n",
"\n",
"# slpkg.conf file is part of slpkg.\n",
"\n",
"# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>\n",
"# All rights reserved.\n",
"\n",
"# Utility for easy management packages in Slackware\n",
"\n",
"# https://github.com/dslackw/slpkg\n",
"\n",
"# Slpkg is free software: you can redistribute it and/or modify\n",
"# it under the terms of the GNU General Public License as published by\n",
"# the Free Software Foundation, either version 3 of the License, or\n",
"# (at your option) any later version.\n",
"# This program is distributed in the hope that it will be useful,\n",
"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n",
"# GNU General Public License for more details.\n",
"# You should have received a copy of the GNU General Public License\n",
"# along with this program. If not, see <http://www.gnu.org/licenses/>.\n",
"\n",
"# Slackware version 'stable' or 'current'.\n",
"VERSION=stable\n",
"\n",
"# Build directory for repository slackbuilds.org. In this directory\n",
"# downloaded sources and scripts for building.\n",
"BUILD=/tmp/slpkg/build/\n",
"\n",
"# If SBO_CHECK_MD5 is 'on' the system will check all downloaded\n",
"# sources from SBo repository.\n",
"SBO_CHECK_MD5=on\n",
"\n",
"# Download directory for others repositories that use binaries files\n",
"# for installation.\n",
"PACKAGES=/tmp/slpkg/packages/\n",
"\n",
"# Download directory for Slackware patches file.\n",
"PATCHES=/tmp/slpkg/patches/\n",
"\n",
"# Delete all downloaded files if DEL_ALL is 'on'.\n",
"DEL_ALL=on\n",
"\n",
"# Delete build directory after each process if DEL_BUILD is 'on'.\n",
"DEL_BUILD=off\n",
"\n",
"# Keep build log file if SBO_BUILD_LOG is 'on'.\n",
"SBO_BUILD_LOG=on\n"
]
if not os.path.exists("/etc/slpkg"): def config_file():
os.mkdir("/etc/slpkg") slpkg_conf = [
if not os.path.isfile("/etc/slpkg/slpkg.conf"): "# Configuration file for slpkg\n",
with open("/etc/slpkg/slpkg.conf", "w") as conf: "\n",
for line in slpkg_conf: "# slpkg.conf file is part of slpkg.\n",
conf.write(line) "\n",
conf.close() "# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>\n",
"# All rights reserved.\n",
"\n",
"# Utility for easy management packages in Slackware\n",
"\n",
"# https://github.com/dslackw/slpkg\n",
"\n",
"# Slpkg is free software: you can redistribute it and/or modify\n",
"# it under the terms of the GNU General Public License as published " +
"by\n",
"# the Free Software Foundation, either version 3 of the License, or\n",
"# (at your option) any later version.\n",
"# This program is distributed in the hope that it will be useful,\n",
"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n",
"# GNU General Public License for more details.\n",
"# You should have received a copy of the GNU General Public License\n",
"# along with this program. If not, see <http://www.gnu.org/licenses/" +
">.\n",
"\n",
"# Slackware version 'stable' or 'current'.\n",
"VERSION=stable\n",
"\n",
"# Build directory for repository slackbuilds.org. In this directory\n",
"# downloaded sources and scripts for building.\n",
"BUILD=/tmp/slpkg/build/\n",
"\n",
"# If SBO_CHECK_MD5 is 'on' the system will check all downloaded\n",
"# sources from SBo repository.\n",
"SBO_CHECK_MD5=on\n",
"\n",
"# Download directory for others repositories that use binaries files" +
"\n",
"# for installation.\n",
"PACKAGES=/tmp/slpkg/packages/\n",
"\n",
"# Download directory for Slackware patches file.\n",
"PATCHES=/tmp/slpkg/patches/\n",
"\n",
"# Delete all downloaded files if DEL_ALL is 'on'.\n",
"DEL_ALL=on\n",
"\n",
"# Delete build directory after each process if DEL_BUILD is 'on'.\n",
"DEL_BUILD=off\n",
"\n",
"# Keep build log file if SBO_BUILD_LOG is 'on'.\n",
"SBO_BUILD_LOG=on\n"
]
if not os.path.exists("/etc/slpkg"):
os.mkdir("/etc/slpkg")
if not os.path.isfile("/etc/slpkg/slpkg.conf"):
with open("/etc/slpkg/slpkg.conf", "w") as conf:
for line in slpkg_conf:
conf.write(line)
conf.close()
return slpkg_conf
class Config(object): class Config(object):
@ -95,7 +104,7 @@ class Config(object):
''' '''
View slpkg config file View slpkg config file
''' '''
print("") print("") # new line at start
conf_args = [ conf_args = [
'VERSION', 'VERSION',
'BUILD', 'BUILD',
@ -114,7 +123,7 @@ class Config(object):
print(line) print(line)
else: else:
print("{0}{1}{2}".format(CYAN, line, ENDC)) print("{0}{1}{2}".format(CYAN, line, ENDC))
print("") print("") # new line at end
def edit(self, editor): def edit(self, editor):
''' '''

View file

@ -24,8 +24,19 @@
from init import Initialization from init import Initialization
from messages import pkg_not_found from messages import pkg_not_found
from colors import RED, GREEN, YELLOW, CYAN, GREY, ENDC from colors import (
from __metadata__ import pkg_path, lib_path, repositories RED,
GREEN,
YELLOW,
CYAN,
GREY,
ENDC
)
from __metadata__ import (
pkg_path,
lib_path,
repositories
)
from pkg.find import find_package from pkg.find import find_package

View file

@ -24,7 +24,10 @@
import sys import sys
import subprocess import subprocess
from colors import GREEN, ENDC from colors import (
GREEN,
ENDC
)
class Download(object): class Download(object):

View file

@ -43,7 +43,7 @@ class FileSize(object):
print("\nError: connection refused\n") print("\nError: connection refused\n")
sys.exit() sys.exit()
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at cancel print("") # new line at cancel
sys.exit() sys.exit()
def local(self): def local(self):

View file

@ -27,8 +27,14 @@ import sys
from url_read import URL from url_read import URL
from repositories import Repo from repositories import Repo
from file_size import FileSize from file_size import FileSize
from __metadata__ import (log_path, lib_path, slack_rel, from __metadata__ import (
build_path, slpkg_tmp_packages, slpkg_tmp_patches) log_path,
lib_path,
slack_rel,
build_path,
slpkg_tmp_packages,
slpkg_tmp_patches
)
from slack.mirrors import mirrors from slack.mirrors import mirrors
from slack.slack_version import slack_ver from slack.slack_version import slack_ver

View file

@ -32,7 +32,11 @@ from tracking import track_dep
from blacklist import BlackList from blacklist import BlackList
from version import prog_version from version import prog_version
from arguments import options, usage from arguments import options, usage
from __metadata__ import path, repositories, slack_rel from __metadata__ import (
path,
repositories,
slack_rel
)
from pkg.build import BuildPackage from pkg.build import BuildPackage
from pkg.manager import PackageManager from pkg.manager import PackageManager
@ -168,7 +172,7 @@ def main():
PackageManager(args[1:]).remove() PackageManager(args[1:]).remove()
elif len(args) > 1 and args[0] == "-f": elif len(args) > 1 and args[0] == "-f":
PackageManager(args[1:]).find() PackageManager(args[1:]).find()
elif len(args) == 3 and args[0] == "-p": elif len(args) == 3 and args[0] == "-p" and args[1] in repositories:
PkgDesc(args[2], args[1], "").view() PkgDesc(args[2], args[1], "").view()
elif len(args) == 4 and args[0] == "-p" and args[3].startswith("--color="): elif len(args) == 4 and args[0] == "-p" and args[3].startswith("--color="):
colors = ['red', 'green', 'yellow', 'cyan', 'grey'] colors = ['red', 'green', 'yellow', 'cyan', 'grey']

View file

@ -22,7 +22,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys import sys
from colors import RED, CYAN, ENDC
from colors import (
RED,
CYAN,
ENDC
)
def pkg_not_found(bol, pkg, message, eol): def pkg_not_found(bol, pkg, message, eol):

View file

@ -30,7 +30,11 @@ from messages import template
from blacklist import BlackList from blacklist import BlackList
from init import Initialization from init import Initialization
from splitting import split_package from splitting import split_package
from colors import YELLOW, GREY, ENDC from colors import (
YELLOW,
GREY,
ENDC
)
from __metadata__ import ( from __metadata__ import (
pkg_path, pkg_path,
lib_path, lib_path,

View file

@ -24,9 +24,9 @@
import os import os
from toolbar import status from toolbar import status
from init import Initialization
from __metadata__ import lib_path from __metadata__ import lib_path
from splitting import split_package from splitting import split_package
from init import Initialization
from slack.slack_version import slack_ver from slack.slack_version import slack_ver

View file

@ -29,11 +29,24 @@ from repositories import Repo
from init import Initialization from init import Initialization
from blacklist import BlackList from blacklist import BlackList
from splitting import split_package from splitting import split_package
from messages import pkg_not_found, template from messages import (
from colors import RED, GREEN, CYAN, YELLOW, GREY, ENDC pkg_not_found,
from __metadata__ import (pkg_path, lib_path, log_path, template
slpkg_tmp_packages) )
from colors import (
RED,
GREEN,
CYAN,
YELLOW,
GREY,
ENDC
)
from __metadata__ import (
pkg_path,
lib_path,
log_path,
slpkg_tmp_packages
)
from pkg.find import find_package from pkg.find import find_package
from pkg.manager import PackageManager from pkg.manager import PackageManager

View file

@ -30,9 +30,20 @@ import tarfile
import subprocess import subprocess
from checksum import md5sum from checksum import md5sum
from colors import RED, GREEN, ENDC from colors import (
from messages import pkg_not_found, template RED,
from __metadata__ import log_path, sbo_build_log, sbo_check_md5 GREEN,
ENDC
)
from messages import (
pkg_not_found,
template
)
from __metadata__ import (
log_path,
sbo_build_log,
sbo_check_md5
)
from sbo.greps import SBoGrep from sbo.greps import SBoGrep
@ -97,7 +108,7 @@ class BuildPackage(object):
except (OSError, IOError): except (OSError, IOError):
pkg_not_found("\n", self.prgnam, "Wrong file", "\n") pkg_not_found("\n", self.prgnam, "Wrong file", "\n")
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at exit print("") # new line at exit
sys.exit() sys.exit()
@ -123,7 +134,7 @@ def check_md5(sbo_md5, src):
print("| MD5SUM check for {0} [ {1}PASSED{2} ]".format(src, GREEN, print("| MD5SUM check for {0} [ {1}PASSED{2} ]".format(src, GREEN,
ENDC)) ENDC))
template(78) template(78)
print # new line after pass checksum print("") # new line after pass checksum
def log_head(path, log_file, log_time): def log_head(path, log_file, log_time):

View file

@ -25,9 +25,22 @@ import os
import sys import sys
import subprocess import subprocess
from messages import pkg_not_found, template from messages import (
from colors import RED, GREEN, CYAN, GREY, ENDC pkg_not_found,
from __metadata__ import pkg_path, sp, log_path template
)
from colors import (
RED,
GREEN,
CYAN,
GREY,
ENDC
)
from __metadata__ import (
pkg_path,
sp,
log_path
)
from find import find_package from find import find_package
@ -70,9 +83,8 @@ class PackageManager(object):
''' '''
for pkg in self.binary: for pkg in self.binary:
try: try:
print( print(subprocess.check_output(
subprocess.check_output("upgradepkg --reinstall {0}".format( "upgradepkg --reinstall {0}".format(pkg), shell=True))
pkg), shell=True))
print("Completed!\n") print("Completed!\n")
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
self.not_found("Can't reinstall", self.binary, pkg) self.not_found("Can't reinstall", self.binary, pkg)

View file

@ -24,8 +24,16 @@
import os import os
from downloader import Download from downloader import Download
from colors import GREEN, RED, ENDC from colors import (
from __metadata__ import lib_path, build_path, tmp GREEN,
RED,
ENDC
)
from __metadata__ import (
lib_path,
build_path,
tmp
)
from sbo.greps import SBoGrep from sbo.greps import SBoGrep
from pkg.find import find_package from pkg.find import find_package

View file

@ -32,9 +32,23 @@ from toolbar import status
from init import Initialization from init import Initialization
from downloader import Download from downloader import Download
from splitting import split_package from splitting import split_package
from messages import template, build_FAILED from messages import (
from colors import RED, GREEN, GREY, YELLOW, ENDC template,
from __metadata__ import tmp, pkg_path, build_path, sp build_FAILED
)
from colors import (
RED,
GREEN,
GREY,
YELLOW,
ENDC
)
from __metadata__ import (
tmp,
pkg_path,
build_path,
sp
)
from greps import SBoGrep from greps import SBoGrep
from remove import delete from remove import delete

View file

@ -21,7 +21,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from __metadata__ import arch, lib_path from __metadata__ import (
arch,
lib_path
)
class SBoGrep(object): class SBoGrep(object):

View file

@ -28,12 +28,28 @@ from toolbar import status
from init import Initialization from init import Initialization
from downloader import Download from downloader import Download
from splitting import split_package from splitting import split_package
from __metadata__ import (tmp, pkg_path, build_path, from __metadata__ import (
log_path, lib_path, sp) tmp,
pkg_path,
from colors import RED, GREEN, GREY, YELLOW, CYAN, ENDC build_path,
from messages import (pkg_found, template, build_FAILED, log_path,
pkg_not_found) lib_path,
sp
)
from colors import (
RED,
GREEN,
GREY,
YELLOW,
CYAN,
ENDC
)
from messages import (
pkg_found,
template,
build_FAILED,
pkg_not_found
)
from pkg.find import find_package from pkg.find import find_package
from pkg.build import BuildPackage from pkg.build import BuildPackage

View file

@ -27,10 +27,26 @@ import pydoc
from init import Initialization from init import Initialization
from downloader import Download from downloader import Download
from __metadata__ import tmp, build_path, pkg_path, sp from __metadata__ import (
from colors import RED, GREEN, GREY, CYAN, YELLOW, ENDC tmp,
from messages import (pkg_found, pkg_not_found, template, build_path,
build_FAILED) pkg_path,
sp
)
from colors import (
RED,
GREEN,
GREY,
CYAN,
YELLOW,
ENDC
)
from messages import (
pkg_found,
pkg_not_found,
template,
build_FAILED
)
from pkg.find import find_package from pkg.find import find_package
from pkg.build import BuildPackage from pkg.build import BuildPackage
@ -52,11 +68,12 @@ class SBoNetwork(object):
sys.stdout.flush() sys.stdout.flush()
grep = SBoGrep(self.name) grep = SBoGrep(self.name)
self.sbo_url = sbo_search_pkg(self.name) self.sbo_url = sbo_search_pkg(self.name)
self.sbo_desc = grep.description()[len(self.name) + 2:-1] if self.sbo_url:
self.sbo_req = grep.requires() self.sbo_desc = grep.description()[len(self.name) + 2:-1]
self.source_dwn = grep.source().split() self.source_dwn = grep.source().split()
self.sbo_dwn = SBoLink(self.sbo_url).tar_gz() self.sbo_req = grep.requires()
self.sbo_version = grep.version() self.sbo_dwn = SBoLink(self.sbo_url).tar_gz()
self.sbo_version = grep.version()
self.space = ("\n" * 50) self.space = ("\n" * 50)
sys.stdout.write("{0}Done{1}\n".format(GREY, ENDC)) sys.stdout.write("{0}Done{1}\n".format(GREY, ENDC))

View file

@ -28,9 +28,23 @@ from sizes import units
from blacklist import BlackList from blacklist import BlackList
from init import Initialization from init import Initialization
from splitting import split_package from splitting import split_package
from messages import pkg_not_found, template from messages import (
from colors import RED, GREEN, CYAN, YELLOW, GREY, ENDC pkg_not_found,
from __metadata__ import pkg_path, lib_path, slpkg_tmp_packages template
)
from colors import (
RED,
GREEN,
CYAN,
YELLOW,
GREY,
ENDC
)
from __metadata__ import (
pkg_path,
lib_path,
slpkg_tmp_packages
)
from pkg.find import find_package from pkg.find import find_package
from pkg.manager import PackageManager from pkg.manager import PackageManager

View file

@ -30,8 +30,15 @@ from url_read import URL
from messages import template from messages import template
from blacklist import BlackList from blacklist import BlackList
from splitting import split_package from splitting import split_package
from colors import GREY, YELLOW, ENDC from colors import (
from __metadata__ import pkg_path, slpkg_tmp_patches GREY,
YELLOW,
ENDC
)
from __metadata__ import (
pkg_path,
slpkg_tmp_patches
)
from pkg.manager import PackageManager from pkg.manager import PackageManager

View file

@ -24,7 +24,10 @@
import sys import sys
import time import time
from colors import GREY, ENDC from colors import (
GREY,
ENDC
)
def status(index, width, step): def status(index, width, step):

View file

@ -25,8 +25,18 @@ import sys
from messages import template from messages import template
from init import Initialization from init import Initialization
from __metadata__ import pkg_path, sp from __metadata__ import (
from colors import RED, GREEN, GREY, YELLOW, CYAN, ENDC pkg_path,
sp
)
from colors import (
RED,
GREEN,
GREY,
YELLOW,
CYAN,
ENDC
)
from pkg.find import find_package from pkg.find import find_package

View file

@ -21,7 +21,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from __metadata__ import __version__, __license__, __email__ from __metadata__ import (
__version__,
__license__,
__email__
)
def prog_version(): def prog_version():