For bug #165034, make sure that symlinks are excluded from chmod calls.
authorZac Medico <zmedico@gentoo.org>
Sat, 3 Feb 2007 10:26:08 +0000 (10:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 3 Feb 2007 10:26:08 +0000 (10:26 -0000)
svn path=/main/trunk/; revision=5877

bin/ebuild.sh

index aa3c1281fdb172a217ed48bbcc756c766b758c25..3afa031e24e587140c4f499e1a49fb4f6ac7d14b 100755 (executable)
@@ -456,7 +456,11 @@ unpack() {
        done
        # Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
        # should be preserved.
-       find . -mindepth 1 -print0 | ${XARGS} -0 chmod -f a+rX,u+w,g-w,o-w
+       local myfile
+       find . -mindepth 1 -maxdepth 1 -print0 | while read -d $'\0' myfile; do
+               [ -L "${myfile}" ] && continue # find can't exclude symlinks by itself.
+               chmod -fR a+rX,u+w,g-w,o-w "${myfile}"
+       done
 }
 
 strip_duplicate_slashes() {