Merge lp:~posulliv/mysql-sandbox/make-source-issue into lp:mysql-sandbox

Proposed by Padraig O'Sullivan
Status: Needs review
Proposed branch: lp:~posulliv/mysql-sandbox/make-source-issue
Merge into: lp:mysql-sandbox
Diff against target: 13 lines (+2/-1)
1 file modified
bin/make_sandbox_from_source (+2/-1)
To merge this branch: bzr merge lp:~posulliv/mysql-sandbox/make-source-issue
Reviewer Review Type Date Requested Status
Giuseppe Maxia Disapprove
Review via email:
To post a comment you must log in.
Revision history for this message
Padraig O'Sullivan (posulliv) wrote :

I was trying to create a sandbox from a 5.1 source tree and ran in to some issues with the parsing of the file. It has a different format in 5.1 source trees.

This is my primitive and trivial fix as in it works for me. Thought I'd propose it for merging just in case it might prove useful.


Revision history for this message
Giuseppe Maxia (giuseppe-maxia) wrote :

Fixed in 3.0.08. (rev 36)
I used a slightly different change to get to make the regex more robust.

    while (my $line = <$CONFIG>) {
        if ($line =~ /
                    AC_INIT) # either of these macros
                    \D+ # followed by one or more non digit
                    (?:(?i)mysql) # followed by "mysql" in any case
                    \D+ # followed by one or more non digit
                    (\d\.\d.\d+) # capture the version
                    /x) {
            $version = $1;

So, I disapprove your change (because I fixed it otherwise), but I warmly thank you for noticing it!

review: Disapprove
Revision history for this message
Padraig O'Sullivan (posulliv) wrote :

Cool! Thanks for looking at it. I am very unfamiliar with Perl so I figured my fix was a little bit primitive. Thank you for making it more robust and now I learned a little bit of Perl :)

Unmerged revisions

34. By Padraig O'Sullivan

Corrected issue with creating sandbox from 5.1 source trees.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/make_sandbox_from_source'
2--- bin/make_sandbox_from_source 2010-01-03 22:12:45 +0000
3+++ bin/make_sandbox_from_source 2010-02-16 22:17:12 +0000
4@@ -134,7 +134,8 @@
5 or die "can't find\n";
6 my $version;
7 while (my $line = <$CONFIG>) {
8- if ($line =~ /AM_INIT_AUTOMAKE\D+(\d\.\d.\d+)/) {
9+ if ($line =~ /AM_INIT_AUTOMAKE\D+(\d\.\d.\d+)/ ||
10+ $line =~ /AC_INIT\D+(\d\.\d.\d+)/) {
11 $version = $1;
12 last;
13 }


People subscribed via source and target branches