I had some problems in the past with android-sdk on Gentoo. I messed around with permissions and that was awful. I've just reinstalled it from scratch, and I'm currently downloading some SDK platforms. The first time (since the new installation) I updated my android-related packages, I've installed the SDK Tools, the SDK platform-tools and some SDK platforms. The second time, which is still in my screen, I tried to install SDK Tools rev 11 (seemed like an update to the first one installed, or maybe the first one crashed and I didn't see) and some other platforms, but the SDK Tools rev 11 failed with message: Downloading Android SDK Tools, revision 11 Installing Android SDK Tools, revision 11 Failed to rename directory /opt/android-sdk-update-manager/tools to /opt/android-sdk-update-manager/temp/ToolPackage.old01. Failed to create directory /opt/android-sdk-update-manager/tools Downloading SDK Platform Android 2.3.3, API 10, revision 1 ... My permissions: $ ls -ld /opt/android-sdk-update-manager drwxrwxr-x 9 root android 9 Mai 31 10:13 /opt/android-sdk-update-manager $ ls -l /opt/android-sdk-update-manager total 6 drwxrwxr-x 4 root android 4 Mai 31 10:15 add-ons drwxr-xr-x 15 spidey spidey 28 Mai 31 10:11 docs drwxr-xr-x 4 spidey spidey 4 Mai 31 10:13 extras drwxrwxr-x 7 root android 7 Mai 31 10:23 platforms drwxr-xr-x 3 spidey spidey 11 Mai 31 10:10 platform-tools drwxrwxr-x 2 root android 3 Mai 31 10:23 temp drwxr-xr-x 5 root root 22 Mai 31 10:07 tools My groups $ groups wheel audio video users android portage spidey plugdev Apparently, I have the right permissions, I'm in android group, and the android-sdk-update-manager folder has rwx for group android. But the inner folders, like tools, don't, specially the tools folder, that in my opinion should be owned by android, not by root. Maybe the tools folder is created by the sdk-manager itself (I've read something about this), and then the problem is caused by upstream. If that's the case, what about making a fix-android-sdk-permissions.sh and wrapping the 'android' binary in a script that would call fix-android-sdk-permissions.sh after the real 'android' command. Of course, the user would still need to close and re-open the sdk update manager after installing a new sdk tools.
Ok, I committed -r1 which should fix the immediate problem, although you probably will need to wipe out your /opt/android-sdk-update-manager to have the changes take effect. Another issue I spotted is that the SDK updater itself tends to install a lot of stuff under the account it is invoked from, which means that if you try to run it from another account you're going to have the same kinds of issues. I can't really do anything about that easily.
Thank you. I've seen this behavior in someone else's ls -l screen cap. I've opened a bug upstream too, still waiting for reply or acknowledgement. Thank you for your fast reply/fix. I'll look at the new ebuild to figure out what you did to try learning something new, maybe in the future I could help fixing similar bugs. Thanks again.