Correctly get the age of tarballs through their symlink

find throws an error if the PATH_LIST references a tarball
under stx/downloads, which is a symlink to the tarballs
real location under the stx-tools.

Modify the find command to follow the symlink.

Closes-Bug: 1908570
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: Ia691c211715d561b3a4ffca6c4408927aa1e48e8
This commit is contained in:
Scott Little 2020-12-17 13:55:52 -05:00
parent 35163e6b3a
commit 357abccddc
2 changed files with 4 additions and 4 deletions

View File

@ -787,7 +787,7 @@ build_dir_srpm () {
if [ "x$PATH_LIST" == "x" ]; then
echo "0"
else
AGE2=$(find $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
AGE2=$(find -L $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
echo "$AGE2"
fi
)
@ -1138,7 +1138,7 @@ build_dir_spec () {
if [ "x$PATH_LIST" == "x" ]; then
echo "0"
else
AGE2=$(find $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
AGE2=$(find -L $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
echo "$AGE2"
fi
)

View File

@ -765,7 +765,7 @@ build_dir_srpm () {
if [ "x$PATH_LIST" == "x" ]; then
echo "0"
else
AGE2=$(find $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
AGE2=$(find -L $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
echo "$AGE2"
fi
)
@ -1115,7 +1115,7 @@ build_dir_spec () {
if [ "x$PATH_LIST" == "x" ]; then
echo "0"
else
AGE2=$(find $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
AGE2=$(find -L $PATH_LIST -type f -exec stat --format '%Y' "{}" \; | grep -v '[/][.]git$' | grep -v '[/][.]git[/]' | sort -nr | head -n 1)
echo "$AGE2"
fi
)