Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2022-09-14 20:33:40 +03:00
commit 1b086c342e
12 changed files with 24 additions and 35 deletions

View file

@ -1,5 +1,11 @@
4.1.5 - 9/9/2022
Updated:
- Rename config files to .yml
Bugfixed:
- Show version to noarch packages
4.1.4 - 17/07/2022
-Added
Added:
- setup.cfg file
- Option to upgrade sbo packages

View file

@ -30,8 +30,8 @@ Install from the official third-party `SBo repository <https://slackbuilds.org/r
.. code-block:: bash
$ tar xvf slpkg-4.1.4.tar.gz
$ cd slpkg-4.1.4
$ tar xvf slpkg-4.1.5.tar.gz
$ cd slpkg-4.1.5
$ ./install.sh

View file

@ -1,2 +0,0 @@
blacklist:
packages: []

View file

@ -1,22 +0,0 @@
configs:
os_arch: x86_64
tmp_path: /tmp
tmp_slpkg: /tmp/slpkg
build_path: /tmp/slpkg/build
lib_path: /var/lib/slpkg
etc_path: /etc/slpkg
db_path: /var/lib/slpkg/database
sbo_repo_path: /var/lib/slpkg/repository
log_packages: /var/log/packages
database: database.slpkg
repo_version: 15.0
sbo_url: http://slackbuilds.org/slackbuilds/15.0
sbo_txt: SLACKBUILDS.TXT
tar_suffix: .tar.gz
pkg_suffix: .tgz
repo_tag: _SBo
installpkg: upgradepkg --install-new
reinstall: upgradepkg --reinstall
removepkg: removepkg
colors: on
wget_options: -c -N

View file

@ -1,6 +1,6 @@
[metadata]
name = slpkg
version = 4.1.4
version = 4.1.5
license_file = LICENSE
author = Dimitris Zlatanidis
author_email = d.zlatanidis@gmail.com

View file

@ -8,8 +8,8 @@ config() {
fi
}
config etc/slpkg/slpkg.yaml.new
config etc/slpkg/blacklist.yaml.new
config etc/slpkg/slpkg.yml.new
config etc/slpkg/blacklist.yml.new
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1

View file

@ -98,8 +98,8 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
# install configuration files
mkdir -p $PKG/etc/slpkg
install -D -m0644 configs/slpkg.yaml $PKG/etc/slpkg/slpkg.yaml.new
install -D -m0644 configs/blacklist.yaml $PKG/etc/slpkg/blacklist.yaml.new
install -D -m0644 configs/slpkg.yml $PKG/etc/slpkg/slpkg.yml.new
install -D -m0644 configs/blacklist.yml $PKG/etc/slpkg/blacklist.yml.new
mkdir -p $PKG/usr/man/man1
cp man/slpkg.1 $PKG/usr/man/man1

View file

@ -15,7 +15,7 @@ class Blacklist:
etc_path: str = Configs.etc_path
def get(self):
file = f'{self.etc_path}/blacklist.yaml'
file = f'{self.etc_path}/blacklist.yml'
if os.path.isfile(file):
with open(file, 'r') as black:
return yaml.safe_load(black)['blacklist']['packages']

View file

@ -53,7 +53,7 @@ class Configs:
os.makedirs(build_path)
''' Overwrite with user configuration. '''
config_file: str = f'{etc_path}/{prog_name}.yaml'
config_file: str = f'{etc_path}/{prog_name}.yml'
if os.path.isfile(config_file):
with open(config_file, 'r') as conf:
configs = yaml.safe_load(conf)

View file

@ -68,6 +68,10 @@ class Argparse:
upgrade = Upgrade()
packages = list(upgrade.packages())
if not packages:
print('\nEverything is up-to-date.\n')
raise SystemExit()
install = Slackbuilds(packages, self.flags, install=True)
install.execute()
raise SystemExit()

View file

@ -10,7 +10,7 @@ from slpkg.configs import Configs
@dataclass
class Version:
prog_name: str = Configs.prog_name
version_info: tuple = (4, 1, 4)
version_info: tuple = (4, 1, 5)
version: str = '{0}.{1}.{2}'.format(*version_info)
license: str = 'MIT License'
author: str = 'dslackw'

View file

@ -95,6 +95,9 @@ class ViewMessage:
if '--reinstall' in self.flags:
install, set_color = 'upgrade', color['YELLOW']
if installed and 'noarch' in installed:
self.arch = 'noarch'
if installed:
print(f'[{set_color} {install} {color["ENDC"]}] -> '
f'{sbo}-{version} {set_color}'