* Bumped anvil.spec to 3.0-14 and fixed a Requires package name with a stray colon.

* Cleaned up (enough, anyway) the tools/anvil-update-system tool.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 6 years ago
parent dd88051d9b
commit d91b50fd63
  1. 2
      rpm/SOURCES/README
  2. 8
      rpm/SPECS/anvil.spec
  3. 24
      tools/anvil-update-system

@ -2,4 +2,4 @@ The 'master.tar.gz' file from the anvil github repo:
https://github.com/digimer/anvil should be stored in this directory when
building the .spec file.
* wget -c https://github.com/digimer/anvil/archive/master.zip
* wget -c https://github.com/digimer/anvil/archive/master.tar.gz

@ -3,7 +3,7 @@
%define anvilgroup admin
Name: anvil
Version: 3.0
Release: 13%{?dist}
Release: 14%{?dist}
Summary: Alteeve Anvil! complete package.
License: GPLv2+
@ -39,7 +39,7 @@ Requires: perl-JSON
Requires: perl-Log-Journald
Requires: perl-Net-SSH2
Requires: perl-NetAddr-IP
Requires: perl-Proc-Simple;
Requires: perl-Proc-Simple
Requires: perl-Sys-Syslog
Requires: perl-Time-HiRes
Requires: perl-XML-Simple
@ -381,6 +381,10 @@ setenforce 1
%changelog
* Wed Aug 15 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-14
- The new requirement for perl-Proc-Simple had a trailing semi-colon that
slipped past the -13 release tests. Fixed here.
* Tue Aug 14 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-13
- Disabled the postun as it breaks connections to the DB during updates.

@ -216,30 +216,21 @@ sub run_os_update
update_progress($anvil, $progress);
# The total (reliable) count of events is (to_update * 3), counting '(x/y): '
# (download), 'Upgrading ', 'Installing ' and 'Verifying '. We ignore the scriplet
# (download), 'Upgrading '/'Installing ' and 'Verifying '. We ignore the scriplet
# and other lines as it's hard to predict how many there will be, and they pass fast
# enough to not really matter for a progress bar.
$to_update *= 3;
$percent_step = $to_update / 90;
$to_update *= 4;
$percent_step = $anvil->Convert->round({number => ($to_update / 90)});
$next_step = $percent_step;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
to_update => $to_update,
percent_step => $percent_step,
next_step => $next_step,
}});
if ($percent_step =~ /\d+\.\d+/)
{
# Round up.
$percent_step += 1;
$percent_step = int($percent_step);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { percent_step => $percent_step }});
}
$next_step = $percent_step;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { next_step => $next_step }});
}
# If 'percent_step' is set, we're ready to start counting lines.
if (($percent_step) && (($line =~ /\(\d+\/\d+\): /) or ($line =~ /Upgrading /i) or ($line =~ /Installing /) or ($line =~ /Cleanup /)))
if (($percent_step) && (($line =~ /\(\d+\/\d+\): /) or ($line =~ /^Upgrading /i) or ($line =~ /^Installing /) or ($line =~ /^Cleanup /i) or ($line =~ /^Verifying /i)))
{
$counted_lines++;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { counted_lines => $counted_lines }});
@ -249,10 +240,11 @@ sub run_os_update
# Step up the progress.
$next_step += $percent_step;
$progress++;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
next_step => $next_step,
progress => $progress,
}});
next if $progress > 95;
update_progress($anvil, $progress);
}

Loading…
Cancel
Save