On Thu, Aug 9, 2012 at 2:59 PM, Mike Qiu <[email protected]> wrote:
> Currently, the src dir may be removed when the test version has changed.
> Just to check to make and copy the src if it has been removed.
>
> Signed-off-by: Mike Qiu <[email protected]>
> ---
>  client/shared/base_utils.py |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/client/shared/base_utils.py b/client/shared/base_utils.py
> index 363a6a2..8a6524d 100644
> --- a/client/shared/base_utils.py
> +++ b/client/shared/base_utils.py
> @@ -767,9 +767,17 @@ def update_version(srcdir, preserve_srcdir, new_version, 
> install,
>      if install_needed:
>          if not preserve_srcdir and os.path.exists(srcdir):
>              shutil.rmtree(srcdir)
> +        if not os.path.isdir(srcdir):
> +            source_code_dir = os.path.join(os.path.dirname(
> +                          os.path.dirname(os.path.dirname(srcdir))),
> +                          'tests', os.path.basename(os.path.dirname(srcdir)),
> +                          'src')

^ The constuct above is not nice (a chain of 3 os.path.dirname), and
it's hardcoded (autotest can sometimes be installed on a system wide
install, so this is likely to break things there).

Therefore, NACK on all your 3 patches. I need to think about a better
solution to this.

Thanks,

Lucas

> +            if os.path.isdir(source_code_dir):
> +                shutil.copytree(source_code_dir, srcdir)
> +            else:
> +                os.makedirs(srcdir)
>          install(*args, **dargs)
> -        if os.path.exists(srcdir):
> -            pickle.dump(new_version, open(versionfile, 'w'))
> +        pickle.dump(new_version, open(versionfile, 'w'))
>
>
>  def get_stderr_level(stderr_is_expected):
> --
> 1.7.7.6
>



-- 
Lucas

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to