Fix handling of dat files
Description of bug
*.dat
files have to live in the top-level jO directory (same level as the top-level jO) however this was not treated correctly in the most generic case.
Consider the following cases:
-
testLuigi/Cards/param_card_SM_SVT_leplep.dat
: Should be skipped -
testLuigi/param_card_SM_SVT_leplep.dat
: Should be added -
100xxx/100001/Cards/param_card_SM_SVT_leplep.dat
: Should be skipped -
100xxx/100001/param_card_SM_SVT_leplep.dat
: Should be added
The bug is that the condition !($name =~ $naming/.*/.*\.dat))
evaluates to false when you have something like 100xxx/100001/param_card_SM_SVT_leplep.dat
which should be accepted
Changes introduced
Tests
Test with arbitrary directory name
./scripts/commit_new_dsid.sh --dry-run -m="test" testLuigi
...
Will now add files to git commit
File: testLuigi/Cards/Cards2/param.dat cannot be added to the commit. Skipping.
File: testLuigi/Cards/param_card_SM_SVT_leplep.dat cannot be added to the commit. Skipping.
Will add: testLuigi/MadGraphControl_Py8EG_SVT_RPVleplep.py
File: testLuigi/log.generate cannot be added to the commit. Skipping.
Will add: testLuigi/log.generate.short
Will add: testLuigi/mc.MGPy8EG_A14NNPDF23LO_SVT_emu_m500.py
Will add: testLuigi/param_card_SM_SVT_leplep.dat
As expected
Test with dummy DSID directory
./scripts/commit_new_dsid.sh --dry-run -m="test" -d=100001
...
Will now add files to git commit
File: 100xxx/100001/Cards/Cards2/param.dat cannot be added to the commit. Skipping.
File: 100xxx/100001/Cards/param_card_SM_SVT_leplep.dat cannot be added to the commit. Skipping.
Will add: 100xxx/100001/MadGraphControl_Py8EG_SVT_RPVleplep.py
File: 100xxx/100001/log.generate cannot be added to the commit. Skipping.
Will add: 100xxx/100001/log.generate.short
Will add: 100xxx/100001/mc.MGPy8EG_A14NNPDF23LO_SVT_emu_m500.py
Will add: 100xxx/100001/param_card_SM_SVT_leplep.dat
As expected
Issues resolved
Closes #
Edited by Spyros Argyropoulos