Here there is the fixed code of the script: http://pastebin.com/s5L18PEJ in particular, updated an old package name, and fixed folder problems that occurred if the script where launched without -b option, or if a problem with git occurred.