#699 PR merged: Added separated debugscripts option and first steps so that 'set -eu' works

Labels: enhancement, cleanup, fixed / solved / done

jsmeix opened issue at 2015-11-18 15:31:

This is a huge pull request with lots of things in it.

Its initial intent was https://github.com/rear/rear/issues/688
by adding a separated debugscripts option so that e.g.

rear --debugscripts 'ue +h -o pipefail' help

now works as an initial proof of concept that rear can be
made working with things like 'set -eu'.

Because my final goal behind https://github.com/rear/rear/issues/688
is to make rear working with things like 'set -ue -o pipefail' I like
to have as a precondition support for advanced debugging settings
built-in in rear (instead of manually modifying the scripts).

While I implemented the debugscripts option I tested how it works
with things like

rear --debugscripts 'xvue -o pipefail' help

and during this testing I fixed all what fails in the rear scripts.

Unfortunately because of this that pull request here is big and implements three things at once:

1.)
The new debugscripts option which is fully backward compatible because the behaviour of the other options does not change.

2.)
I fixed all what fails because of 'set -ue -o pipefail' for the "help" workflow as a very first step into that direction.

3.)
When I was working on a particular piece of code I also changed it as needed to be better in compliance with the "Coding Style" at
https://github.com/rear/rear/wiki/Coding-Style

If you agree with what I did here, I will continue to make rear working with 'set -ue -o pipefail' step by step also for other workflows.

In any case I would very much appreciate it if you carefully check what I changed.

I assume at least in some cases you may wonder about the code before and afterwards - in this case please ask me - I think there are several places in the code where it is not clear what is actually meant so that I could have made plain wrong changes because I failed to understand what the actual intent is of a particular code.

Many thanks in advance for your review!

jsmeix commented at 2015-11-18 15:55:

I forgot:

For me also e.g. "rear -d -D mkrescue" still works so that for me it does not seem to be totally broken what I did - nevertheless I appreciate a careful review.

# rear -d -D mkrescue
Relax-and-Recover 1.17.2 / Git
Using log file: /var/log/rear/rear-nelson.log
Creating disk layout
Creating root filesystem layout
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Creating initramfs
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-nelson.iso (48M)
You should also rm -Rf /tmp/rear.6oUBR6qZbKp0XT5
# echo $?
0

jsmeix commented at 2015-11-18 16:16:

Regarding make rear working with ''set -ue -o pipefail"
I created https://github.com/rear/rear/issues/700

jsmeix commented at 2015-11-19 10:38:

FYI:

Right now I tested on a SLES12-SP1 KVM/Qemu virtual machine
with 2.5TB virtual harddisk using SUSE's special 'gpt_sync_mbr'
and SLES12-SP1 default btrfs and xfs for /home that

rear -d -D mkbackup

and

rear -d -D recover

still "just work" for me.

jsmeix commented at 2015-11-25 12:56:

This particular pull request is done (i.e. "fixed").


[Export of Github issue for rear/rear.]