diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-07 02:28:13 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-07 02:28:13 +0100 |
commit | a0e0d61f2ffa60943a396b4c390a159a518a6ad1 (patch) | |
tree | 37549683d512c3c3756c8c33aaeb9fa380ca3069 /sbocheck | |
parent | 7e32ff2bbdd632c8ba14c45ab91128c626047231 (diff) | |
download | sbotools2-a0e0d61f2ffa60943a396b4c390a159a518a6ad1.tar.xz |
Alert that a local override is being used
This fixes #13
This fixes #15
Yay, 2 fixes for the price of one commit!
Diffstat (limited to 'sbocheck')
-rwxr-xr-x | sbocheck | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -12,7 +12,7 @@ use 5.16.0; use strict; use warnings FATAL => 'all'; -use SBO::Lib qw/ update_tree get_available_updates script_error open_fh /; +use SBO::Lib qw/ update_tree get_available_updates script_error open_fh is_local /; use Getopt::Long; use File::Basename; use List::Util 'max'; @@ -53,7 +53,7 @@ sub get_update_list { push @up_lengths, length $$updates[$_]{update} for keys @$updates; my $up_length = max @up_lengths; # "needs updating" bit without version is 30 characters - my $remaining = 80 - ($up_length + 30); + my $remaining = 80 - ($up_length + 44); my @lengths; push @lengths, length "$$updates[$_]{name}-$$updates[$_]{installed}" for keys @$updates; @@ -70,7 +70,9 @@ sub get_update_list { my @listing; for my $update (@$updates) { my $name = sprintf "%s %s", $$update{name}, $$update{installed}; - push(@listing, sprintf "%-${min}s < needs updating (SBo has %s)", + my $upd = "SBo has %s"; + if (is_local($$update{name})) { $upd = "%s from local overrides"; } + push(@listing, sprintf "%-${min}s < needs updating ($upd)", $name, $$update{update}); } return \@listing; |