The getpwnam() function returns NULL if a user is not found in /etc/password, but errno will not be set. In this case nil is returned, and an exception is thrown. The patch adds handling for this edge case. A warning will be printed that ownership can not be changed for the build directory, as this is not a fatal error.
Removes superfluous/unused argument to trans_prepare().
Bug was reported by karol on the BBS: https://bbs.archlinux.org/viewtopic.php?pid=926534#p926534
Fixes a small typo that would be bad if makepkg options were implemented... Simplifies error handling and removes extra error reporting when makepkg fails. Clyde returns the same error code makepkg does on failure.
If we are root, chown the source package tarball and the directory we extract from it to the builduser.
Creates chown() inside util. getpwnam(), mkdir() inside utilcore. Factors out string to mode_t mask conversion with lua_tomode() in utilcore. Rewrite mkdir(). getpwnam() is used to set the proper user group when chmod-ing directories. The builddir will be created when it doesn't exist. Found a nasty typo/bug in make_builddir() inside aur. I found that lfs.mkdir does not honor umask and sets the permissions to 775 for every directory it creates... lame.
The config file was bugging me because it had lines longer than 80 chars. It is (slightly) prettier now. I also fixed a typo where I put in the wrong BuildDir. I think I was planning to move it or something I forget WTF I was thinking.