You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whirr.apache.org by "Stu Hood (JIRA)" <ji...@apache.org> on 2010/12/09 23:02:00 UTC

[jira] Created: (WHIRR-156) Cli script doesn't launch post-modularization

Cli script doesn't launch post-modularization
---------------------------------------------

                 Key: WHIRR-156
                 URL: https://issues.apache.org/jira/browse/WHIRR-156
             Project: Whirr
          Issue Type: Bug
          Components: cli
    Affects Versions: 0.3.0
            Reporter: Stu Hood


bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
{code}-java -jar $bin/../whirr-cli-*.jar "$@"
+java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated WHIRR-156:
----------------------------

    Attachment: WHIRR-156.patch

Here's the simpler version, which I plan commit unless there's any objection.

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969993#action_12969993 ] 

Tom White commented on WHIRR-156:
---------------------------------

This is set up to work for the binary tarball, since the CLI JAR is copied to the top-level in that case. However, it would be good to make the script work when launched from a svn/git working tree. Could we make the script look in each location in turn?

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>    Affects Versions: 0.3.0
>            Reporter: Stu Hood
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972323#action_12972323 ] 

Andrei Savu commented on WHIRR-156:
-----------------------------------

It's your choice. I was just making a suggestion ( I suck at writing bash scripts :) ). I have tested both approaches and they work as expected. 

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated WHIRR-156:
----------------------------

    Attachment: WHIRR-156.patch

Here's a patch to make the script look for the CLI JAR in both places.

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated WHIRR-156:
----------------------------

    Affects Version/s:     (was: 0.3.0)
        Fix Version/s: 0.3.0

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated WHIRR-156:
----------------------------

    Attachment: WHIRR-156.patch

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White resolved WHIRR-156.
-----------------------------

    Resolution: Fixed
      Assignee: Tom White

I've just committed this. 

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>            Assignee: Tom White
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972095#action_12972095 ] 

Andrei Savu commented on WHIRR-156:
-----------------------------------

How about using test and not ls? I haven't tested the updated patch. 

{code}
Index: bin/whirr
===================================================================
--- bin/whirr	(revision 1049657)
+++ bin/whirr	(working copy)
@@ -18,4 +18,14 @@
 bin=`dirname "$0"`
 bin=`cd "$bin"; pwd`
 
-java -jar $bin/../whirr-cli-*.jar "$@"
+release_jar=$bin/../whirr-cli-*.jar
+snapshot_jar=$bin/../cli/target/whirr-cli-*-SNAPSHOT.jar
+
+if [ -f $release_jar ]; then
+  java -jar $release_jar "$@"
+elif [ -f $snapshot_jar ]; then
+  java -jar $snapshot_jar "$@"
+else
+  echo "No CLI JAR found."
+  exit 1
+fi
{code}

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WHIRR-156) Cli script doesn't launch post-modularization

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972232#action_12972232 ] 

Tom White commented on WHIRR-156:
---------------------------------

There's no real difference in this case, since the glob patterns match 0 or 1 files. The ls approach is preferable when there are multiple glob matches. Your code is slightly shorter, so perhaps we can use that?

You can test it by running "bin/whirr" from both a source directory, and from an unpacked tarball built with "mvn package assembly:assembly".

> Cli script doesn't launch post-modularization
> ---------------------------------------------
>
>                 Key: WHIRR-156
>                 URL: https://issues.apache.org/jira/browse/WHIRR-156
>             Project: Whirr
>          Issue Type: Bug
>          Components: cli
>            Reporter: Stu Hood
>             Fix For: 0.3.0
>
>         Attachments: WHIRR-156.patch, WHIRR-156.patch
>
>
> bin/whirr is looking for the cli jar in the wrong location: the following change works, but would not be forwards compatible:
> {code}-java -jar $bin/../whirr-cli-*.jar "$@"
> +java -jar $bin/../cli/target/whirr-cli-*-incubating-SNAPSHOT.jar "$@"{code}
> Note that the naive forwards compatible approach grabs the source jar instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.