Skip to content
Commits on Source (73)
image: "python:3.7"
before_script:
- python --version
- pip install -r requirements.txt
stages:
- Static Analysis
- Test
flake8:
stage: Static Analysis
script:
- flake8 --max-line-length=120 bild/*.py
unit_test:
stage: Test
script:
- export PYTHONPATH="$PYTHONPATH:."
- python -c "import sys;print(sys.path)"
- pytest
\ No newline at end of file
language: python
python:
- "2.7"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: nosetests
......@@ -125,3 +125,4 @@ deb10f0e2597ef8b201c039af2bd9c36 ./slpkg-3.7.0.tar.gz
04a0e87c5ed0a70b4aa9682b9d2a8cc9 ./slpkg-3.7.1.tar.gz
6740e8213bbaa8f8d674144f61954366 ./slpkg-3.7.2.tar.gz
dd97a05ee9ba37e0262f7e1c60d0eb61 ./slpkg-3.7.3.tar.gz
31d0c6aa7558bdc77d4eed4d4d5eb3f8 ./slpkg-3.7.4.tar.gz
3.8.0 - 05/02/2020
Added:
- Many changes happen in this version, a big part of code has been rewritten
- to improve the code for support Python 3. Possibly will there are some bugs
- in the feture versions I would appreciate it if report them.
- Cheers,
- Dimitris
Fixed:
- Bugfix: merge files with slack repository between current and slack versions
Updated:
- code to improve for Python 3
3.7.4 - 20/12/2019
Fixed:
-Bugfix: UnicodeDecodeError: 'utf-8' codec can't decode byte
- Bugfix: UnicodeDecodeError: 'utf-8' codec can't decode byte
3.7.3 - 11/12/2019
FIxed:
......
......@@ -3,11 +3,16 @@
##### Usage
First you need to run '`slpkg update`' to synchronize the lists of packages, also every time you add
a new repository. To add or remove repositories must edit the file '`/etc/slpkg/repositories.conf`'
or run '`slpkg repo-enable`' (python2-pythondialog required). Add custom repositories with the
command '`slpkg add-repo <repository name> <URL>`' and after run '`slpkg update`' to update package
list. View list of repositories with the command `slpkg repo-list` or get repository information
Before you start to use slpkg need to run '`slpkg update`' to synchronize the lists of packages,
also every time you add a new repository.
To add or remove repositories you have to edit the file '`/etc/slpkg/repositories.conf`'
or run '`slpkg repo-enable`' (python3-pythondialog required).
Add custom repositories with the command '`slpkg add-repo <repository name> <URL>`' and
after run '`slpkg update`' to update package list.
View list of repositories with the command `slpkg repo-list` or get repository information
with the command '`slpkg repo-info <repository>`'.
Update slpkg itself simply run '`slpkg update slpkg`', and slpkg check from GitLab repository if the
......@@ -16,7 +21,7 @@ new version is available.
Checking packages health with the command '`slpkg health`' and slpkg check if the files missing
from the package file list.
Print the dependencies status with the command '`slpkg deps-status`' or draw image map dependencies
View the dependencies status with the command '`slpkg deps-status`' or draw image map dependencies
with the additional option '`--graph=[image]`'.
Manage '`.new`' configuration files with the command '`slpkg new-config`', like remove, overwrite,
......@@ -43,7 +48,7 @@ Use '`--checklist`' option to help you to choose easy the packages. For advanced
option '`--skip`' give them more power (see manpage).
The most famous command is '`slpkg -s <repository> <packages>`', this command downloads, build and
installs packages with the resolve all the dependencies or switch off resolve with the option
installs packages and resolve all the dependencies or switch off resolve with the option
'`--resolve-off`'. Also the additional option '`--case-ins`' help you find the packages with case
insensitive. Two new arguments, help you to rebuild '`--rebuild`' or reinstall '`--reinstall`' packages.
The last one argument '`--patches`' help you to switch in the '`patches/`' directory, only for the slack
......@@ -54,27 +59,27 @@ package dependency tree and also shows to you which ones are installed on your s
Check if the packages used from other packages with the option '`--check-deps`' or draw image map
dependencies with the additional option '`--graph=[image]`'.
Get information description of a package with the command '`slpkg -p <repository> <package>`' and
Get information description of a package with the command '`slpkg -p <repository> <package>`' and
change the color of the text with the additional flag '`--color=[]`'.
View a SBo package page on your terminal with command `slpkg -n <package>` and then manage
multiple choices such read, download, build, install etc.
If you want to find a package of all the repositories, that command will solve your hands
If you want to find a package of all the repositories, this command will solve your hands
'`slpkg -F <packages>`', it will search in all the enable repositories and will print all the
packages that match the description that you enter.
If you want to see if any packages are installed on your system enter the command
If you want to see if any packages are installed on your system enter the command
'`slpkg -f <packages>`'. The option '`--third-party`' help you to view only the third-party
packages
The next three commands '`slpkg --installpkg, --upgradepkg, --removepkg <packages>`' install, upgrade,
remove packages from your system events. Notable mention you must give in the command
remove packages from your system events. Notable mention you must give in the command
'`slpkg --removepkg <packages>`' which you can remove the packages with all dependencies together
after editing configuration file '`/etc/slpkg/slpkg.conf`' (default is disable) or add additional
option '`--deps`'. Also you can check if the packages they are used as dependency with additional
option '`--check-deps`'. Option '`--tag`' allow to remove packages with by TAG. Optional you can use
the dialog utility with the additional option '`--checklist`' (require python2-pythondialog). Rmove
option '`--check-deps`'. Option '`--tag`' allow to remove packages by TAG. Optional you can use
the dialog utility with the additional option '`--checklist`' (require python3-pythondialog). Rmove
third-party packages with the option '`--third-party`'.
The command '`slpkg -d <packages>`' is useful to print the entire contents of a package.
......@@ -85,7 +90,7 @@ Some examples you will see below.
##### Slpkg Examples
Enable or disable default repositories, edit '`/etc/slpkg/repositories.conf`' file or with the command.
(require pythondialog, install with '`slpkg -s sbo python2-pythondialog`'):
(require pythondialog, install with '`slpkg -s sbo python3-pythondialog`'):
```
$ slpkg repo-enable
......
......@@ -22,5 +22,5 @@ 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: '`pip3 install https://gitlab.com/dslackw/slpkg/-/archive/3.7.0/slpkg-3.7.0.tar.gz`'
3. Using pip: '`pip3 install https://gitlab.com/dslackw/slpkg/-/archive/3.8.0/slpkg-3.8.0.tar.gz`'
or instead '`'python3 -m pip install`''.
# slpkg 3.7.4
# slpkg 3.8.0
Slpkg is a powerful software package manager that installs, updates, and removes packages on
[Slackware](http://www.slackware.com/) based systems. It automatically computes dependencies and
......@@ -13,6 +13,8 @@ What makes slpkg to distinguish it from the other tools; The user friendliness i
target as well as easy to understand and use, also use colors to highlight packages and
display warning messages, etc.
[EXAMPLES.md](https://gitlab.com/dslackw/slpkg/blob/master/EXAMPLES.md) Explore some examples.
#### Asciicast:
......
......@@ -3,7 +3,7 @@
# slpkg file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......
......@@ -3,7 +3,7 @@
# clean.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......@@ -49,11 +49,11 @@ class Clean:
def start(self):
for f in self.files:
if os.path.isfile(f):
print("Remove file --> {0}".format(f))
print(f"Remove file --> {f}")
os.remove(f)
for d in self.dirs:
if os.path.exists(d):
print("Remove directory --> {0}".format(d))
print(f"Remove directory --> {d}")
shutil.rmtree(d)
......
......@@ -2,7 +2,7 @@
# install.sh file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
......
......@@ -188,7 +188,7 @@ Additional options:
.PP
\fB--skip=[packages...]\fP : Skip packages from upgrade separate by comma like "# slpkg -c sbo --skip=jdk,pep8,pip" (See REGEX).
.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)
.SS -s, --sync, synchronize packages, download, build and install package with all dependencies
\fBslpkg\fP \fB-s\fP <\fIrepository\fP> <\fInames of packages\fP>, \fB--resolve-off\fP, \fB--case-ins\fP, \fB--patches\fP
......
This diff is collapsed.
[pytest]
python_files = test_*
python_classes = *Tests
python_functions = test_*
......@@ -12,3 +12,5 @@
# python3-pythondialog >= 3.5.0 (Python interface to the UNIX dialog utility)
urllib3 >= 1.25.7
flake8 >= 3.5.0
pytest >= 5.3.2
\ No newline at end of file
......@@ -3,7 +3,7 @@
# setup.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......@@ -35,7 +35,9 @@ except ImportError:
from distutils.core import setup
docs_requires = []
tests_requires = []
tests_requires = [
"pytest>=5.3.2"
]
install_requires = [
"urllib3>=1.25.7"
]
......
......@@ -2,7 +2,7 @@
# Slackware build script for slpkg
# Copyright 2014-2019 Dimitris Zlatanidis Orestiada, Greece
# Copyright 2014-2020 Dimitris Zlatanidis Orestiada, Greece
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
......
......@@ -3,7 +3,7 @@
# __metadata__.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......@@ -29,18 +29,16 @@ def remove_repositories(repositories, default_repositories):
"""
Remove no default repositories
"""
repos = []
for repo in repositories:
if repo in default_repositories:
repos.append(repo)
return repos
yield repo
def update_repositories(repositories, conf_path):
"""
Upadate with user custom repositories
"""
repo_file = "{0}custom-repositories".format(conf_path)
repo_file = f"{conf_path}custom-repositories"
if os.path.isfile(repo_file):
f = open(repo_file, "r")
repositories_list = f.read()
......@@ -78,7 +76,7 @@ class MetaData:
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (3, 7, 4)
__version_info__ = (3, 8, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
......@@ -90,11 +88,11 @@ class MetaData:
slack_rel = "stable"
# Configuration path
conf_path = "/etc/{0}/".format(__all__)
conf_path = f"/etc/{__all__}/"
# tmp paths
tmp = "/tmp/"
tmp_path = "{0}{1}/".format(tmp, __all__)
tmp_path = f"{tmp}{__all__}/"
# Default configuration values
_conf_slpkg = {
......@@ -138,8 +136,8 @@ class MetaData:
# read value from configuration file
repositories = []
for files in ["slpkg.conf", "repositories.conf"]:
if os.path.isfile("%s%s" % (conf_path, files)):
f = open("%s%s" % (conf_path, files), "r")
if os.path.isfile(f"{conf_path}{files}"):
f = open(f"{conf_path}{files}", "r")
conf = f.read()
f.close()
for line in conf.splitlines():
......@@ -194,7 +192,7 @@ class MetaData:
mles_sub_repo = grab_sub_repo(repositories, "mles")
# remove no default repositories
repositories = remove_repositories(repositories, default_repositories)
repositories = list(remove_repositories(repositories, default_repositories))
# add custom repositories
update_repositories(repositories, conf_path)
......@@ -217,8 +215,8 @@ class MetaData:
"ENDC": ""
}
CHECKSUMS_link = ("https://gitlab.com/{0}/{1}/raw/"
"master/CHECKSUMS.md5".format(__author__, __all__))
CHECKSUMS_link = (f"https://gitlab.com/{__author__}/{__all__}/raw/"
"master/CHECKSUMS.md5")
# file spacer
sp = "-"
......
......@@ -3,7 +3,7 @@
# arguments.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......@@ -30,8 +30,7 @@ from slpkg.slack.slack_version import slack_ver
def header():
"""help header message"""
print("\nslpkg - version {0} | Slackware release: {1} - {2}\n".format(
_meta_.__version__, _meta_.slack_rel, slack_ver()))
print(f"\nslpkg - version {_meta_.__version__} | Slackware release: {_meta_.slack_rel} - {slack_ver()}\n")
def options():
......@@ -220,11 +219,11 @@ def usage(repo):
all_repos = RepoList().all_repos.keys()
del RepoList().all_repos
if repo in all_repos:
error_repo = ("slpkg: Error: Repository '{0}' is not activated"
"\n".format(repo))
error_repo = (f"slpkg: Error: Repository '{repo}' is not activated"
"\n")
else:
error_repo = ("slpkg: Error: Repository '{0}' does not exist"
"\n".format(repo))
error_repo = (f"slpkg: Error: Repository '{repo}' does not exist"
"\n")
print("\n" + error_repo)
raise SystemExit(1)
print(usage.__doc__)
......
......@@ -3,7 +3,7 @@
# auto_pkg.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......@@ -22,8 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from slpkg.messages import Msg
from slpkg.__metadata__ import MetaData as _meta_
......@@ -35,7 +33,10 @@ class Auto:
"""
def __init__(self, packages):
self.packages = packages
self.meta = _meta_
self.green = _meta_.color["GREEN"]
self.red = _meta_.color["RED"]
self.cyan = _meta_.color["CYAN"]
self.endc = _meta_.color["ENDC"]
self.msg = Msg()
self.commands = {
"i": "installpkg",
......@@ -54,10 +55,7 @@ class Auto:
print("| Choose a Slackware command:")
self.msg.template(78)
for com in sorted(self.commands):
print("| {0}{1}{2}) {3}{4}{5}".format(
self.meta.color["RED"], com, self.meta.color["ENDC"],
self.meta.color["GREEN"], self.commands[com],
self.meta.color["ENDC"]))
print(f"| {self.red}{com}{self.endc}) {self.green}{self.commands[com]}{self.endc}")
self.msg.template(78)
try:
self.choice = input(" > ")
......@@ -65,9 +63,7 @@ class Auto:
print()
raise SystemExit()
if self.choice in self.commands.keys():
print(" \x1b[1A{0}{1}{2}\n\n".format(
self.meta.color["CYAN"], self.commands[self.choice],
self.meta.color["ENDC"]), end="")
print(f" \x1b[1A{self.cyan}{self.commands[self.choice]}{self.endc}", end="\n\n")
print(end="", flush=True)
self.execute()
......
......@@ -3,7 +3,7 @@
# check.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# Copyright 2014-2020 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
......