Skip to content
Commits on Source (32)
......@@ -126,3 +126,4 @@ deb10f0e2597ef8b201c039af2bd9c36 ./slpkg-3.7.0.tar.gz
6740e8213bbaa8f8d674144f61954366 ./slpkg-3.7.2.tar.gz
dd97a05ee9ba37e0262f7e1c60d0eb61 ./slpkg-3.7.3.tar.gz
31d0c6aa7558bdc77d4eed4d4d5eb3f8 ./slpkg-3.7.4.tar.gz
a8298533001b4537939339dc6970e140 ./slpkg-3.8.0.tar.gz
3.8.1 - 13/02/2020
Fixed:
- Bugfix double install packages from slack regular repo
and patches directory #122
Updated:
- Removed status progress bar
- Setup and installing
- Managed blacklist in the simple way
3.8.0 - 05/02/2020
Added:
- Many changes happen in this version, a big part of code has been rewritten
......
......@@ -1202,14 +1202,7 @@ Packages in blacklist:
live555
faac
Note: you can use asterisk "*" to match more packages like:
*lib* \\ Add all packages inlcude string "lib"
*lib \\ Add all packages ends with string "lib"
lib* \\ Add all packages starts with string "lib"
multi:*multilib* \\ Add all packages include string "multilib" from "multi"
\\ repository.
```
Print a package description:
......
......@@ -11,7 +11,7 @@ distribution like SalixOS, Slackel etc.
##### Install slpkg
There are mainly 3 ways:
There are mainly 2 ways:
1. Suggested method, download latest slpkg version from:
'`https://gitlab.com/dslackw/slpkg/releases`'
......@@ -20,7 +20,4 @@ There are mainly 3 ways:
slpkg auto-installed as Slackware package (root privileges are required).
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.8.0/slpkg-3.8.0.tar.gz`'
or instead '`'python3 -m pip install`''.
and use Slackware command '`upgradepkg --install-new <slpkg binary>`'
\ No newline at end of file
# slpkg 3.8.0
# slpkg 3.8.1
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
......
......@@ -2,26 +2,6 @@
#
# blacklist file is part of slpkg.
#
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
#
# Slpkg is a user-friendly package manager for Slackware installations.
#
# https://gitlab.com/dslackw/slpkg
#
# Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# END OF LEGAL NOTICE
#
# ----------------------------------------------------------------------------
# This is the blacklist file. Each package listed here may not be
# installed be upgraded be find or deleted.
......@@ -30,15 +10,6 @@
# To blacklist the package 'wicd-1.7.2.4-x86_64-4.txz' the line will be:
# wicd
#
# This one will blacklist all packages include string "lib" in package name:
# *lib*
#
# Add packages in blacklist by repository:
# slacky:* `add all packages from the slacky repository`
# sbo:py* `add all packages from the sbo starts with 'py'`
# sbo:jdk `add jdk package from the sbo repository`
# slack:*multi* `add packages include string 'multi' from the slack`
# msb:*.txz `add packages ends with '.txz' from the msb repository`
#
# Sometimes the automatic kernel update creates problems because you
# may need to file intervention 'lilo'. The slpkg automatically detects
......
......@@ -2,7 +2,7 @@
#
# slpkg.conf 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.
......@@ -115,15 +115,11 @@ SLACKPKG_LOG=on
# packages required for distribution.
ONLY_INSTALLED=off
# Enable or disable the progress bar. Status bar progress delays the search
# process in package lists. Default is "off".
PRG_BAR=off
# Register a text editor that uses the slpkg in a few options.
# Register a text editor that uses the slpkg in a few options.
# Default is "nano".
EDITOR=nano
# If you don't want slpkg downgrade packages, setting this variable to "on".
# Warning: Possible failure building packages or running applications after
# install. Default is "off".
NOT_DOWNGRADE=off
NOT_DOWNGRADE=off
\ No newline at end of file
......@@ -23,10 +23,7 @@
import os
import sys
import time
import shutil
from slpkg.md5sum import md5
from slpkg.__metadata__ import MetaData as _meta_
try:
......@@ -52,12 +49,11 @@ optional_requires = [
def print_logo():
"""print slpkg logo"""
if "install" not in sys.argv:
logo_fname = os.path.join(os.path.dirname(__file__), 'logo.txt')
with open(logo_fname, 'rb') as f:
logo = f.read().decode('utf-8')
print(logo)
time.sleep(1)
logo_fname = os.path.join(os.path.dirname(__file__), 'logo.txt')
with open(logo_fname, 'rb') as f:
logo = f.read().decode('utf-8')
print(logo)
time.sleep(0.5)
print_logo()
......@@ -103,30 +99,4 @@ setup(
"Topic :: System :: Software Distribution",
"Topic :: Utilities"],
python_requires=">=3.7"
)
# Install configuration files with pip.
if "install" in sys.argv:
conf_file = [
"conf/slpkg.conf",
"conf/repositories.conf",
"conf/blacklist",
"conf/slackware-mirrors",
"conf/default-repositories",
"conf/custom-repositories",
"conf/rlworkman.deps",
"conf/pkg_security"
]
if not os.path.exists(_meta_.conf_path):
os.makedirs(_meta_.conf_path)
for conf in conf_file:
filename = conf.split("/")[-1]
if os.path.isfile(_meta_.conf_path + filename):
old = md5(_meta_.conf_path + filename)
new = md5(conf)
if old != new:
shutil.copy2(conf, _meta_.conf_path + filename + ".new")
else:
shutil.copy2(conf, _meta_.conf_path)
shutil.copy2(conf_file[0],
_meta_.conf_path + conf_file[0].split("/")[-1] + ".orig")
)
\ No newline at end of file
......@@ -16,4 +16,4 @@ done
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
fi
\ No newline at end of file
......@@ -77,18 +77,15 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# skip pip installs
sed -i 's/if "install"/if ""/' setup.py
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
# install configuration files
mkdir -p $PKG/etc/slpkg
# install configurations files
CONFIGS="slpkg.conf repositories.conf blacklist slackware-mirrors default-repositories \
custom-repositories rlworkman.deps pkg_security"
CONFIGS="slpkg.conf repositories.conf blacklist slackware-mirrors \
default-repositories custom-repositories rlworkman.deps pkg_security"
for file in $CONFIGS; do
install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new
done
......@@ -111,4 +108,4 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
$INSTALL $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
$INSTALL $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
\ No newline at end of file
......@@ -76,7 +76,7 @@ class MetaData:
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (3, 8, 0)
__version_info__ = (3, 8, 1)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
......
......@@ -30,7 +30,7 @@ from slpkg.slack.slack_version import slack_ver
def header():
"""help header message"""
print(f"\nslpkg - version {_meta_.__version__} | Slackware release: {_meta_.slack_rel} - {slack_ver()}\n")
print(f"slpkg - version {_meta_.__version__} | Slackware release: {_meta_.slack_rel} - {slack_ver()}\n")
def options():
......
......@@ -25,7 +25,6 @@
from pkg_resources import parse_version
from slpkg.messages import Msg
from slpkg.toolbar import status
from slpkg.splitting import split_package
from slpkg.upgrade_checklist import choose_upg
from slpkg.__metadata__ import MetaData as _meta_
......@@ -48,7 +47,6 @@ def pkg_upgrade(repo, skip, flag):
# unsize = data[3]
data = repo_data(PACKAGES_TXT, repo, flag="")
for pkg in installed():
status(0.0005)
inst_pkg = split_package(pkg)
for name in data[0]:
if name: # this tips because some pkg_name is empty
......
......@@ -24,7 +24,6 @@
import sys
from slpkg.toolbar import status
from slpkg.__metadata__ import MetaData as _meta_
from slpkg.binary.greps import Requires
......@@ -48,13 +47,16 @@ class Dependencies:
requires = Requires(name, self.repo).get_deps()
if requires:
for req in requires:
status(0)
if req and req not in self.black:
dependencies.append(req)
if dependencies:
self.dep_results.append(dependencies)
for dep in dependencies:
self.binary(dep, flag)
self.deep_check(dependencies, flag)
return self.dep_results
else:
return []
def deep_check(self, dependencies, flag):
"""Checking if dependencies are finnished
"""
if dependencies:
self.dep_results.append(dependencies)
[self.binary(dep, flag) for dep in dependencies]
......@@ -23,7 +23,6 @@
from slpkg.utils import Utils
from slpkg.toolbar import status
from slpkg.splitting import split_package
from slpkg.__metadata__ import MetaData as _meta_
......@@ -36,8 +35,6 @@ def repo_data(PACKAGES_TXT, repo, flag):
(name, location, size, unsize,
rname, rlocation, rsize, runsize) = ([] for i in range(8))
for line in PACKAGES_TXT.splitlines():
if _meta_.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag:
status(0.000005)
if line.startswith("PACKAGE NAME:"):
name.append(line[15:].strip())
if line.startswith("PACKAGE LOCATION:"):
......@@ -46,7 +43,14 @@ def repo_data(PACKAGES_TXT, repo, flag):
size.append(line[28:-2].strip())
if line.startswith("PACKAGE SIZE (uncompressed):"):
unsize.append(line[30:-2].strip())
if repo == "rlw":
if repo == "slack":
(rname,
rlocation,
rsize,
runsize
) = slack_filter(name, location, size, unsize, flag)
elif repo == "rlw":
(rname,
rlocation,
rsize,
......@@ -75,6 +79,30 @@ def repo_data(PACKAGES_TXT, repo, flag):
return [rname, rlocation, rsize, runsize]
def slack_filter(name, location, size, unsize, flag):
"""Slackware filter seperate packages from patches/ directory
"""
(fname, flocation, fsize, funsize) = ([] for i in range(4))
if "--patches" not in flag:
for n, l, s, u in zip(name, location, size, unsize):
if f"_slack{slack_ver()}" not in n:
fname.append(n)
flocation.append(l)
fsize.append(s)
funsize.append(u)
if "--patches" in flag:
for n, l, s, u in zip(name, location, size, unsize):
if f"_slack{slack_ver()}" in n:
fname.append(n)
flocation.append(l)
fsize.append(s)
funsize.append(u)
return [fname, flocation, fsize, funsize]
def rlw_filter(name, location, size, unsize):
"""Filter rlw repository data
"""
......
......@@ -28,7 +28,6 @@ from pkg_resources import parse_version
from slpkg.utils import Utils
from slpkg.sizes import units
from slpkg.messages import Msg
from slpkg.toolbar import status
from slpkg.checksum import check_md5
from slpkg.blacklist import BlackList
from slpkg.downloader import Download
......@@ -47,8 +46,6 @@ from slpkg.binary.greps import repo_data
from slpkg.binary.repo_init import RepoInit
from slpkg.binary.dependency import Dependencies
from slpkg.slack.slack_version import slack_ver
class BinaryInstall:
"""Install binaries packages with all dependencies from
......@@ -82,7 +79,7 @@ class BinaryInstall:
self.repo_pkg_names = []
for name in self.data[0]:
self.repo_pkg_names.append(split_package(name)[0])
self.blacklist = BlackList().packages(self.data[0], self.repo)
self.blacklist = BlackList().get_black()
self.matching = False
def init_flags(self):
......@@ -266,7 +263,6 @@ class BinaryInstall:
self.flag != "--resolve-off"):
self.msg.resolving()
for dep in self.packages:
status(0.05)
dependencies = []
dependencies = Utils().dimensional_list(Dependencies(
self.repo, self.blacklist).binary(dep, self.flag))
......@@ -290,7 +286,8 @@ class BinaryInstall:
for pkg, comp in zip(install, comp_sum):
pkg_repo = split_package(pkg[:-4])
if find_package(pkg[:-4], self.meta.pkg_path):
pkg_sum += 1
if "--reinstall" in self.flag:
pkg_sum += 1
COLOR = self.meta.color["GREEN"]
elif pkg_repo[0] == GetFromInstalled(pkg_repo[0]).name():
COLOR = self.meta.color["YELLOW"]
......@@ -331,6 +328,7 @@ class BinaryInstall:
install.append(pk)
comp_sum.append(comp)
uncomp_sum.append(uncomp)
if not install:
for pkg in packages:
for pk, loc, comp, uncomp in zip(self.data[0], self.data[1],
......@@ -346,26 +344,5 @@ class BinaryInstall:
install.reverse()
comp_sum.reverse()
uncomp_sum.reverse()
if self.repo == "slack":
dwn, install, comp_sum, uncomp_sum = self.patches(dwn, install,
comp_sum,
uncomp_sum)
return [dwn, install, comp_sum, uncomp_sum]
def patches(self, dwn, install, comp_sum, uncomp_sum):
"""Seperates packages from patches/ directory
"""
dwnp, installp, comp_sump, uncomp_sump = ([] for i in range(4))
for d, i, c, u in zip(dwn, install, comp_sum, uncomp_sum):
if "_slack" + slack_ver() in i:
dwnp.append(d)
dwn.remove(d)
installp.append(i)
install.remove(i)
comp_sump.append(c)
comp_sum.remove(c)
uncomp_sump.append(u)
uncomp_sum.remove(u)
if "--patches" in self.flag:
return dwnp, installp, comp_sump, uncomp_sump
return dwn, install, comp_sum, uncomp_sum
return [dwn, install, comp_sum, uncomp_sum]
......@@ -41,9 +41,9 @@ class RepoInit:
def fetch(self):
if self.repo in self.meta.default_repositories:
exec(f"self._init_{self.repo}()")
getattr(self, f"_init_{self.repo}")()
else:
exec("self._init_custom()")
self._init_custom()
self.lib = self.meta.lib_path + f"{self.repo}_repo/PACKAGES.TXT"
PACKAGES_TXT = Utils().read_file(self.lib)
return PACKAGES_TXT, self.mirror
......
......@@ -33,6 +33,6 @@ def search_pkg(name, repo):
"""
PACKAGES_TXT = Utils().read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT")
names = list(Utils().package_name(PACKAGES_TXT))
blacklist = BlackList().packages(pkgs=names, repo=repo)
blacklist = BlackList().get_black()
if name in names and name not in blacklist:
return name
\ No newline at end of file
......@@ -25,7 +25,6 @@
import os
from slpkg.utils import Utils
from slpkg.splitting import split_package
from slpkg.__metadata__ import MetaData as _meta_
......@@ -33,7 +32,6 @@ class BlackList:
"""Blacklist class to add, remove or listed packages
in blacklist file."""
def __init__(self):
self.quit = False
self.green = _meta_.color["GREEN"]
self.red = _meta_.color["RED"]
self.endc = _meta_.color["ENDC"]
......@@ -55,89 +53,30 @@ class BlackList:
def listed(self):
"""Print blacklist packages
"""
print("\nPackages in the blacklist:\n")
print("Packages in the blacklist:\n")
for black in self.get_black():
if black:
print(f"{self.green}{black}{self.endc}")
self.quit = True
if self.quit:
print() # new line at exit
def add(self, pkgs):
"""Add blacklist packages if not exist
"""
blacklist = self.get_black()
pkgs = set(pkgs)
print("\nAdd packages in the blacklist:\n")
print("Add packages in the blacklist:\n")
with open(self.blackfile, "a") as black_conf:
for pkg in pkgs:
if pkg not in blacklist:
print(f"{self.green}{pkg}{self.endc}")
black_conf.write(pkg + "\n")
self.quit = True
if self.quit:
print() # new line at exit
def remove(self, pkgs):
"""Remove packages from blacklist
"""
print("\nRemove packages from the blacklist:\n")
print("Remove packages from the blacklist:\n")
with open(self.blackfile, "w") as remove:
for line in self.black_conf.splitlines():
if line not in pkgs:
remove.write(line + "\n")
else:
print(f"{self.red}{line}{self.endc}")
self.quit = True
if self.quit:
print() # new line at exit
def packages(self, pkgs, repo):
"""Return packages in blacklist or by repository
"""
self.black = []
for bl in self.get_black():
pr = bl.split(":")
for pkg in pkgs:
self.__priority(pr, repo, pkg)
self.__blackpkg(bl, repo, pkg)
return self.black
def __add(self, repo, pkg):
"""Split packages by repository
"""
if repo == "sbo":
return pkg
else:
return split_package(pkg)[0]
def __priority(self, pr, repo, pkg):
"""Add packages in blacklist by priority
"""
if (pr[0] == repo and pr[1].startswith("*") and
pr[1].endswith("*")):
if pr[1][1:-1] in pkg:
self.black.append(self.__add(repo, pkg))
elif pr[0] == repo and pr[1].endswith("*"):
if pkg.startswith(pr[1][:-1]):
self.black.append(self.__add(repo, pkg))
elif pr[0] == repo and pr[1].startswith("*"):
if pkg.endswith(pr[1][1:]):
self.black.append(self.__add(repo, pkg))
elif pr[0] == repo and "*" not in pr[1]:
self.black.append(self.__add(repo, pkg))
def __blackpkg(self, bl, repo, pkg):
"""Add packages in blacklist
"""
if bl.startswith("*") and bl.endswith("*"):
if bl[1:-1] in pkg:
self.black.append(self.__add(repo, pkg))
elif bl.endswith("*"):
if pkg.startswith(bl[:-1]):
self.black.append(self.__add(repo, pkg))
elif bl.startswith("*"):
if pkg.endswith(bl[1:]):
self.black.append(self.__add(repo, pkg))
if bl not in self.black and "*" not in bl:
self.black.append(bl)
print(f"{self.red}{line}{self.endc}")
\ No newline at end of file
......@@ -66,7 +66,6 @@ class Updates:
def status_bar(self):
"""Top view bar status
"""
print()
self.msg.template(78)
print("| Repository Status")
self.msg.template(78)
......