2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

42_AptToDate: add dist-upgrade available with Attribut

git-svn-id: https://svn.fhem.de/fhem/trunk@16994 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2018-07-17 09:48:56 +00:00
parent 08899301d5
commit e6a76ad823
2 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 42_AptToDate: add dist-upgrade available with Attribut
- change: 74_XiaomiBTLESens: more debug messages, delete old batteryreadings
- change: 83_IOhomecontrol, 84_IOhomecontrolDevice: complete rewrite and
extended features

View File

@ -49,7 +49,7 @@ eval "use JSON;1" or $missingModul .= "JSON ";
my $version = "0.2.4";
my $version = "1.0.0";
@ -103,6 +103,7 @@ sub AptToDate_Initialize($) {
$hash->{AttrList} = "disable:1 ".
"disabledForIntervals ".
"upgradeListReading:1 ".
"distupgrade:1 ".
$readingFnAttributes;
@ -358,16 +359,17 @@ use constant POLLINTERVAL => 1;
sub AptToDate_AsynchronousExecuteAptGetCommand($) {
require "SubProcess.pm";
my ($hash) = shift;
my ($hash) = shift;
my $name = $hash->{NAME};
$hash->{".fhem"}{aptget}{lang} = ReadingsVal($name,'os-release_language','none');
my $name = $hash->{NAME};
$hash->{".fhem"}{aptget}{lang} = ReadingsVal($name,'os-release_language','none');
my $subprocess = SubProcess->new({ onRun => \&AptToDate_OnRun });
$subprocess->{aptget} = $hash->{".fhem"}{aptget};
$subprocess->{aptget}{host} = $hash->{HOST};
$subprocess->{aptget}{debug} = ( AttrVal($name,'verbose',0) > 3 ? 1 : 0 );
my $subprocess = SubProcess->new({ onRun => \&AptToDate_OnRun });
$subprocess->{aptget} = $hash->{".fhem"}{aptget};
$subprocess->{aptget}{host} = $hash->{HOST};
$subprocess->{aptget}{debug} = ( AttrVal($name,'verbose',0) > 3 ? 1 : 0 );
$subprocess->{aptget}{distupgrade} = ( AttrVal($name,'distupgrade',0) == 1 ? 1 : 0 );
my $pid = $subprocess->run();
readingsSingleUpdate($hash,'state',$hash->{".fhem"}{aptget}{cmd}.' in progress', 1);
@ -447,7 +449,8 @@ sub AptToDate_ExecuteAptGetCommand($) {
$apt->{distri} = 'ssh '.$aptget->{host}.' cat /etc/os-release |';
$apt->{'locale'} = 'ssh '.$aptget->{host}.' locale';
$apt->{aptgetupgrade} = 'ssh '.$aptget->{host}.' \'echo n | sudo apt-get -s -q -V upgrade\'';
$apt->{aptgettoupgrade} = 'ssh '.$aptget->{host}.' \'echo n | sudo apt-get -y -q -V upgrade\'';
$apt->{aptgettoupgrade} = 'ssh '.$aptget->{host}.' \'echo n | sudo apt-get -y -q -V upgrade\'' if($aptget->{distupgrade} == 0);
$apt->{aptgettoupgrade} = 'ssh '.$aptget->{host}.' \'echo n | sudo apt-get -y -q -V dist-upgrade\'' if($aptget->{distupgrade} == 1);
} else {
@ -455,7 +458,8 @@ sub AptToDate_ExecuteAptGetCommand($) {
$apt->{distri} = '</etc/os-release';
$apt->{'locale'} = 'locale';
$apt->{aptgetupgrade} = 'echo n | sudo apt-get -s -q -V upgrade';
$apt->{aptgettoupgrade} = 'echo n | sudo apt-get -y -q -V upgrade';
$apt->{aptgettoupgrade} = 'echo n | sudo apt-get -y -q -V upgrade' if($aptget->{distupgrade} == 0);
$apt->{aptgettoupgrade} = 'echo n | sudo apt-get -y -q -V dist-upgrade' if($aptget->{distupgrade} == 1);
}
my $response;