#2230 Issue closed: Question about defining values for predefined variables

Labels: support / question, fixed / solved / done

guru4712 opened issue at 2019-09-06 11:24:

Regarding Version 2.5-1

From issue https://github.com/rear/rear/issues/2228#issue-489707602 I learnt that setting values for variable PROGS must be carried out as an addtion of the new values to the predefined variable.

But why?
In default.conf variable PROGS is set to an empty array so it seemed not to make any harm to set some values. But it did not work.
Does anybody else do things to that variable before it is sourced with my values?
And if so, how could I know to be careful and only add things, since there is no hint in default.conf .

As for AUTOXCLUDE_PATH it works to set the respective pathes.

pcahyna commented at 2019-09-09 09:30:

It is not empty. See at least https://github.com/rear/rear/blob/b8b7e466ed85891eff67e6653fb2239f41655f82/usr/share/rear/conf/GNU/Linux.conf#L12

guru4712 commented at 2019-09-10 06:05:

Thank you!

jsmeix commented at 2019-09-10 13:29:

@guru4712
two side notes FYI:

Run rear -s mkrescue (-s is simulation mode)
to see what scripts would get sourced in your case.
Cf. "Debugging issues with Relax-and-Recover" in
https://en.opensuse.org/SDB:Disaster_Recovery

Run something like

find usr/share/rear/ -name '*.sh' | xargs grep 'PROGS='

to find all places in ReaR scripts where PROGS is assigned.

guru4712 commented at 2019-09-11 04:35:

Very helpful hints; thank you!

pcahyna commented at 2019-09-12 14:03:

@jsmeix well it will not find += if/when there are any :)

jsmeix commented at 2019-09-13 13:39:

@pcahyna
so we know now at least one reason for using

ARRAY=( "${ARRAY[@]}" additional elements )

instead of the simpler and more fail safe

ARRAY+=( additional elements )

:-)

@guru4712
FYI what we are talking about see
https://github.com/rear/rear/issues/2220#issuecomment-528347818
and subsequent comments.


[Export of Github issue for rear/rear.]