Oh, Lucas
First, thanks.
I think we can do this to change the args of the func  
update_version(srcdir, preserve_srcdir, new_version, install,
                   *args, **dargs),
the preserve_srcdir used to keep the src dir no to be removed, because
it is in the bindir and just one copy , but now the source dir has copy
to the tmp/<testname>/src, and remove srcdir( actually the
tmp/<testname>/src) can be done. So we can consider to change it to the
bindir so that we can fix it more simple.
And I hope I can do this things with your help.
Is that OK? 
在 2012-08-10五的 15:07 -0300,Lucas Meneghel Rodrigues写道:
> 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
> >
> 
> 
> 


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

Reply via email to