Michael Tremer schreef op ma 21-03-2022 om 16:33 [+0000]:
Hello,
On 9 Mar 2022, at 22:56, Robin Roevens robin.roevens@disroot.org wrote:
- Added possibility to list available upgrades from commandline
using 'pakfire list upgrade'.
- Bugfix: allow [options] between 'list' and
[installed/notinstalled/ upgrade]
Signed-off-by: Robin Roevens robin.roevens@disroot.org
src/pakfire/lib/functions.pl | 2 +- src/pakfire/pakfire | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 6287367f5..b35aed6a3 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -114,7 +114,7 @@ sub usage { &Pakfire::message("Usage: pakfire <install|remove> [options] <pak(s)>"); &Pakfire::message(" <update> - Contacts the servers for new lists of paks."); &Pakfire::message(" <upgrade> - Installs the latest version of all paks."); - &Pakfire::message(" <list> - Outputs a short list with all available paks."); + &Pakfire::message(" <list> [installed/notinstalled/upgrade] - Outputs a list with all, installed, available or upgradeable paks."); &Pakfire::message(" <status> - Outputs a summary about available core upgrades, updates and a required reboot"); &Pakfire::message(""); &Pakfire::message(" Global options:"); diff --git a/src/pakfire/pakfire b/src/pakfire/pakfire index 2fb9adce7..b529db77a 100644 --- a/src/pakfire/pakfire +++ b/src/pakfire/pakfire @@ -333,7 +333,9 @@ my $reset_color = ""; my $filter = "all";
- if ("$ARGV[1]" =~ /installed|notinstalled/) { + shift if ("$ARGV[1]" =~ "^-");
+ if ("$ARGV[1]" =~ /installed|notinstalled|upgrade/) { $filter = "$ARGV[1]"; } else { &Pakfire::message("PAKFIRE WARN: Not a known option $ARGV[1]") if ($ARGV[1]); @@ -347,6 +349,16 @@ $use_color = "$Pakfire::color{'lightgreen'}"; }
+ # Check for available core upgrade first if list of upgrades is requested + if ("$filter" eq "upgrade") { + my %coredb = &Pakfire::coredbinfo();
+ if (defined $coredb{'AvailableRelease'}) { + print "${use_color}Core-Update $coredb{'CoreVersion'}\n"; + print "Release: $coredb{'Release'} -> $coredb{'AvailableRelease'}${reset_color}\n\n"; + } + }
Here we should add an exit code, because monitoring people love them :)
Agreed :-).. will look into it.
foreach $pak (sort keys %paklist) { if ("$Pakfire::enable_colors" eq "1") { if ("$paklist{$pak}{'Installed'}" eq "yes") { -- 2.34.1
-- Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn.