Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2019-12-01 11:44:34 +01:00
commit 488ba465b2
77 changed files with 169 additions and 183 deletions

View file

@ -1,3 +1,7 @@
3.7.0 - 1/12/2019
Updated:
- Switch to python3
3.4.3 - 19/05/2019
Updated:
- Update gen_repos_files.sh to version 1.94

View file

@ -3,7 +3,7 @@
##### Python & OS Support
Slpkg works with Python versions 2.7.5+ .
Slpkg works with Python versions 3.7+ .
Slpkg works on Slackware distribution and possibly in some Slackware based
distribution like SalixOS, Slackel etc.
@ -22,4 +22,4 @@ There are mainly 3 ways:
2. Download binary package from '`https://sourceforge.net/projects/slpkg/files/binary/`'
and use Slackware command '`upgradepkg --install-new <slpkg binary>`'
3. Using pip: '`pip install https://gitlab.com/dslackw/slpkg/-/archive/3.4.3/slpkg-3.4.3.tar.gz`'
3. Using pip: '`pip install https://gitlab.com/dslackw/slpkg/-/archive/3.7.0/slpkg-3.7.0.tar.gz`'

View file

@ -1,9 +1 @@
Known issues:
- Dialog utility crash in option --buildlist when move with arrows
sometimes without yet that create big issues.
Issues reference here:
https://sourceforge.net/p/pythondialog/bugs/6/
Upgrade dialog utility from here if only necessary:
https://gitlab.com/dslackw/SlackBuilds/tree/master/dialog

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slpkg file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# clean.py file is part of slpkg.

View file

@ -68,7 +68,7 @@ Remove custom repository by name.
.SS repo-enable, enable or disable repositories
\fBslpkg\fP \fBrepo-enable\fP
.PP
Enable or disable repositories via dialog utility (require python2-pythondialog)
Enable or disable repositories via dialog utility (require python3-pythondialog)
.SS repo-list, repositories list
\fBslpkg\fP \fBrepo-list\fP
@ -268,7 +268,7 @@ build or install etc. Use "--checklist" additional option to load all repository
.PP
Additional options:
.PP
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python2-pythondialog)
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python3-pythondialog)
.PP
\fB--case-ins\fP : Search package name in repository with case insensitive.
@ -304,7 +304,7 @@ Additional options:
.PP
\fB--tag\fP : Remove packages with by TAG.
.PP
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python2-pythondialog)
\fB--checklist\fP : Enable dialog utility and checklist option. (Require python3-pythondialog)
.PP
\fB--third-party\fP : Remove all the third-party packages. (Be sure update the package lists before)

View file

