TT#47563 Use '-uall' for 'git status --porcelain' in scripts/services

There was a fix for the similar issue in Mantis ticket #7577,
see commit fc5af3bbb2 for more details.

Unfortunately one corner case was missing there:
"git status" doesn't show untracked files in untracked folders by default.
It requires "-u" option with value "all":

>> man git status
>  ...
>  -u[<mode>], --untracked-files[=<mode>]
>     Show untracked files.
>
>     The mode parameter is used to specify the handling of untracked files.
>     It is optional: it defaults to all, and if specified,
>     it must be stuck to the option (e.g.  -uno, but not -u no).
>
>     The possible options are:
>       ·   no - Show no untracked files.
>       ·   normal - Shows untracked files and directories.
>       ·   all - Also shows individual files in untracked directories.

The ngcpcfg need to see complete path and filename to untracked file
to properly detect .services files and execute them (if configs were changed):

> root@web01a:/etc# git status
> On branch master
> nothing to commit, working tree clean
> root@web01a:/etc# git status --porcelain | sed 's/^...//'
> root@web01a:/etc# touch test1
> root@web01a:/etc# git status --porcelain | sed 's/^...//'
> test1
> root@web01a:/etc# mkdir test2
> root@web01a:/etc# touch test2/test2_file
> root@web01a:/etc# git status  --porcelain | sed 's/^...//'
> test1
> test2/
> root@web01a:/etc# git status -uall --porcelain | sed 's/^...//'
> test1
> test2/test2_file
> root@web01a:/etc#

Change-Id: I18286fd76c511061159f90e8aa9841a6e98c7199
changes/68/24768/1
Alexander Lutay 8 years ago
parent d37d0e2f92
commit 682b6de677

@ -156,7 +156,7 @@ find_all_changed_services() {
log_debug "${FUNCNAME[0]}(): Working in ${dir}"
pushd "${dir}" >/dev/null
for file in $(git status --porcelain | sed 's/^...//') ; do
for file in $(git status -uall --porcelain | sed 's/^...//') ; do
if [[ -r "${file}" ]] && [[ -r "${SERVICES_POOL_BASE}/${dir}/${file}".services ]]; then
log_debug "Storing ${SERVICES_POOL_BASE}/${dir}/${file}.services in '${TMPFILE}'"
echo "${SERVICES_POOL_BASE}/${dir}/${file}".services

Loading…
Cancel
Save