Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revisionBoth sides next revision | ||
monitors:rpi-apt [2018/01/20 11:40] – created wnelis | monitors:rpi-apt [2018/03/11 10:15] – [Description] wnelis | ||
---|---|---|---|
Line 5: | Line 5: | ||
^ Requirements | Perl | | ^ Requirements | Perl | | ||
^ Download | None | | ^ Download | None | | ||
- | ^ Last Update | 2018-01-20 | | + | ^ Last Update | 2018-03-11 | |
===== Description ===== | ===== Description ===== | ||
- | Script rpi-apt.pl is a client-side script, which determines if there are any packages which can be upgraded at a Raspberry Pi running Raspbian. The upgrades are grouped into two classes, the security upgrades and the rest. An alert is generated if at least one upgrade is found. | + | Script rpi-apt.pl is a client-side script, which determines if there are any packages which can be upgraded at a Raspberry Pi running Raspbian. The upgrades are grouped into three classes, the security |
+ | Script rpi-apt.pl will update | ||
Line 70: | Line 71: | ||
my $Result= '' | my $Result= '' | ||
- | my %Class= ( High => ' | + | my %Class= ( High => ' |
my %UPL = () ; | my %UPL = () ; | ||
$UPL{$_} = {} foreach ( keys %Class ) ; | $UPL{$_} = {} foreach ( keys %Class ) ; | ||
Line 87: | Line 88: | ||
| | ||
@Lines= `stat $uplcFileName` ; # Cache file statistics | @Lines= `stat $uplcFileName` ; # Cache file statistics | ||
- | | + | |
| | ||
foreach ( @Lines ) { | foreach ( @Lines ) { | ||
Line 108: | Line 109: | ||
# | # | ||
sub GetListOfUpdates() { | sub GetListOfUpdates() { | ||
+ | my $InPostponed= 0 ; # Flag: in list of kept back packages | ||
+ | |||
@Lines= `$upCmd` ; # Current list of updatable packages | @Lines= `$upCmd` ; # Current list of updatable packages | ||
foreach ( @Lines ) { | foreach ( @Lines ) { | ||
chomp ; | chomp ; | ||
+ | |||
+ | # Handle the list of packages which are not to be upgraded (which are kept | ||
+ | # back). The format of such a list is as follows: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | if ( $InPostponed ) { | ||
+ | if ( m/ | ||
+ | $UPL{Postponed}{$1}= [ $1, '?', | ||
+ | next ; # Line is handled | ||
+ | } else { | ||
+ | $InPostponed= 0 ; # Enf o section found | ||
+ | } # of else | ||
+ | } elsif ( m/^The following packages have been kept back/ ) { | ||
+ | $InPostponed= 1 ; # Start of section found | ||
+ | next ; # Line is handled | ||
+ | } # of elsif | ||
+ | |||
if ( m/^Inst (.+?) \[(.+?)] \((.+?) / ) { | if ( m/^Inst (.+?) \[(.+?)] \((.+?) / ) { | ||
if ( m/securi/i ) { | if ( m/securi/i ) { | ||
Line 155: | Line 176: | ||
$Result.= "</ | $Result.= "</ | ||
- | return if $upCnt == 0 ; | + | return if $upCnt |
| | ||
- | $Result.= " | + | $Result.= " |
$Result.= "< | $Result.= "< | ||
$Result.= " < | $Result.= " < | ||
Line 215: | Line 236: | ||
=== Server side === | === Server side === | ||
- | There is nothing to install or to configure at the server-size, except possibly for the alerting. | + | There is nothing to install or to configure at the server-side, except possibly for the alerting. |
Line 227: | Line 248: | ||
* **2018-01-20** | * **2018-01-20** | ||
* Initial release | * Initial release | ||
+ | * **2018-03-11** | ||
+ | * Report the packages which are kept back too | ||