@ -1,5 +1,5 @@
# Slackware Linux (based)
# Python 2.7+
# Python 3.7+
# GNU wget
# GNU coreutils
#
@ -9,4 +9,4 @@
# httpie (alternative downloader)
# pygraphviz >= 1.3.1 (drawing dependencies diagram)
# perl 5 language and graph-easy >= 0.75 (drawing dependencies ascii diagram)
# python2-pythondialog >= 3.3.0 (Python interface to the UNIX dialog utility)
# python3-pythondialog >= 3.3.0 (Python interface to the UNIX dialog utility)

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# setup.py file is part of slpkg.
@ -38,7 +38,7 @@ INSTALLATION_REQUIREMENTS = []
DOCS_REQUIREMENTS = []
TESTS_REQUIREMENTS = []
OPTIONAL_REQUIREMENTS = [
"python2-pythondialog >= 3.3.0",
"python3-pythondialog >= 3.3.0",
"pygraphviz >= 1.3.1"
]
@ -86,9 +86,7 @@ setup(
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Unix Shell",
"Topic :: Software Development :: Build Tools",
"Topic :: System :: Archiving :: Packaging",

View file

@ -5,7 +5,7 @@ to install packages. Slpkg makes it easier to maintain groups
of machines without having to manually update.
Optional dependencies:
python2-pythondialog (for dialog box interface)
python3-pythondialog (for dialog box interface)
pygraphviz (for drawing dependencies diagram)
graph-easy (for drawing ascii dependencies diagram)
aria2 (alternative downloader)

View file

@ -63,9 +63,6 @@ fi
set -e
PYTHON=python
# [ "${PYTHON3:-no}" = "yes" ] && PYTHON=python3
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@ -83,14 +80,7 @@ find -L . \
# skip pip installs
sed -i 's/if "install"/if ""/' setup.py
# Python 3 support temporarily is out until new Slackware version
# will be release
# if [ "$PYTHON3" = "yes" ]; then
# sh convert-py3k
# cd py3k/$PRGNAM
#fi
$PYTHON setup.py install --root=$PKG
python3 setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# __metadata__.py file is part of slpkg.
@ -78,7 +78,7 @@ class MetaData(object):
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (3, 4, 3)
__version_info__ = (3, 7, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# arguments.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# auto_pkg.py file is part of slpkg.
@ -60,15 +60,15 @@ class Auto(object):
self.meta.color["ENDC"]))
self.msg.template(78)
try:
self.choice = raw_input(" > ")
self.choice = input(" > ")
except EOFError:
print("")
raise SystemExit()
if self.choice in self.commands.keys():
sys.stdout.write(" \x1b[1A{0}{1}{2}\n\n".format(
print(" \x1b[1A{0}{1}{2}\n\n".format(
self.meta.color["CYAN"], self.commands[self.choice],
self.meta.color["ENDC"]))
sys.stdout.flush()
self.meta.color["ENDC"]), end="")
print(end="", flush=True)
self.execute()
def execute(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# check.py file is part of slpkg.
@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from distutils.version import LooseVersion
from pkg_resources import parse_version
from slpkg.messages import Msg
from slpkg.toolbar import status
@ -54,7 +54,7 @@ def pkg_upgrade(repo, skip, flag):
if name: # this tips because some pkg_name is empty
repo_pkg = split_package(name[:-4])
if (repo_pkg[0] == inst_pkg[0] and
LooseVersion(repo_pkg[1]) > LooseVersion(inst_pkg[1]) and
parse_version(repo_pkg[1]) > parse_version(inst_pkg[1]) and
repo_pkg[3] >= inst_pkg[3] and
inst_pkg[0] not in skip and
repo_pkg[1] != "blacklist"):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# dependency.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# greps.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# install.py file is part of slpkg.
@ -23,7 +23,7 @@
import os
from distutils.version import LooseVersion
from pkg_resources import parse_version
from slpkg.utils import Utils
from slpkg.sizes import units
@ -192,7 +192,7 @@ class BinaryInstall(object):
data_dict = Utils().case_sensitive(data)
for pkg in self.packages:
index = self.packages.index(pkg)
for key, value in data_dict.iteritems():
for key, value in data_dict.items():
if key == pkg.lower():
self.packages[index] = value
@ -247,7 +247,7 @@ class BinaryInstall(object):
ins_ver = GetFromInstalled(name).version()[1:]
if not ins_ver:
ins_ver = "0"
if LooseVersion(rep_ver) < LooseVersion(ins_ver):
if parse_version(rep_ver) < parse_version(ins_ver):
self.msg.template(78)
print("| Package {0} don't downgrade, "
"setting by user".format(name))
@ -308,7 +308,7 @@ class BinaryInstall(object):
" " * (18-len(pkg_repo[1])), pkg_repo[2],
" " * (8-len(pkg_repo[2])), pkg_repo[3],
" " * (7-len(pkg_repo[3])), repo,
comp, " K")).rstrip()
comp, " K").rstrip())
return [pkg_sum, upg_sum, uni_sum]
def top_view(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# repo_init.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# search.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# blacklist.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# checks.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# checksum.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# clean.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# config.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# desc.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# dialog_box.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# downloader.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*
# file_size.py file is part of slpkg.
@ -23,7 +23,8 @@
import os
import urllib2
import urllib
from urllib.request import urlopen
class FileSize(object):
@ -36,10 +37,10 @@ class FileSize(object):
"""Returns the size of remote files
"""
try:
tar = urllib2.urlopen(self.registry)
tar = urlopen(self.registry)
meta = tar.info()
return int(meta.getheaders("Content-Length")[0])
except (urllib2.URLError, IndexError):
return int(meta.get_all("Content-Length")[0])
except (urllib.error.URLError, IndexError):
return " "
def local(self):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# graph.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# grep_md5.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# health.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# init.py file is part of slpkg.
@ -23,7 +23,6 @@
import os
import sys
import shutil
from slpkg.repositories import Repo
@ -770,21 +769,21 @@ class Update(object):
for repo in enabled:
if check_for_local_repos(repo) is True:
continue
sys.stdout.write("{0}Check repository [{1}{2}{3}] ... "
print("{0}Check repository [{1}{2}{3}] ... "
"{4}".format(
self.meta.color["GREY"],
self.meta.color["CYAN"], repo,
self.meta.color["GREY"],
self.meta.color["ENDC"]))
sys.stdout.flush()
self.meta.color["ENDC"]), end="")
print(end="", flush=True)
if repo in default:
exec("{0}.{1}()".format(self._init, repo))
sys.stdout.write(self.done)
print(self.done, end="")
elif repo in enabled:
Initialization(False).custom(repo)
sys.stdout.write(self.done)
print(self.done, end="")
else:
sys.stdout.write(self.error)
print(self.error, end="")
print("") # new line at end
raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# load.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# log_deps.py file is part of slpkg.
@ -33,7 +33,7 @@ def write_deps(deps_dict):
"""Write dependencies in a log file
into directory `/var/log/slpkg/dep/`
"""
for name, dependencies in deps_dict.iteritems():
for name, dependencies in deps_dict.items():
if find_package(name + _meta_.sp, _meta_.pkg_path):
dep_path = _meta_.log_path + "dep/"
if not os.path.exists(dep_path):

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# main.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# md5sum.py file is part of slpkg.
@ -30,6 +30,6 @@ def md5(source):
"""
# fix passing char '+' from source
source = source.replace("%2B", "+")
with open(source) as file_to_check:
with open(source, "rb") as file_to_check:
data = file_to_check.read()
return hashlib.md5(data).hexdigest()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# messages.py file is part of slpkg.
@ -22,7 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import itertools
from slpkg.__metadata__ import MetaData as _meta_
@ -70,29 +69,29 @@ class Msg(object):
def checking(self):
"""Message checking
"""
sys.stdout.write("{0}Checking...{1} ".format(self.meta.color["GREY"],
self.meta.color["ENDC"]))
sys.stdout.flush()
print("{0}Checking...{1} ".format(self.meta.color["GREY"],
self.meta.color["ENDC"]), end="")
print(end="", flush=True)
def reading(self):
"""Message reading
"""
sys.stdout.write("{0}Reading package lists...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]))
sys.stdout.flush()
print("{0}Reading package lists...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
print(end="", flush=True)
def resolving(self):
"""Message resolving
"""
sys.stdout.write("{0}Resolving dependencies...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]))
sys.stdout.flush()
print("{0}Resolving dependencies...{1} ".format(
self.meta.color["GREY"], self.meta.color["ENDC"]), end="")
print(end="", flush=True)
def done(self):
"""Message done
"""
sys.stdout.write("\b{0}Done{1}\n".format(self.meta.color["GREY"],
self.meta.color["ENDC"]))
print("\b{0}Done{1}\n".format(self.meta.color["GREY"],
self.meta.color["ENDC"]), end="")
def pkg(self, count):
"""Print singular plural
@ -125,7 +124,7 @@ class Msg(object):
answer = self.meta.default_answer
else:
try:
answer = raw_input("Would you like to continue [y/N]? ")
answer = input("Would you like to continue [y/N]? ")
except EOFError:
print("")
raise SystemExit()
@ -154,7 +153,7 @@ class Msg(object):
len(install), self.pkg(len(install)),
len(upgrade), self.pkg(len(upgrade))))
self.template(78)
for installed, upgraded in itertools.izip_longest(install, upgrade):
for installed, upgraded in itertools.zip_longest(install, upgrade):
if upgraded:
print("| Package {0} upgraded successfully".format(upgraded))
if installed:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# new_config.py file is part of slpkg.
@ -88,7 +88,7 @@ class NewConfig(object):
print("| {0}Q{1}{2}uit from menu".format(self.red, self.endc, self.br))
self.msg.template(78)
try:
choose = raw_input("\nWhat would you like to do [K/O/R/P/Q]? ")
choose = input("\nWhat would you like to do [K/O/R/P/Q]? ")
except EOFError:
print("")
raise SystemExit()
@ -141,7 +141,7 @@ class NewConfig(object):
"""Choose what do to file by file
"""
print("")
prompt_ask = raw_input("{0} [K/O/R/D/M/Q]? ".format(n))
prompt_ask = input("{0} [K/O/R/D/M/Q]? ".format(n))
print("")
if prompt_ask in ("K", "k"):
self.keep()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# build.py file is part of slpkg.
@ -75,7 +75,7 @@ class BuildPackage(object):
try:
tar = tarfile.open(self.script)
except Exception as err:
print err
print(err)
raise SystemExit()
tar.extractall()
tar.close()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# find.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*
# installed.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# manager.py file is part of slpkg.
@ -108,7 +108,7 @@ class PackageManager(object):
if self.meta.default_answer in ["y", "Y"]:
remove_pkg = self.meta.default_answer
else:
remove_pkg = raw_input(
remove_pkg = input(
"\nAre you sure to remove {0} {1} [y/N]? ".format(
str(len(self.removed)), msg))
except EOFError:
@ -144,7 +144,7 @@ class PackageManager(object):
remove_dep = self.meta.remove_deps_answer
else:
try:
remove_dep = raw_input(
remove_dep = input(
"\nRemove dependencies (maybe used by "
"other packages) [y/N]? ")
print("")
@ -223,8 +223,8 @@ class PackageManager(object):
if "--third-party" in self.extra:
print("\n")
self.msg.template(78)
print("| {0}{1}*** WARNING ***{2}").format(
" " * 27, self.meta.color["RED"], self.meta.color["ENDC"])
print(("| {0}{1}*** WARNING ***{2}").format(
" " * 27, self.meta.color["RED"], self.meta.color["ENDC"]))
print("| Before you use third-party option, be sure you have"
" updated the packages \n| lists. Run the command"
" 'slpkg update' and 'slpkg -c slack --upgrade'")
@ -337,7 +337,7 @@ class PackageManager(object):
print("| Insert packages to exception remove:")
self.msg.template(78)
try:
self.skip = raw_input(" > ").split()
self.skip = input(" > ").split()
except EOFError:
print("")
raise SystemExit()
@ -519,7 +519,7 @@ class PackageManager(object):
self.meta.color["GREY"], index,
self.meta.color["ENDC"], pkg))
if index == page:
read = raw_input("\nPress {0}Enter{1} to "
read = input("\nPress {0}Enter{1} to "
"continue... ".format(
self.meta.color["CYAN"],
self.meta.color["ENDC"]))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pkg_find.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# remove.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# repoenable.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# repoinfo.py file is part of slpkg.
@ -99,8 +99,8 @@ class RepoInfo(object):
self.form["Status:"] = status
self.form["Last updated:"] = last_upd
print("")
for key, value in sorted(self.form.iteritems()):
print self.meta.color["GREY"] + key + self.meta.color["ENDC"], value
for key, value in sorted(self.form.items()):
print(self.meta.color["GREY"] + key + self.meta.color["ENDC"], value)
print("")
raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# repolist.py file is part of slpkg.
@ -49,7 +49,7 @@ class RepoList(object):
"Default", " " * 3,
"Status"))
self.msg.template(78)
for repo_id, repo_URL in sorted(self.all_repos.iteritems()):
for repo_id, repo_URL in sorted(self.all_repos.items()):
status, COLOR = "disabled", self.meta.color["RED"]
default = "yes"
if len(repo_URL) > 49:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# repositories.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# autobuild.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# build_num.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# check.py file is part of slpkg.
@ -23,7 +23,7 @@
import os
from distutils.version import LooseVersion
from pkg_resources import parse_version
from slpkg.messages import Msg
from slpkg.toolbar import status
@ -49,7 +49,7 @@ def sbo_upgrade(skip, flag):
if (name in data and name not in skip and name not in blacklist):
sbo_package = ("{0}-{1}".format(name, SBoGrep(name).version()))
package = ("{0}-{1}".format(name, ver))
if LooseVersion(sbo_package) > LooseVersion(package):
if parse_version(sbo_package) > parse_version(package):
upgrade_names.append(name)
Msg().done()
if "--checklist" in flag:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# download.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# dependency.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# greps.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# network.py file is part of slpkg.
@ -137,7 +137,7 @@ class SBoNetwork(object):
"""
if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.data)
for key, value in data_dict.iteritems():
for key, value in data_dict.items():
if key == self.name.lower():
self.name = value
@ -171,16 +171,16 @@ class SBoNetwork(object):
}
try:
message = " Choose an option > "
self.choice = raw_input("{0}{1}{2}".format(self.grey, message,
self.choice = input("{0}{1}{2}".format(self.grey, message,
self.endc))
except EOFError:
print("")
raise SystemExit()
try:
sys.stdout.write("{0}\x1b[1A{1}{2}{3}\n".format(
print("{0}\x1b[1A{1}{2}{3}\n".format(
" " * len(message), self.cyan, commands[self.choice],
self.endc))
sys.stdout.flush()
self.endc), end="")
print(end="", flush=True)
except KeyError:
pass

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# queue.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# read.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# sbo_arch.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# search.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slack_find.py file is part of slpkg.
@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from distutils.version import LooseVersion
from pkg_resources import parse_version
from slpkg.messages import Msg
from slpkg.__metadata__ import MetaData as _meta_
@ -38,7 +38,8 @@ def slack_package(prgnam):
if pkg.startswith(prgnam) and pkg[:-4].endswith("_SBo"):
binaries.append(pkg)
for bins in binaries:
if LooseVersion(bins) > LooseVersion(cache):
binary = bins
if parse_version(bins) > parse_version(cache):
binary = bins
cache = binary
if not binary:

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slackbuild.py file is part of slpkg.
@ -23,7 +23,7 @@
import os
from distutils.version import LooseVersion
from pkg_resources import parse_version
from slpkg.utils import Utils
@ -171,7 +171,7 @@ class SBoInstall(object):
data_dict = Utils().case_sensitive(self.data)
for name in self.slackbuilds:
index = self.slackbuilds.index(name)
for key, value in data_dict.iteritems():
for key, value in data_dict.items():
if key == name.lower():
self.slackbuilds[index] = value
@ -272,7 +272,7 @@ class SBoInstall(object):
" " * (23-len(args[1] + ver)), args[2],
" " * (18-len(args[2])), args[3],
" " * (15-len(args[3])), "",
"", "SBo", "", "")).rstrip()
"", "SBo", "", "").rstrip())
def tag(self, sbo):
"""Tag with color green if package already installed,
@ -382,7 +382,7 @@ class SBoInstall(object):
ins_ver = GetFromInstalled(name).version()[1:]
if not ins_ver:
ins_ver = "0"
if LooseVersion(sbo_ver) < LooseVersion(ins_ver):
if parse_version(sbo_ver) < parse_version(ins_ver):
self.msg.template(78)
print("| Package {0} don't downgrade, "
"setting by user".format(name))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# security.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# sizes.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# mirrors.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# patches.py file is part of slpkg.
@ -105,7 +105,7 @@ class Patches(object):
print("{0}Total {1} {2} will be upgraded and {3} will be "
"installed.".format(self.meta.color["GREY"],
self.count_upg,
self.msg.pkg(self.upgrade_all),
self.msg.pkg(len(self.upgrade_all)),
self.count_added))
print("Need to get {0} {1} of archives.".format(size[0],
unit[0]))
@ -201,7 +201,7 @@ class Patches(object):
" " * (18-len(pkg_repo[1])), pkg_repo[2],
" " * (8-len(pkg_repo[2])), pkg_repo[3],
" " * (7-len(pkg_repo[3])), "Slack",
size, " K")).rstrip()
size, " K").rstrip())
def upgrade(self):
"""
@ -246,7 +246,7 @@ class Patches(object):
print("| L=lilo / E=elilo / G=grub")
self.msg.template(78)
try:
answer = raw_input("\nThe kernel has been upgraded, "
answer = input("\nThe kernel has been upgraded, "
"reinstall boot loader [L/E/G]? ")
except EOFError:
print("")

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slack_version.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slackware_repo.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# slpkg_update.py file is part of slpkg.
@ -59,7 +59,7 @@ def it_self_update():
print("\nNew version '{0}-{1}' is available !\n".format(
_meta_.__all__, __new_version__))
try:
answer = raw_input("Would you like to upgrade [y/N]? ")
answer = input("Would you like to upgrade [y/N]? ")
except EOFError:
print("")
raise SystemExit()

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# splitting.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# status_deps.py file is part of slpkg.
@ -89,7 +89,7 @@ class DependenciesStatus(object):
self.msg.template(78)
print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
self.msg.template(78)
for key, value in self.dmap.iteritems():
for key, value in self.dmap.items():
print(" {0}{1}{2}{3}{4}".format(
self.green, key, self.endc, " " * (32-len(key)),
", ".join(value)))
@ -105,14 +105,14 @@ class DependenciesStatus(object):
"| -- Packages")
self.msg.template(78)
self.data()
for pkg, dep in self.dmap.iteritems():
for pkg, dep in self.dmap.items():
print("+ {0}{1}{2}".format(self.green, pkg, self.endc))
print("|")
for d in dep:
print("+-- {0}".format(d))
print("|")
sys.stdout.write("\x1b[1A{0}\n".format(" "))
sys.stdout.flush()
print("\x1b[1A{0}\n".format(" "), end="")
print(end="", flush=True)
self.summary()
if self.image:
Graph(self.image).dependencies(self.dmap)

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# superuser.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# toolbar.py file is part of slpkg.
@ -34,7 +34,7 @@ def status(sec):
if _meta_.prg_bar in ["on", "ON"]:
syms = ["|", "/", "-", "\\"]
for sym in syms:
sys.stdout.write("\b{0}{1}{2}".format(_meta_.color["GREY"], sym,
_meta_.color["ENDC"]))
sys.stdout.flush()
print("\b{0}{1}{2}".format(_meta_.color["GREY"], sym,
_meta_.color["ENDC"]), end="")
print(end="", flush=True)
time.sleep(float(sec))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# tracking.py file is part of slpkg.
@ -148,7 +148,7 @@ class TrackingDeps(object):
if "--case-ins" in self.flag:
data = SBoGrep(name="").names()
data_dict = Utils().case_sensitive(data)
for key, value in data_dict.iteritems():
for key, value in data_dict.items():
if key == self.name.lower():
self.name = value
@ -158,7 +158,7 @@ class TrackingDeps(object):
"""
if "--case-ins" in self.flag:
data_dict = Utils().case_sensitive(self.names)
for key, value in data_dict.iteritems():
for key, value in data_dict.items():
if key == self.name.lower():
self.name = value

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# upgrade_checklist.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# url_read.py file is part of slpkg.
@ -22,8 +22,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import urllib2
# import os
import urllib
from urllib.request import urlopen
from slpkg.__metadata__ import MetaData as _meta_
@ -39,6 +40,7 @@ class URL(object):
"""Open url and read
"""
try:
'''
# testing proxy
proxies = {}
try:
@ -54,11 +56,11 @@ class URL(object):
proxy = urllib2.ProxyHandler(proxies)
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
# end testing
f = urllib2.urlopen(self.link)
return f.read()
except (urllib2.URLError, ValueError):
'''
f = urlopen(self.link)
return f.read().decode("utf-8")
except (urllib.error.URLError, ValueError):
print("\n{0}Can't read the file '{1}'{2}".format(
self.meta.color["RED"], self.link.split("/")[-1],
self.meta.color["ENDC"]))

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# utils.py file is part of slpkg.

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# version.py file is part of slpkg.