mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-26 09:58:31 +01:00
Added PACKAGE_METHOD config
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
0dfa4a85d3
commit
c273607ae1
5 changed files with 34 additions and 11 deletions
|
@ -1,6 +1,9 @@
|
|||
## slpkg - ChangeLog
|
||||
|
||||
### 5.0.10 - 31/05/2024
|
||||
### 5.1.0 - 01/06/2024
|
||||
|
||||
- Added:
|
||||
* Added PACKAGE_METHOD config to choose the upgrade method
|
||||
|
||||
- Updated:
|
||||
* Updated message for invalid package version
|
||||
|
|
|
@ -38,6 +38,16 @@ DIALOG = true
|
|||
# but not as main packages. Default is true. [true/false]
|
||||
VIEW_MISSING_DEPS = true
|
||||
|
||||
# There are two different methods to choose when you want to upgrade
|
||||
# your installed packages, "version" method and "package" method.
|
||||
# With the "version" method, it will compare the version and the
|
||||
# build number of the packages following the semantic versioning,
|
||||
# and with the "package" method it will compare the whole package
|
||||
# between installed and repository and this means it will suggest
|
||||
# also downgrades if the installed package is newer than the
|
||||
# repository package. Default is false. [true/false]
|
||||
PACKAGE_METHOD = false
|
||||
|
||||
# Delete downloaded sources after build or install packages.
|
||||
# Default is false. [true/false]
|
||||
DELETE_SOURCES = false
|
||||
|
|
|
@ -46,6 +46,7 @@ class Configs: # pylint: disable=[R0902]
|
|||
checksum_md5: bool = True
|
||||
dialog: bool = True
|
||||
view_missing_deps: bool = True
|
||||
package_method: bool = False
|
||||
delete_sources: bool = False
|
||||
downloader: str = 'wget'
|
||||
wget_options: str = '--c -q --progress=bar:force:noscroll --show-progress'
|
||||
|
@ -94,6 +95,7 @@ class Configs: # pylint: disable=[R0902]
|
|||
checksum_md5: bool = config['checksum_md5']
|
||||
dialog: bool = config['dialog']
|
||||
view_missing_deps: bool = config['view_missing_deps']
|
||||
package_method: bool = config['package_method']
|
||||
delete_sources: bool = config['delete_sources']
|
||||
downloader: str = config['downloader']
|
||||
wget_options: str = config['wget_options']
|
||||
|
|
|
@ -76,6 +76,7 @@ class FormConfigs(Configs):
|
|||
'COLORS',
|
||||
'DIALOG',
|
||||
'VIEW_MISSING_DEPS',
|
||||
'PACKAGE_METHOD',
|
||||
'DELETE_SOURCES',
|
||||
'SILENT_MODE',
|
||||
'ASCII_CHARACTERS',
|
||||
|
@ -128,6 +129,7 @@ class FormConfigs(Configs):
|
|||
('COLORS =',
|
||||
'DIALOG =',
|
||||
'VIEW_MISSING_DEPS =',
|
||||
'PACKAGE_METHOD =',
|
||||
'DELETE_SOURCES =',
|
||||
'SILENT_MODE =',
|
||||
'ASCII_CHARACTERS =',
|
||||
|
|
|
@ -116,6 +116,12 @@ class Upgrade(Configs): # pylint: disable=[R0902]
|
|||
|
||||
inst_build: str = self.utils.split_package(installed)['build']
|
||||
|
||||
if self.package_method:
|
||||
repo_package: str = self.data[inst_name]['package'][:-4] # Get the repo package.
|
||||
if installed != repo_package:
|
||||
return True
|
||||
|
||||
else:
|
||||
try:
|
||||
if parse(repo_version) > parse(inst_version):
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue