Would it be easier to use the urlparse module in the stdlib? You could
extract the path component that urlparse.urlparse returns and then run
basename on that.

Well, I guess it's not really any easier, but it seems a bit more reliable
to just lean on the url parsing work that's already gone into the standard
lib.

-- John

On Fri, Mar 26, 2010 at 4:26 AM, Jean Parpaillon <
[email protected]> wrote:

> Fix when url for retrieving kernel contains ';' character, which leads to
>  broken tarball name. We can, for instance use snapshot from gitweb.
>
> ---
>  client/bin/kernel.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/bin/kernel.py b/client/bin/kernel.py
> index e7d18c4..52f6b12 100644
> --- a/client/bin/kernel.py
> +++ b/client/bin/kernel.py
> @@ -228,7 +228,7 @@ class base_kernel(object):
>         else:
>             os.chdir(os.path.dirname(self.src_dir))
>             # Figure out local destination for tarball
> -            tarball = os.path.join(self.src_dir,
> os.path.basename(base_tree))
> +            tarball = os.path.join(self.src_dir,
> os.path.basename(base_tree.split(';')[0]))
>             utils.get_file(base_tree, tarball)
>             print 'Extracting kernel tarball:', tarball, '...'
>             utils.extract_tarball_to_dir(tarball, self.build_dir)
> --
> 1.7.0
>
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to