diff --git a/Scripts/Bash/Functions/Commons/cli_getFilesList.sh b/Scripts/Bash/Functions/Commons/cli_getFilesList.sh index 12f1117..f2eccae 100755 --- a/Scripts/Bash/Functions/Commons/cli_getFilesList.sh +++ b/Scripts/Bash/Functions/Commons/cli_getFilesList.sh @@ -1,7 +1,9 @@ #!/bin/bash # -# cli_getFilesList.sh -- This function outputs a sorted and unique -# list of files to process. +# cli_getFilesList.sh -- This function standardizes the way list of +# files are built inside centos-art.sh script. This function outputs a +# sorted and unique list of files based on the options and locations +# passed as argument. # # Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project # @@ -99,19 +101,20 @@ function cli_getFilesList { # expressions with find, regular expressions are evaluated against # the whole file path. This way, when the regular expression is # specified, we need to build it in a way that matches the whole - # path. Doing so, everytime we pass the `--filter' option in the - # command-line could be a tedious task. Instead, in the sake of - # reducing some typing, we prepare the regular expression here to - # match the whole path using the regular expression provided by - # the user as pattern. Do not use LOCATION variable as part of - # regular expresion so it could be possible to use path expansion. - # Using path expansion reduce the amount of places to find out - # things and so the time required to finish the task. - PATTERN="^.*${PATTERN}$" + # path we are using. Doing so, every time we pass the `--filter' + # option in the command-line could be a tedious task. Instead, in + # the sake of reducing some typing, we prepare the regular + # expression here to match the whole path using the regular + # expression provided by the user as pattern. Do not use LOCATION + # variable as part of regular expression so it could be possible + # to use path expansion. Using path expansion reduce the amount + # of places to find out things and so the time required to finish + # the task. + PATTERN="^/.*${PATTERN}$" # Define list of files to process. At this point we cannot verify # whether the LOCATION is a directory or a file since path - # expansion coul be introduced to it. The best we can do is + # expansion could be introduced to it. The best we can do is # verifying exit status and go on. find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq