Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Devel mailing list

Subject: Re: [MTT devel] [MTT svn] svn:mtt-svn r1262
From: Tim Mattox (timattox_at_[hidden])
Date: 2008-12-05 12:52:08


This worked great for me. Thanks Ethan!

On Fri, Dec 5, 2008 at 11:25 AM, <emallove_at_[hidden]> wrote:
> Author: emallove
> Date: 2008-12-05 11:25:03 EST (Fri, 05 Dec 2008)
> New Revision: 1262
> URL: https://svn.open-mpi.org/trac/mtt/changeset/1262
>
> Log:
> * Tim M discovered a bug in which MTT picks up the wrong version
> string when a user has a scratch dir containing a <name>-<number>
> pattern in it (e.g., {{{--scratch /foo/bar-23}}}). So when getting
> an MPI version string based on the URL basename (<name>-<number>),
> we must remove the {{{cwd}}} portion of the dirname so that we do
> not erroneously get a version string from the user's scratch
> dirname or INI section name.
> * Properly assign the {{{r}}} value getting passed back to the main
> {{{MPI/Get.pm}}}
>
> Text files modified:
> trunk/lib/MTT/Common/SCM.pm | 19 ++++++++++++++++---
> 1 files changed, 16 insertions(+), 3 deletions(-)
>
> Modified: trunk/lib/MTT/Common/SCM.pm
> ==============================================================================
> --- trunk/lib/MTT/Common/SCM.pm (original)
> +++ trunk/lib/MTT/Common/SCM.pm 2008-12-05 11:25:03 EST (Fri, 05 Dec 2008)
> @@ -82,6 +82,14 @@
> $params->{url} =~ s/\/\s*$//;
> my $basename = basename($params->{url});
> $params->{dirname} = "$cwd/$basename";
> +
> + # Remove the cwd portion of the dirname so that we do not erroneously get a
> + # version string from the users scratch dirname or INI section name
> + my $scm_dirname = $params->{dirname};
> + $scm_dirname =~ s/(\/+|\\+)/\//g;
> + $cwd =~ s/(\/+|\\+)/\//g;
> + $scm_dirname =~ s/$cwd//;
> +
> MTT::DoCommand::Cmd(1, "rm -rf $basename")
> if ($params->{delete_first});
>
> @@ -99,15 +107,18 @@
> my $ver;
> if (!defined($ret->{version})) {
> # 2. Try looking for name-<number> in the directory basename
> - if ($ver = &get_version_from_filename($params->{dirname})) {
> + if ($ver = &get_version_from_filename($scm_dirname)) {
> + Debug("Getting version string from name-<number> in the directory basename.\n");
> $ret->{version} = $ver;
> }
> # 3. Use the SVN r number
> elsif (defined($params->{rev})) {
> - $ret->{version} = "r$r";
> + Debug("Getting version string from the SCM r number.\n");
> + $ret->{version} = "r$params->{rev}";
> }
> # Give up
> else {
> + Debug("Couldn't find a decent version string. Using a date string.\n");
> $ret->{version} = "$params->{simple_section}-" .
> strftime("%m%d%Y-%H%M%S", localtime);
> }
> @@ -121,7 +132,7 @@
> $data->{post_copy} = $params->{post_copy};
> $data->{url} = $params->{url};
> $data->{directory} = $params->{dirname};
> - $data->{r} = $r;
> + $data->{r} = $params->{rev};
>
> $ret->{module_data} = $data;
>
> @@ -131,6 +142,7 @@
> }
>
> sub get_version_from_filename {
> + Debug("get_version_from_filename got @_\n");
> my ($fullname) = @_;
>
> my $ret;
> @@ -152,6 +164,7 @@
> $fullname = dirname($fullname);
> }
>
> + Debug("get_version_from_filename returning $ret\n");
> return $ret;
> }
>
> _______________________________________________
> mtt-svn mailing list
> mtt-svn_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn
>

-- 
Tim Mattox, Ph.D. - http://homepage.mac.com/tmattox/
 tmattox_at_[hidden] || timattox_at_[hidden]
    I'm a bright... http://www.the-brights.net/