#792 Issue closed: main gitignore ignoring var directory in skel

Labels: waiting for info, support / question

thefrenchone opened issue at 2016-03-08 17:56:

  • rear version (/usr/sbin/rear -V): 1.17.2 and recent git clone. Both were tested.
  • OS version (cat /etc/rear/os.conf or lsb_release -a): Rhel 6 and 7
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf): N/A

The main .gitignore file has the line "var". This appears to exclude the var directory within the usr/share/rear/skel/default directory from being committed in Git. When making rpm packages the usr/share/rear/skel/default/var directory was being excluded which would then exclude those directories from being created on the rescue ISO.

These directories missing was causing problems. Is there a justification for having the "var" exclude in the .gitignore file?

gdha commented at 2016-03-09 12:40:

The var directory was added by change https://github.com/rear/rear/commit/87ebabba5abe3f1cda4b691564fc5e1ee53985d1 by @schlomo
Probably, when running rear from relative path then the var directory is automatically created and @schlomo wanted to exclude this from the rear archive tar.

schlomo commented at 2016-03-09 18:27:

Yes, this is correct.

Can you please let me know for which purpose you need a var directory within usr/share/rear/skel/default?

thefrenchone commented at 2016-03-09 19:18:

In this Git repo usr/share/rear/skel/default/var contains the directories empty,lib,lock,log,run,tmp then some sub-directories on top of that. Because of the "var" exclude these directories are not committed to git unless they are forced. Then because they never get committed to git they then don't end up in rpm packages. Finally, those folders never get created on the rescue ISO.

I'm only running into this because I have to download the zip folder and then create a git repo locally. These folder are already in the git repository here so if you do a proper git pull you wouldn't run into this issue.

For example /var/run was not being created on the rescue ISO which then resulted in the initramfs scripts failing (iirc).

schlomo commented at 2016-03-09 19:24:

I see. Maybe we change the gitignore entry from var to either /var or add another entry with !/usr/share/rear/skel/default/var to exclude that from the exclusion. However, since maybe others also want to add stuff to var I think that going for /var would be better and more direct.

gdha commented at 2016-03-10 15:26:

@thefrenchone Could you test this and tell us the difference?

thefrenchone commented at 2016-03-10 18:07:

Changing the gitignore to have /var instead of var did include the usr/share/rear/skel/default/var directory in the rpm. This change appears to have the desired result.

I don't really understand the justification for that line.

schlomo commented at 2016-03-10 19:59:

As @gdha wrote already: If you run ReaR from a checkout it will create a var dir there.


[Export of Github issue for rear/rear.]