updated for version 2.0.7

This commit is contained in:
Dimitris Zlatanidis 2014-11-22 11:16:39 +02:00
parent 2f31b2eb6d
commit 2a21ee54c1
36 changed files with 199 additions and 300 deletions

View file

@ -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.

24
INSTALL
View file

@ -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 <slpkg binary>`
Proposed mode if you want to have installed the most updated version is 1 or 2 and 3
process.

View file

@ -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

View file

@ -11,9 +11,9 @@
Latest Release:
- Version: 2.0.5
- Version: 2.0.7
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.5.tar.gz>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.7.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/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 <http://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 <http://www.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 <http://www.slackware.com/~alien/slackbuilds/>`_
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 <http://repository.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 <http://rlworkman.net/pkgs/>`_
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 <https://pip.pypa.io/en/latest/>`_ :
.. code-block:: bash
$ pip install --upgrade slpkg
uninstall:
$ pip uninstall slpkg
Using Slackware command:
From SourceForge:
Download binary package from `SourceForge <https://sourceforge.net/projects/slpkg/>`_
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
-----------------------

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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=""

View file

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __metadata__.py
# __metadata__.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# 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()

View file

@ -21,7 +21,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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 <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",
"\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()

View file

@ -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():

View file

@ -23,7 +23,7 @@
import sys
from toolbar import status
from slpkg.toolbar import status
from greps import Requires

View file

@ -21,7 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from downloader import Download
from slpkg.downloader import Download
def packages_dwn(path, links):

View file

@ -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

View file

@ -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

View file

@ -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):

View file

@ -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()

View file

@ -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):

View file

@ -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):

View file

@ -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,

View file

@ -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

View file

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

View file

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

View file

@ -23,7 +23,7 @@
import shutil
from __metadata__ import del_build
from slpkg.__metadata__ import del_build
def delete(build_folder):

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -21,7 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from downloader import Download
from slpkg.downloader import Download
def slack_dwn(path, links):

View file

@ -21,7 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from toolbar import status
from slpkg.toolbar import status
def slack_data(PACKAGES_TXT, step):

View file

@ -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

View file

@ -21,8 +21,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __metadata__ import arch
from repositories import Repo
from slpkg.__metadata__ import arch
from slpkg.repositories import Repo
from slack_version import slack_ver

View file

@ -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]

View file

@ -23,7 +23,7 @@
import os
from __metadata__ import del_all
from slpkg.__metadata__ import del_all
def delete(path, packages):