a) you should not set SRC_URI dynamically b) code that might print stuff to stdout or stderr should under no circumstances be outside of functions c) "if [ `use foo` ]; then" should not be used, please use "if use foo; then" while it might work as it is right now it might break without notice and is generally considered bad practice.
this has all been fixed in 1.3