#1625 Issue closed: bc (arbitrary precision calculator) not necessary for each Linux distribution

Labels: enhancement, won't fix / can't fix / obsolete

ProBackup-nl opened issue at 2017-12-07 11:08:

  • rear version (/usr/sbin/rear -V): git
  • OS version (cat /etc/rear/os.conf or lsb_release -a): n/a

In pre-2017 version of the ReaR code there was no dependency for bc.

Some older Linux distributions apparently suffer a calculation bug which appears in the ReaR partition resizing code. Other Linux distributions correctly calculate partition sizes without helper utilities.

Make ReaR more Relax

Change the hard dependency for bc only to a hard dependency for the Linux distributions where needed.

Suggestion:

  1. make the sample sometimes failing calculation
  2. calculation failed? Only then include bc as required dependency

jsmeix commented at 2017-12-07 13:44:

In general I agree that REQUIRED_PROGS should be only
what is mandatory to have in the recovery system, cf.
https://github.com/rear/rear/pull/1570#issuecomment-347790094

Regarding 'bc':
We have 'bc' currently unconditioned in REQUIRED_PROGS
because the current implementation of the mathlib_calculate()
function in lib/global-functions.sh and how that function is called
by other scripts only works with 'bc' because it depends
on the 'bc' syntax.
Accordingly a precondition to have 'bc' no longer mandatory
is a way that can be implemented and maintained with
reasonable effort how to do such calculations independent
of the actual calculation program.

gdha commented at 2018-02-23 10:04:

@ProBackup-nl I would not mind to get rid of bc, OTOH there are too many other issues open that should get fixed in a timely fashion. Therefore, may I suggest if you have time and a strong desire to prepare a PR for a better bc-free rear?

jsmeix commented at 2018-02-23 10:53:

Only a side note FYI:
Because etc/rear/local.conf is sourced by usr/sbin/rear after
the functions in usr/share/rear/lib/[a-z]*.sh had beed sourced
one can re-define the mathlib_calculate() function
by any other implementation in etc/rear/local.conf
and then check how that works with huge disks
in particular in migration mode.

gdha commented at 2018-07-19 16:07:

As no feedback or additional comments were added I may assume that this issue has no future anymore? We better close it 'till further notice or new inspired input has been given


[Export of Github issue for rear/rear.]