[PATCH conductor] Add test for file exists before copy in aeolus-configure.spec.in
Jason Guiditta
jguiditt at redhat.com
Tue Feb 21 21:01:45 UTC 2012
On 21/02/12 13:09 -0600, Steve Linabery wrote:
>We previously added an empty directory at config/locales/overrides which
>caused the existing file copying to fail when no config/locales/overrides/*.yml
>was present. This fix tests to see if a file is present before attempting to copy.
>---
> aeolus-conductor.spec.in | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
>diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
>index c899190..eb19c82 100644
>--- a/aeolus-conductor.spec.in
>+++ b/aeolus-conductor.spec.in
>@@ -178,7 +178,9 @@ for filetype in builder css feature gif haml html ico jpg js json key opts png \
>
> for dir in $dirs; do
> %{__mkdir} -p %{buildroot}%{app_root}/$dir
>- %{__cp} src/$dir/*.$filetype %{buildroot}%{app_root}/$dir
>+ for i in $(echo src/$dir/*.$filetype); do
>+ test -e "$i" && %{__cp} $i %{buildroot}%{app_root}/$dir
>+ done
> done
> done
> %{__rm} %{buildroot}%{app_root}/config/initializers/secret_token.rb
>--
>1.7.6.5
>
ACK, this works as expected with no files in th eoverrides dir, and
copies over yml files if they do exist. Thanks for tweaking this so
it works in both cases.
-j
More information about the aeolus-devel
mailing list