should be chmod +x not chown +x
rather than world writable files, chown to $user.
no need to use install command for copying individual files
rework the main sources/setup menus so that the control for the menus is configured in retropie_packages. This allows for considerable
de-duplication, and new packages can be added without having to manually add menu entries for them.

retropie_setup.sh calls retropie_packages with the parameter init, to load the arrays with the package information. this will also
allow some de-duplication of start up code between these two scripts later.

the rp_registerFunction now takes an additional parameter after the description which is in the format

I+command

where I= the menu you want it to appear in (2=source menu, 3=setup menu)
+ or - says whether the item will be enabled or disabled by default (for the source menus which uses checkboxes)
command is optional and sets the default command to pass to retropie_packages when building. for example in the setup menu
some options use "configure".

you can add multiple menu entries. eg for SNESDev to appear in the sources menu as well as setup menu, you could use

"2+ 3+configure"

in the sources menu it would download/build/install and in the setup menu it would just configure

the next step with this could besplit/separate out the packages to their own modules and have them dynamically included, so it is even easier to add new items without
having to edit the large cumbersome rp_registerFunction list
fix menu on/off processing (don't overwrite menu variable)
cosmetic - indentation fix
Merge branch 'master' into fixes
use mkdir -p for rom dirs to not throw error if they exist
do not remove git checkout of gngeo before build.
no need for host/target options
don't delete / re-clone each time
use mkdir -p in mame4all Makefile to avoid directory creation errors (at least when building with -jX)
missing slash in python code - this needs a rewrite to use python mkdir and os.path.join etc.
Merge pull request #370 from joolswills/fixes

Fixes
changed addLineToFile() to add a newline if the file does not end with one. fixes #372
single rom share for samba, and remove old configs
readonly/public are inverted synonyms for writable / guest ok so no need for both
_EOF_ for consistency
no need for the chmods for samba config
more sensible samba directory/file masks
directory permissions for rom directories to protect them from deletion, yet allow pi user to write to them
file/directory masks were the wrong way round. oops.