brewpi-remix/brewpi-tools-rmx

Install Crash on Jessie

Closed this issue · 1 comments

Debian Jessie, crash during bootstrap:

The time is currently set to Wed Apr  8 11:34:17 CDT 2020.
Is this correct? [Y/n]:

Fixing any broken installations before proceeding.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
bash: line 447: "1586363659" - "1586362526": syntax error: operand expected (error token is ""1586363659" - "1586362526"")

Crash is in the routine which checks for the last update (which is ironic):

lastUpdate=$(stat -c %Y /var/lib/apt/lists)
nowTime=$(date +%s)
if [ $(("$nowTime" - "$lastUpdate")) -gt 604800 ] ; then
echo -e "\nLast apt update was over a week ago. Running apt update before updating"
echo -e "dependencies."
apt-get update -yq||die
fi

The issue appears to be caused by treating $lastUpdate and $nowTime the same as one would a string. Removing the quotes and the $-prefix cleared it up. Interesting that this was not an issue on Stretch or Buster.

Resolved in devel, will merge eventually.