Added full reverse flag

This commit is contained in:
Dimitris Zlatanidis 2022-12-25 20:02:55 +02:00
parent da79c3899d
commit 40eefb3680
5 changed files with 23 additions and 11 deletions

View file

@ -1,8 +1,9 @@
4.4.0 - 23/12/2022
Added:
- New command to tracking the dependencies
- Added pythondialog as dependency
- Added dialog for upgrade, remove and dependencies
- pythondialog as dependency
- dialog for upgrade, remove and dependencies
- --full-reverse flag to work with dependees
4.3.9 - 22/12/2022
Added:

View file

@ -1,10 +1,10 @@
.TH slpkg 1 "Orestiada, Greece" "slpkg 4.3.9" dslackw
.TH slpkg 1 "Orestiada, Greece" "slpkg 4.4.0" dslackw
.SH NAME
.P
slpkg - [OPTIONS] [COMMAND] <packages>
.SH SYNAPSES
.P
slpkg [-h|-v] [update] [upgrade] [check-updates] [clean-logs] [clean-tmp] [-b, build] [-i, install] [-d, download] [-r, remove] [-f, find] [-w, view] [-s, search] [-e, dependees] [-t, tracking] --yes --jobs --resolve-off --reinstall --skip-installed
slpkg [-h|-v] [update] [upgrade] [check-updates] [clean-logs] [clean-tmp] [-b, build] [-i, install] [-d, download] [-r, remove] [-f, find] [-w, view] [-s, search] [-e, dependees] [-t, tracking] --yes, --jobs, --resolve-off, --reinstall, --skip-installed, --full-reverse
.SH DESCRIPTION
.P
Slpkg is a software package manager that installs, updates, and removes packages on Slackware based systems. It automatically computes dependencies and figures out what things should occur to install packages. Slpkg makes it easier to maintain groups of machines without having to manually update.
@ -108,6 +108,10 @@ Use this option if you want to upgrade all packages even if the same version is
This a helpful option if you want to avoid building and reinstalling packages.
Note: This option affects only the dependencies.
.RE
.P
--full-reverse
.RS
Full reverse dependency. Works only with -e, dependees command and show the requires too.
.RE
.P
-h | --help

View file

@ -9,8 +9,9 @@ from slpkg.queries import SBoQueries
class Dependees:
""" Show which packages depend. """
def __init__(self, packages: list):
def __init__(self, packages: list, flags: list):
self.packages = packages
self.flags = flags
self.configs = Configs
self.colors = self.configs.colour
@ -56,7 +57,8 @@ class Dependees:
else:
print(f'{" " * 3}{cyan}{v}{endc}')
print(f'{" " * 4}{char} {" ".join([req for req in SBoQueries(v).requires()])}')
if '--full-reverse' in self.flags:
print(f'{" " * 4}{char} {" ".join([req for req in SBoQueries(v).requires()])}')
print(f'\n{grey}{len(value)} dependees for {key}{endc}\n')
else:

View file

@ -41,7 +41,8 @@ class Argparse:
'--jobs',
'--resolve-off',
'--reinstall',
'--skip-installed']
'--skip-installed',
'--full-reverse']
# Check for correct flag
for opt in self.args:
@ -198,13 +199,16 @@ class Argparse:
self.usage.help(1)
def dependees(self):
if len(self.args) >= 2 and not self.flags:
if [f for f in self.flags if f in self.options[:-1]]:
self.usage.help(1)
if len(self.args) >= 2:
packages = list(set(self.args[1:]))
self.check.database()
self.check.exists(packages)
dependees = Dependees(packages)
dependees = Dependees(packages, self.flags)
dependees.slackbuilds()
raise SystemExit()
self.usage.help(1)

View file

@ -21,8 +21,8 @@ class Usage:
""" Prints the short menu. """
args = (
f'Usage: {Configs.prog_name} [{self.yellow}OPTIONS{self.endc}] [{self.cyan}COMMAND{self.endc}] <packages>\n'
f'\n slpkg [{self.yellow}OPTIONS{self.endc}] [--yes, --jobs, --resolve-off, --reinstall, '
f'--skip-installed]\n'
f'\n slpkg [{self.yellow}OPTIONS{self.endc}] [--yes, --jobs, --resolve-off, --reinstall]\n'
f' slpkg [{self.yellow}OPTIONS{self.endc}] [--skip-installed, --full-reverse]\n'
f' slpkg [{self.cyan}COMMAND{self.endc}] [update, upgrade, check-updates, clean-logs, clean-tmp]\n'
f' slpkg [{self.cyan}COMMAND{self.endc}] [-b, build, -i, install, -d, download, -r, remove] <packages>\n'
f' slpkg [{self.cyan}COMMAND{self.endc}] [-f, find, -w, view, -s, search, -e, dependees] <packages>\n'
@ -59,6 +59,7 @@ class Usage:
f' {self.yellow}--resolve-off{self.endc} Turns off dependency resolving.\n'
f' {self.yellow}--reinstall{self.endc} Upgrade packages of the same version.\n'
f' {self.yellow}--skip-installed{self.endc} Skip installed packages.\n'
f' {self.yellow}--full-reverse{self.endc} Full reverse dependency.\n'
'\n -h, --help Show this message and exit.\n'
' -v, --version Print version and exit.\n'
'\nEdit the configuration file in the /etc/slpkg/slpkg.toml.\n'