mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-10 20:01:54 +01:00
Merge branch 'develop'
This commit is contained in:
commit
dfeadc4c07
9 changed files with 27 additions and 39 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
4.1.3 - 26/06/2022
|
||||||
|
Bugfixed:
|
||||||
|
- /tmp permissions after installation
|
||||||
|
Updated:
|
||||||
|
- find installation binary file in /tmp folder
|
||||||
|
|
||||||
4.1.2 - 24/06/2022
|
4.1.2 - 24/06/2022
|
||||||
Bugfixed:
|
Bugfixed:
|
||||||
- Installing noarch packages
|
- Installing noarch packages
|
||||||
|
|
|
@ -30,8 +30,8 @@ Install from the official third-party `SBo repository <https://slackbuilds.org/r
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ tar xvf slpkg-4.1.2.tar.gz
|
$ tar xvf slpkg-4.1.3.tar.gz
|
||||||
$ cd slpkg-4.1.2
|
$ cd slpkg-4.1.3
|
||||||
$ ./install.sh
|
$ ./install.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -25,8 +25,7 @@ setup(
|
||||||
data_files=[('/etc/slpkg', ['configs/slpkg.yaml']),
|
data_files=[('/etc/slpkg', ['configs/slpkg.yaml']),
|
||||||
('/etc/slpkg', ['configs/blacklist.yaml']),
|
('/etc/slpkg', ['configs/blacklist.yaml']),
|
||||||
('/var/lib/slpkg/database', []),
|
('/var/lib/slpkg/database', []),
|
||||||
('/var/lib/slpkg/repository', []),
|
('/var/lib/slpkg/repository', [])],
|
||||||
('/tmp/slpkg/build', [])],
|
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
|
|
|
@ -48,6 +48,10 @@ class Configs:
|
||||||
colors: str = 'on'
|
colors: str = 'on'
|
||||||
wget_options = '-c -N'
|
wget_options = '-c -N'
|
||||||
|
|
||||||
|
# Creating the build path
|
||||||
|
if not os.path.isdir(build_path):
|
||||||
|
os.makedirs(build_path)
|
||||||
|
|
||||||
''' Overwrite with user configuration. '''
|
''' Overwrite with user configuration. '''
|
||||||
config_file: str = f'{etc_path}/{prog_name}.yaml'
|
config_file: str = f'{etc_path}/{prog_name}.yaml'
|
||||||
if os.path.isfile(config_file):
|
if os.path.isfile(config_file):
|
||||||
|
|
|
@ -105,7 +105,7 @@ class Slackbuilds:
|
||||||
sources = SBoQueries(sbo).sources()
|
sources = SBoQueries(sbo).sources()
|
||||||
self.download_sources(sbo, sources)
|
self.download_sources(sbo, sources)
|
||||||
|
|
||||||
self.execute_the_script(self.build_path, sbo)
|
self.build_the_script(self.build_path, sbo)
|
||||||
|
|
||||||
if self.install:
|
if self.install:
|
||||||
|
|
||||||
|
@ -147,13 +147,18 @@ class Slackbuilds:
|
||||||
''' Creating a list with all the finished packages for
|
''' Creating a list with all the finished packages for
|
||||||
installation.
|
installation.
|
||||||
'''
|
'''
|
||||||
build_tag, arch = self.utils.read_dot_slackbuild(self.build_path, name)
|
|
||||||
version = SBoQueries(name).version()
|
version = SBoQueries(name).version()
|
||||||
|
|
||||||
return (f'{name}-{version}-{arch}-{build_tag[0]}'
|
packages = []
|
||||||
f'{self.repo_tag}{self.pkg_suffix}')
|
pkg = f'{name}-{version}'
|
||||||
|
|
||||||
def execute_the_script(self, path: str, name: str):
|
for package in os.listdir(self.tmp_path):
|
||||||
|
if pkg in package:
|
||||||
|
packages.append(package)
|
||||||
|
|
||||||
|
return max(packages)
|
||||||
|
|
||||||
|
def build_the_script(self, path: str, name: str):
|
||||||
''' Run the .SlackBuild script. '''
|
''' Run the .SlackBuild script. '''
|
||||||
folder = f'{path}/{name}/'
|
folder = f'{path}/{name}/'
|
||||||
slackbuild = f'./{name}.SlackBuild'
|
slackbuild = f'./{name}.SlackBuild'
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
|
@ -15,28 +14,6 @@ from slpkg.configs import Configs
|
||||||
@dataclass
|
@dataclass
|
||||||
class Utilities:
|
class Utilities:
|
||||||
log_packages: str = Configs.log_packages
|
log_packages: str = Configs.log_packages
|
||||||
os_arch: str = Configs.os_arch
|
|
||||||
|
|
||||||
def read_dot_slackbuild(self, path: str, name: str):
|
|
||||||
''' Opens the .SlackBuild file and reads the BUILD TAG and ARCH. '''
|
|
||||||
folder = f'{path}/{name}'
|
|
||||||
slackbuild = f'{name}.SlackBuild'
|
|
||||||
|
|
||||||
if os.path.isfile(f'{folder}/{slackbuild}'):
|
|
||||||
with open(f'{folder}/{slackbuild}', 'r', encoding='utf-8') as sbo:
|
|
||||||
lines = sbo.read().splitlines()
|
|
||||||
|
|
||||||
build_tag = arch = ''
|
|
||||||
for line in lines:
|
|
||||||
if line.startswith('BUILD'):
|
|
||||||
build_tag = re.findall(r'\d+', line)
|
|
||||||
if line.startswith('ARCH'):
|
|
||||||
arch = line.replace('ARCH=', '')
|
|
||||||
|
|
||||||
if not arch:
|
|
||||||
arch = self.os_arch
|
|
||||||
|
|
||||||
return build_tag, arch
|
|
||||||
|
|
||||||
def untar_archive(self, path: str, archive: str, ext_path: str):
|
def untar_archive(self, path: str, archive: str, ext_path: str):
|
||||||
''' Untar the file to the build folder. '''
|
''' Untar the file to the build folder. '''
|
||||||
|
|
|
@ -10,7 +10,7 @@ from slpkg.configs import Configs
|
||||||
@dataclass
|
@dataclass
|
||||||
class Version:
|
class Version:
|
||||||
prog_name: str = Configs.prog_name
|
prog_name: str = Configs.prog_name
|
||||||
version_info: tuple = (4, 1, 2)
|
version_info: tuple = (4, 1, 3)
|
||||||
version: str = '{0}.{1}.{2}'.format(*version_info)
|
version: str = '{0}.{1}.{2}'.format(*version_info)
|
||||||
license: str = 'MIT License'
|
license: str = 'MIT License'
|
||||||
author: str = 'dslackw'
|
author: str = 'dslackw'
|
||||||
|
|
|
@ -13,7 +13,7 @@ class TestConfigs(unittest.TestCase):
|
||||||
self.os_arch = Configs.os_arch
|
self.os_arch = Configs.os_arch
|
||||||
|
|
||||||
def test_repo_version(self):
|
def test_repo_version(self):
|
||||||
self.assertEqual('15.0', self.repo_version)
|
self.assertEqual(15.0, self.repo_version)
|
||||||
|
|
||||||
def test_sbo_txt(self):
|
def test_sbo_txt(self):
|
||||||
self.assertEqual('SLACKBUILDS.TXT', self.sbo_txt)
|
self.assertEqual('SLACKBUILDS.TXT', self.sbo_txt)
|
||||||
|
|
|
@ -9,12 +9,9 @@ class TestUtilities(unittest.TestCase):
|
||||||
self.utils = Utilities()
|
self.utils = Utilities()
|
||||||
self.build_path = Configs.build_path
|
self.build_path = Configs.build_path
|
||||||
|
|
||||||
def test_build_tag(self):
|
|
||||||
self.assertEqual(['2'], self.utils.build_tag(self.build_path,
|
|
||||||
'fish'))
|
|
||||||
|
|
||||||
def test_ins_installed(self):
|
def test_ins_installed(self):
|
||||||
self.assertEqual(True, self.utils.is_installed('fish-3.4.0'))
|
self.assertEqual('fish-3.4.0-x86_64-2_SBo', self.utils.is_installed(
|
||||||
|
'fish-3.4.0'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue