diff --git a/CHANGELOG b/CHANGELOG index de1fb883..dc860e6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,18 @@ +Version 2.0.7 +22-11-2014 + +[Feature] - Add more option in slpkg.conf file. + - Add slackware-mirrors file in /etc/slpkg + +[Updated] - Fix upgrade Slackware packages if installed. + +Version 2.0.6 +18-11-2014 + +[Updated] - Fix setup.py file + Version 2.0.5 -15-11-2014 +18-11-2014 [Feature] - Add /etc/slpkg.conf file. - Move "--current" switch in /etc/slpkg.conf file. diff --git a/INSTALL b/INSTALL index d89a9efd..5812fa58 100644 --- a/INSTALL +++ b/INSTALL @@ -17,30 +17,10 @@ There are mainly five ways: Untar or unzip the archive, cd in slpkg-?.?.? directory. Run install.sh in this directory `./install.sh` and slpkg auto-installed. -2) Using the SlackBuild script in the directory slpkg-?.?.?/slackbuild. +2) Download slpkg package from slackbuilds.org. - Untar the archive `tar xvf slpkg-?.?.?.tar.gz` - - Copy the source tar archive `cp slpkg-?.?.?.tar.gz slpkg-?.?.?/slackbuild`, - change directory `cd slpkg-?.?.?/slackbuild`, fix the version if need in - SlackBuild.slpkg give execution permissions to script `chmod +x SlackBuild.slpkg` - and run as root ./SlackBuild.slpkg. - - SlackBuild package created so install package with `upgradepkg --install-new - /tmp/slpkg-?.?.?-x86_64-1_dsw.tgz` (x86_64 for Slackware64). - -3) Using pip: - - `pip install slpkg` or upgrade `pip install --upgrade slpkg` - -4) Download slpkg package from slackbuilds.org and run the second procedure described above. - -5) Download binary package from sourceforge: +3) Download binary package from sourceforge: https://sourceforge.net/projects/slpkg/ and use Slackware command `upgradepkg --install-new ` - - -Proposed mode if you want to have installed the most updated version is 1 or 2 and 3 -process. diff --git a/PKG-INFO b/PKG-INFO index 0de0305a..3248c94d 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: slpkg -Version: 2.0.5 +Version: 2.0.7 Author: dslackw Author-email: d zlatanidis at gmail com Maintainer: dslackw diff --git a/README.rst b/README.rst index e83599b8..c84d0155 100644 --- a/README.rst +++ b/README.rst @@ -11,9 +11,9 @@ Latest Release: -- Version: 2.0.5 +- Version: 2.0.7 - `Package `_ -- `Source `_ +- `Source `_ - `CHANGELOG `_ .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png @@ -32,10 +32,20 @@ Python language. It's use is for managing packages in Slackware linux distributi Supported Repositories: - SBo - `slackbuilds.org `_ + Arch: {x86, x86_64} + Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} - Slack - `slackware.com `_ + Arch: {x86, x86_64} + Versions: {3.3, 8.1, 9.0, 9.1, 10.0, 10.1, 10.2, 11.0, 12.0, 12.2, 13.0, 13.37, 14.0, 14.1, current} - Alien - `alien bob `_ + Arch: {x86, x86_64} + Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1, current} - Slacky - `slacky.eu `_ + Arch: {x86, x86_64} + Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} - Robby's - `rworkman's `_ + Arch: {x86, x86_64} + Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} Slpkg works in accordance with the standards of the organization slackbuilds.org to builds packages. Also uses the Slackware linux instructions for installation, @@ -102,29 +112,38 @@ Untar the archive and run install.sh script: .. code-block:: bash - $ tar xvf slpkg-2.0.5.tar.gz - $ cd slpkg-2.0.5 + $ tar xvf slpkg-2.0.7.tar.gz + $ cd slpkg-2.0.7 $ ./install.sh -Using `pip `_ : - -.. code-block:: bash - - $ pip install --upgrade slpkg - - uninstall: - - $ pip uninstall slpkg - -Using Slackware command: +From SourceForge: Download binary package from `SourceForge `_ +Upgrade +------------- + +In each upgrade should track the configuration files in the file '/etc/slpkg' for +new updates. + + Slackware Current ----------------- For Slackware 'current' users must change the variable VERSION in /etc/slpkg.conf file. +.. code-block:: bash + +$ slpkg -g --config=nano + + +Slackware Mirrors +----------------- + +Slpkg uses the central mirror "http://mirrors.slackware.com/slackware/" +to find the nearest one. If however for some reason this troublesome +please edit the file in /etc/slpkg/slackware-mirrors + Command Line Tool Usage ----------------------- diff --git a/conf/slpkg.conf b/conf/slpkg.conf index af45e425..4f90c3ee 100644 --- a/conf/slpkg.conf +++ b/conf/slpkg.conf @@ -54,4 +54,3 @@ DEFAULT_ANSWER=n # Define default answer for the removal of dependencies. # Choose 'y' if you do not want to question. REMOVE_DEPS_ANSWER=n - diff --git a/install.sh b/install.sh index 7cfef5eb..88b05d1b 100755 --- a/install.sh +++ b/install.sh @@ -21,41 +21,25 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-2.0.5} +VERSION=${VERSION:-2.0.7} TAG=${TAG:-_dsw} -cd .. # Installation script. # With this script allows you to install the slpkg as a package SlackBuild. # Select archive to copy in slackbuild directory # support wget download. -if [ -f $PRGNAM-$VERSION.zip ]; then - cp $PRGNAM-$VERSION.zip $PRGNAM-$VERSION/slackbuild - cd $PRGNAM-$VERSION/slackbuild - chmod +x $PRGNAM.SlackBuild - ./$PRGNAM.SlackBuild - rm $PRGNAM-$VERSION.zip -elif [ -f v$VERSION.zip ]; then - cp v$VERSION.zip $PRGNAM-$VERSION/slackbuild - cd $PRGNAM-$VERSION/slackbuild - chmod +x $PRGNAM.SlackBuild - ./$PRGNAM.SlackBuild - rm v$VERSION.zip +ARCHIVES="$PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION.zip v$VERSION.tar.gz v$VERSION.zip" +cd .. +for file in $ARCHIVES; do + if [ -f $file ]; then + cp $file $PRGNAM-$VERSION/slackbuild + cd $PRGNAM-$VERSION/slackbuild + chmod +x $PRGNAM.SlackBuild + ./$PRGNAM.SlackBuild + rm $file + fi +done -elif [ -f $PRGNAM-$VERSION.tar.gz ]; then - cp $PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION/slackbuild - cd $PRGNAM-$VERSION/slackbuild - chmod +x $PRGNAM.SlackBuild - ./$PRGNAM.SlackBuild - rm $PRGNAM-$VERSION.tar.gz - -else - cp v$VERSION.tar.gz $PRGNAM-$VERSION/slackbuild - cd $PRGNAM-$VERSION/slackbuild - chmod +x $PRGNAM.SlackBuild - ./$PRGNAM.SlackBuild - rm v$VERSION.tar.gz -fi # install or upgrade with new version -upgradepkg --install-new /tmp/$PRGNAM-$VERSION-*$TAG.tgz +upgradepkg --install-new /tmp/$PRGNAM-$VERSION-*$TAG.t?z diff --git a/man/slpkg.8 b/man/slpkg.8 index 52364090..4e071936 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -186,6 +186,9 @@ For example: /etc/slpkg/blacklist List of packages to skip +/etc/slpkg/slackware-mirrors + List of Slackware Mirrors + /var/log/slpkg ChangeLog.txt repositories files SlackBuilds logs and dependencies files diff --git a/setup.py b/setup.py index d62ff379..83a4ffa5 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,11 @@ import sys import gzip import shutil -from slpkg.__metadata__ import __version__, __email__, __author__ +from slpkg.__metadata__ import ( + __version__, + __email__, + __author__ +) try: from setuptools import setup @@ -81,15 +85,13 @@ if "install" in sys.argv: os.chmod(man_path, int("444", 8)) conf_path = "/etc/slpkg/" - conf_file = "conf/slpkg.conf" - black_file = "conf/blacklist" + conf_file = [ + 'conf/slpkg.conf', + 'conf/blacklist', + 'conf/slackware-mirrors' + ] if not os.path.exists(conf_path): os.system("mkdir -p {0}".format(conf_path)) - # slpkg.conf file - if not os.isfile(conf_path + conf_file): - print("Installing slpkg configuration file") - shutil.copy2(conf_file, conf_path) - # blacklist file - if not os.isfile(conf_path + black_file): - print("Installing blacklist configuration file") - shutil.copy2(black_file, conf_path) + for conf in conf_file: + print("Installing '{0}' file".format(conf.split("/")[-1])) + shutil.copy2(conf, conf_path) diff --git a/slackbuild/doinst.sh b/slackbuild/doinst.sh index 236b3a62..c06beaa6 100644 --- a/slackbuild/doinst.sh +++ b/slackbuild/doinst.sh @@ -8,7 +8,10 @@ config() { fi } -config /etc/slpkg/slpkg.conf.new +CONFIGS="slpkg.conf blacklist slackware-mirrors" +for file in $CONFIGS; do + config /etc/slpkg/${file}.new +done if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 37f26191..f34f5449 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-2.0.5} +VERSION=${VERSION:-2.0.7} BUILD=${BUILD:-1} TAG=${TAG:-_dsw} @@ -78,14 +78,11 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/etc/slpkg -# check if blacklist file if already exist in /etc/slpkg -if [ ! -f "/etc/$PRGNAM/blacklist" ]; then - mkdir -p $PKG/etc/$PRGNAM - install -D -m0644 conf/blacklist $PKG/etc/$PRGNAM/blacklist -fi - -# install configuration file -mv $PKG/etc/slpkg/slpkg.conf $PKG/etc/slpkg/slpkg.conf.new +# install configurations files +CONFIGS="slpkg.conf blacklist slackware-mirrors" +for file in $CONFIGS; do + install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new +done # install man page mkdir -p $PKG/usr/man/man8 diff --git a/slackbuild/slpkg.info b/slackbuild/slpkg.info index 43e88dee..9c63aa5a 100644 --- a/slackbuild/slpkg.info +++ b/slackbuild/slpkg.info @@ -1,7 +1,7 @@ PRGNAM="slpkg" -VERSION="2.0.5" +VERSION="2.0.6" HOMEPAGE="https://github.com/dslackw/slpkg" -DOWNLOAD="https://github.com/dslackw/slpkg/archive/v2.0.5.tar.gz" +DOWNLOAD="https://github.com/dslackw/slpkg/archive/v2.0.6.tar.gz" MD5SUM="" DOWNLOAD_x86_64="" MD5SUM_x86_64="" diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index ad364789..947e1da0 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# __metadata__.py +# __metadata__.py file is part of slpkg. # Copyright 2014 Dimitris Zlatanidis # All rights reserved. @@ -24,12 +24,11 @@ import os import getpass -from config import config_file from messages import s_user __all__ = "slpkg" __author__ = "dslackw" -__version_info__ = (2, 0, 6) +__version_info__ = (2, 0, 7) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" @@ -39,15 +38,6 @@ s_user(getpass.getuser()) # temponary path tmp = "/tmp/" -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 config_file(): - conf.write(line) - conf.close() - f = open("/etc/slpkg/slpkg.conf", "r") conf = f.read() f.close() diff --git a/slpkg/config.py b/slpkg/config.py index 9f7649e9..3fa06fb2 100755 --- a/slpkg/config.py +++ b/slpkg/config.py @@ -21,7 +21,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os import subprocess from colors import ( @@ -30,79 +29,6 @@ from colors import ( ) -def config_file(): - slpkg_conf = [ - "# Configuration file for slpkg\n", - "\n", - "# slpkg.conf file is part of slpkg.\n", - "\n", - "# Copyright 2014 Dimitris Zlatanidis \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 .\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", - "\n", - "# Define default answer to slpkg questions.\n", - "# Choose 'y' if you do not want to questions.\n", - "DEFAULT_ANSWER=n\n", - "\n", - "# Define default answer for the removal of dependencies.\n", - "# Choose 'y' if you do not want to question.\n", - "REMOVE_DEPS_ANSWER=n\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): def __init__(self): @@ -122,7 +48,8 @@ class Config(object): 'DEL_ALL', 'DEL_BUILD', 'SBO_BUILD_LOG', - 'DEFAULT_ANSWER' + 'DEFAULT_ANSWER', + 'REMOVE_DEPS_ANSWER' ] f = open(self.config_file, "r") read_conf = f.read() diff --git a/slpkg/init.py b/slpkg/init.py index d83ee012..150de9b9 100755 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -196,7 +196,6 @@ class Initialization(object): os.remove("{0}{1}".format(args[3], args[4])) os.remove("{0}{1}".format(args[0], args[1])) print("\nNEWS in " + args[1]) - print("slpkg ...initialization") sys.stdout.write("Files re-created ...") sys.stdout.flush() for fu in args[5].split(): diff --git a/slpkg/others/dependency.py b/slpkg/others/dependency.py index fee2c883..4df4783b 100644 --- a/slpkg/others/dependency.py +++ b/slpkg/others/dependency.py @@ -23,7 +23,7 @@ import sys -from toolbar import status +from slpkg.toolbar import status from greps import Requires diff --git a/slpkg/others/download.py b/slpkg/others/download.py index c29cad7d..9680bf9f 100644 --- a/slpkg/others/download.py +++ b/slpkg/others/download.py @@ -21,7 +21,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from downloader import Download +from slpkg.downloader import Download def packages_dwn(path, links): diff --git a/slpkg/others/greps.py b/slpkg/others/greps.py index 90f0de4f..299ffbeb 100644 --- a/slpkg/others/greps.py +++ b/slpkg/others/greps.py @@ -23,10 +23,10 @@ import os -from toolbar import status -from __metadata__ import lib_path -from splitting import split_package -from slack.slack_version import slack_ver +from slpkg.toolbar import status +from slpkg.__metadata__ import lib_path +from slpkg.splitting import split_package +from slpkg.slack.slack_version import slack_ver len_deps = 0 diff --git a/slpkg/others/install.py b/slpkg/others/install.py index c837dae9..9f25afdb 100644 --- a/slpkg/others/install.py +++ b/slpkg/others/install.py @@ -24,16 +24,16 @@ import os import sys -from sizes import units -from repositories import Repo -from init import Initialization -from blacklist import BlackList -from splitting import split_package -from messages import ( +from slpkg.sizes import units +from slpkg.repositories import Repo +from slpkg.init import Initialization +from slpkg.blacklist import BlackList +from slpkg.splitting import split_package +from slpkg.messages import ( pkg_not_found, template ) -from colors import ( +from slpkg.colors import ( RED, GREEN, CYAN, @@ -41,7 +41,7 @@ from colors import ( GREY, ENDC ) -from __metadata__ import ( +from slpkg.__metadata__ import ( pkg_path, lib_path, log_path, @@ -49,11 +49,11 @@ from __metadata__ import ( default_answer ) -from pkg.find import find_package -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.manager import PackageManager -from slack.remove import delete -from slack.slack_version import slack_ver +from slpkg.slack.remove import delete +from slpkg.slack.slack_version import slack_ver from greps import repo_data from download import packages_dwn diff --git a/slpkg/others/search.py b/slpkg/others/search.py index 4ca6e940..758ddd8f 100644 --- a/slpkg/others/search.py +++ b/slpkg/others/search.py @@ -23,9 +23,9 @@ import sys -from blacklist import BlackList -from __metadata__ import lib_path -from splitting import split_package +from slpkg.blacklist import BlackList +from slpkg.__metadata__ import lib_path +from slpkg.splitting import split_package def search_pkg(name, repo): diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index 164a2e19..f52fbe20 100644 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -29,23 +29,24 @@ import shutil import tarfile import subprocess -from checksum import md5sum -from colors import ( +from slpkg.checksum import md5sum +from slpkg.colors import ( RED, GREEN, ENDC ) -from messages import ( +from slpkg.messages import ( pkg_not_found, template ) -from __metadata__ import ( +from slpkg.__metadata__ import ( log_path, sbo_build_log, - sbo_check_md5 + sbo_check_md5, + default_answer ) -from sbo.greps import SBoGrep +from slpkg.sbo.greps import SBoGrep class BuildPackage(object): @@ -124,8 +125,11 @@ def check_md5(sbo_md5, src): print("| Expected: {0}".format(md5)) print("| Found: {0}".format(sbo_md5)) template(78) - read = raw_input("\nDo you want to continue [Y/n]? ") - if read == "Y" or read == "y": + if default_answer == "y": + answer = default_answer + else: + answer = raw_input("Would you like to continue [Y/n]? ") + if answer in ['y', 'Y']: pass else: sys.exit() diff --git a/slpkg/pkg/find.py b/slpkg/pkg/find.py index f734fd7a..9e2877a9 100644 --- a/slpkg/pkg/find.py +++ b/slpkg/pkg/find.py @@ -23,8 +23,8 @@ import os -from blacklist import BlackList -from splitting import split_package +from slpkg.blacklist import BlackList +from slpkg.splitting import split_package def find_package(find_pkg, directory): diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index 4eb1e270..5a3daefb 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -25,18 +25,18 @@ import os import sys import subprocess -from messages import ( +from slpkg.messages import ( pkg_not_found, template ) -from colors import ( +from slpkg.colors import ( RED, GREEN, CYAN, GREY, ENDC ) -from __metadata__ import ( +from slpkg.__metadata__ import ( pkg_path, sp, log_path, @@ -44,7 +44,7 @@ from __metadata__ import ( remove_deps_answer ) -from find import find_package +from slpkg.pkg.find import find_package class PackageManager(object): diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index 590150dd..80b435e4 100644 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -24,26 +24,26 @@ import os import sys -from pkg.find import find_package -from pkg.build import BuildPackage -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.build import BuildPackage +from slpkg.pkg.manager import PackageManager -from toolbar import status -from init import Initialization -from downloader import Download -from splitting import split_package -from messages import ( +from slpkg.toolbar import status +from slpkg.init import Initialization +from slpkg.downloader import Download +from slpkg.splitting import split_package +from slpkg.messages import ( template, build_FAILED ) -from colors import ( +from slpkg.colors import ( RED, GREEN, GREY, YELLOW, ENDC ) -from __metadata__ import ( +from slpkg.__metadata__ import ( tmp, pkg_path, build_path, diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index 5da4ca2d..78d79286 100644 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -23,8 +23,8 @@ import sys -from toolbar import status -from blacklist import BlackList +from slpkg.toolbar import status +from slpkg.blacklist import BlackList from greps import SBoGrep diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/greps.py index 71b9d27e..1b68c5c5 100644 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/greps.py @@ -21,7 +21,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from __metadata__ import ( +from slpkg.__metadata__ import ( arch, lib_path ) diff --git a/slpkg/sbo/read.py b/slpkg/sbo/read.py index 45ea1079..7d9f11e2 100644 --- a/slpkg/sbo/read.py +++ b/slpkg/sbo/read.py @@ -21,7 +21,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from url_read import URL +from slpkg.url_read import URL class Read(object): diff --git a/slpkg/sbo/remove.py b/slpkg/sbo/remove.py index c46d404e..f7c78e8d 100644 --- a/slpkg/sbo/remove.py +++ b/slpkg/sbo/remove.py @@ -23,7 +23,7 @@ import shutil -from __metadata__ import del_build +from slpkg.__metadata__ import del_build def delete(build_folder): diff --git a/slpkg/sbo/search.py b/slpkg/sbo/search.py index 67377d3d..4e5b196c 100644 --- a/slpkg/sbo/search.py +++ b/slpkg/sbo/search.py @@ -23,11 +23,11 @@ import sys -from repositories import Repo -from blacklist import BlackList -from __metadata__ import lib_path +from slpkg.repositories import Repo +from slpkg.blacklist import BlackList +from slpkg.__metadata__ import lib_path -from slack.slack_version import slack_ver +from slpkg.slack.slack_version import slack_ver def sbo_search_pkg(name): diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index ae7e619c..bdf2e046 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -24,11 +24,11 @@ import os import sys -from toolbar import status -from init import Initialization -from downloader import Download -from splitting import split_package -from __metadata__ import ( +from slpkg.toolbar import status +from slpkg.init import Initialization +from slpkg.downloader import Download +from slpkg.splitting import split_package +from slpkg.__metadata__ import ( tmp, pkg_path, build_path, @@ -37,7 +37,7 @@ from __metadata__ import ( default_answer, sp ) -from colors import ( +from slpkg.colors import ( RED, GREEN, GREY, @@ -45,16 +45,16 @@ from colors import ( CYAN, ENDC ) -from messages import ( +from slpkg.messages import ( pkg_found, template, build_FAILED, pkg_not_found ) -from pkg.find import find_package -from pkg.build import BuildPackage -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.build import BuildPackage +from slpkg.pkg.manager import PackageManager from greps import SBoGrep from remove import delete diff --git a/slpkg/sbo/views.py b/slpkg/sbo/views.py index ac74edac..ea6c7462 100644 --- a/slpkg/sbo/views.py +++ b/slpkg/sbo/views.py @@ -25,15 +25,15 @@ import os import sys import pydoc -from init import Initialization -from downloader import Download -from __metadata__ import ( +from slpkg.init import Initialization +from slpkg.downloader import Download +from slpkg.__metadata__ import ( tmp, build_path, pkg_path, sp ) -from colors import ( +from slpkg.colors import ( RED, GREEN, GREY, @@ -41,16 +41,16 @@ from colors import ( YELLOW, ENDC ) -from messages import ( +from slpkg.messages import ( pkg_found, pkg_not_found, template, build_FAILED ) -from pkg.find import find_package -from pkg.build import BuildPackage -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.build import BuildPackage +from slpkg.pkg.manager import PackageManager from read import Read from remove import delete diff --git a/slpkg/slack/download.py b/slpkg/slack/download.py index 8c06529c..4d1b42fe 100644 --- a/slpkg/slack/download.py +++ b/slpkg/slack/download.py @@ -21,7 +21,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from downloader import Download +from slpkg.downloader import Download def slack_dwn(path, links): diff --git a/slpkg/slack/greps.py b/slpkg/slack/greps.py index 0f15aa50..e953e65a 100644 --- a/slpkg/slack/greps.py +++ b/slpkg/slack/greps.py @@ -21,7 +21,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from toolbar import status +from slpkg.toolbar import status def slack_data(PACKAGES_TXT, step): diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index 9aba915c..51eed8f3 100644 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -24,15 +24,15 @@ import os import sys -from sizes import units -from blacklist import BlackList -from init import Initialization -from splitting import split_package -from messages import ( +from slpkg.sizes import units +from slpkg.blacklist import BlackList +from slpkg.init import Initialization +from slpkg.splitting import split_package +from slpkg.messages import ( pkg_not_found, template ) -from colors import ( +from slpkg.colors import ( RED, GREEN, CYAN, @@ -40,15 +40,15 @@ from colors import ( GREY, ENDC ) -from __metadata__ import ( +from slpkg.__metadata__ import ( pkg_path, lib_path, slpkg_tmp_packages, default_answer ) -from pkg.find import find_package -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.manager import PackageManager from remove import delete from mirrors import mirrors diff --git a/slpkg/slack/mirrors.py b/slpkg/slack/mirrors.py index 838c23d8..b278e0a7 100644 --- a/slpkg/slack/mirrors.py +++ b/slpkg/slack/mirrors.py @@ -21,8 +21,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from __metadata__ import arch -from repositories import Repo +from slpkg.__metadata__ import arch +from slpkg.repositories import Repo from slack_version import slack_ver diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 64beddb7..9742f94f 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -25,23 +25,24 @@ import os import sys import subprocess -from sizes import units -from url_read import URL -from messages import template -from blacklist import BlackList -from splitting import split_package -from colors import ( +from slpkg.sizes import units +from slpkg.url_read import URL +from slpkg.messages import template +from slpkg.blacklist import BlackList +from slpkg.splitting import split_package +from slpkg.colors import ( GREY, YELLOW, ENDC ) -from __metadata__ import ( +from slpkg.__metadata__ import ( pkg_path, slpkg_tmp_patches, default_answer ) -from pkg.manager import PackageManager +from slpkg.pkg.find import find_package +from slpkg.pkg.manager import PackageManager from remove import delete from mirrors import mirrors @@ -121,37 +122,15 @@ class Patches(object): (dwn, upgrade, comp_sum, uncomp_sum) = ([] for i in range(4)) data = slack_data(self.PACKAGES_TXT, self.step) black = BlackList().packages() - if self.version == "stable": # stables versions upgrade - for name, loc, comp, uncomp in zip(data[0], data[1], data[2], - data[3]): - if (not os.path.isfile(pkg_path + name[:-4]) and split_package( - name)[0] not in black): + for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]): + if find_package(split_package(name)[0] + "-", pkg_path): + if (not os.path.isfile(pkg_path + name[:-4]) and + split_package(name)[0] not in black): dwn.append("{0}{1}/{2}".format( mirrors("", "", self.version), loc, name)) comp_sum.append(comp) uncomp_sum.append(uncomp) upgrade.append(name) - else: # current version upgrade - installed = [] - # get all installed packages and store the package name. - for pkg in os.listdir(pkg_path): - installed.append(split_package(pkg)[0]) - for name, loc, comp, uncomp in zip(data[0], data[1], data[2], - data[3]): - # If the package from the current repository is installed - # (check with the name) but not is in the path (check with - # all package like 'apr-1.5.0-x86_64-1') then add to list for - # upgrade. - # etc. 'apr' in list 'installed' ?? if yes 'apr-1.5.0-x86_64-1' - # exist in /var/log/packages ?? if no add to upgrade. - if split_package(name)[0] in installed: - if (not os.path.isfile(pkg_path + name[:-4]) and - split_package(name)[0] not in black): - dwn.append("{0}{1}/{2}".format( - mirrors("", "", self.version), loc, name)) - comp_sum.append(comp) - uncomp_sum.append(uncomp) - upgrade.append(name) return [dwn, upgrade, comp_sum, uncomp_sum] diff --git a/slpkg/slack/remove.py b/slpkg/slack/remove.py index c8f764a5..cf172660 100644 --- a/slpkg/slack/remove.py +++ b/slpkg/slack/remove.py @@ -23,7 +23,7 @@ import os -from __metadata__ import del_all +from slpkg.__metadata__ import del_all def delete(path, packages):