ninjudd/drip

Warning when using drip through cron

mclang opened this issue · 7 comments

I run one clojure app using drip and cron with following crontab line:
/usr/local/bin/drip -jar clojure-app-standalone.jar >> /var/log/scripts/clojure-app.log 2>&1

This produces following warning in the log:
expr: warning: unportable BRE: ^Main-Class: \\([^[:space:]]*\\)': using^' as the first character of the basic regular expression is not portable; it is being ignored

Problem seems to be this line in drip's 'jar_main_class' function:
local main_class=$(expr -- "$line" : '^Main-Class: ([^[:space:]]*)')

I'm not competent enough with bash regex things that I'd know how to fix this and submit a patch...

If you want to do some experimenting with a fix, I'm happy to accept a patch.

This is probably a good starting place:

On Mon, Aug 26, 2013 at 1:05 AM, mclang notifications@github.com wrote:

I run one clojure app using drip and cron with following crontab line:
/usr/local/bin/drip -jar clojure-app-standalone.jar >> /var/log/scripts/clojure-app.log 2>&1
This produces following warning in the log:
expr: warning: unportable BRE: ^Main-Class: \\([^[:space:]]*\\)': using^' as the first character of the basic regular expression is not portable; it is being ignored
Problem seems to be this line in drip's 'jar_main_class' function:
local main_class=$(expr -- "$line" : '^Main-Class: ([^[:space:]]*)')

I'm not competent enough with bash regex things that I'd know how to fix this and submit a patch...

Reply to this email directly or view it on GitHub:
https://github.com/flatland/drip/issues/70

Okay, I read that.

But I think the reason for the warning is best explained here:
http://www.cygwin.com/ml/cygwin/2000-11/msg00395.html

My server's (CentOS) 'man expr' doesn't give same information, but this agrees:
http://ss64.com/bash/expr.html

So I changed the 'expr' line in drip:
local main_class=$(expr -- "$line" : 'Main-Class: ([^[:space:]]*)')

My clojure app seems to run ok after that change.

Great. So do you have a general fix you can submit as a pull request?

On Tue, Aug 27, 2013 at 2:48 AM, mclang notifications@github.com wrote:

Okay, I read that.
But I think the reason for the warning is best explained here:
http://www.cygwin.com/ml/cygwin/2000-11/msg00395.html
My server's (CentOS) 'man expr' doesn't give same information, but this agrees:
http://ss64.com/bash/expr.html
So I changed the 'expr' line in drip:
local main_class=$(expr -- "$line" : 'Main-Class: ([^[:space:]]*)')

My clojure app seems to run ok after that change.

Reply to this email directly or view it on GitHub:
https://github.com/flatland/drip/issues/70#issuecomment-23324342

Not yet

I haven't used git before, so I must check some fork/clone/commit/pull request tutorial. Can't be too difficult, so maybe I do that pull request today evening or tomorrow.

I wonder if that went alright...
Little bit difficult to grasp the git way of doing things after years of svn usage.

This can be closed, right @ninjudd? #71 looks like the fix.