Hopefully this message will come through. I haven't been able to send messages to this list in the past. I've been using something pretty similar for my build eclipse plugin scripts in AUR and it's been pretty handy, although some of them need a little tweaking.
/ syntax is actually for replacement. The syntax above says "replace
with nothing". The # and % syntax is for deletion (matching from the front or back of the word, respectively). I doubt there's any real difference as far as performance goes.
Yeah, I could only see it making a difference if the feature's name contains '.jar' before the end: ie: $ FILE=mycool.jar.feature.jar $ echo ${FILE/.jar} mycool.feature*.jar* $ echo ${FILE%*.jar} mycool*.jar*.feature Using jar to decompress the archive is a great idea. Also, one thing that popped out at me is in the line:
find features -type f -name *.jar | while read feature ; do
I believe in this line, the variable '*feature*' doesn't get its own namespace, so you may want to change it to from '*feature*' to '*_feature*'.
You might also want to go with: find plugins -type f -name *.jar | while read _file; do install -Dm644 "$_file" "$_dest" done rather than
find plugins -type f -exec install -Dm644 {} ${_dest}/{} \;
in case any of the plugin names have special characters them. I've run into a couple of plugins where this was needed. If I understand correctly, it's also better to use install than cp, perhaps in case the permissions are strang on the archive (I've downloaded some tarballs where all the files were set to 777).
Cheers, Jonathan Wiersma