but that last command makes every single file executable, which is
rather ugly (but doing a selective chmod 0755/0644 is a bit tricky

I was wondering about having every file executable in the source distributions a while back, and came up with an quick way to make it less ugly (inline due to attachment filtering on my end):

##################################
#!/usr/bin/env bash

noexe()
{
        local fn=$1
        local pfx=`echo $fn | cut -c -3`
        #don't mess with mercurial store; adjust as needed for different
        # vcs
        if [ "$pfx" = ".hg" ]; then
                return
        fi

        local ft=`file $fn | grep exe`
        if [ "$ft" = "" ]; then
                #not supposed to be executable, fix it
                chmod -x "$fn"
        fi
}

#using while loop rather than find -exec because -exec doesn't
# recognize bash functions.
find . -type f |while read i; do noexe "$i" ; done
############################################

with all those script files - some need to be executed but others
arent). I don't see a need to have read-only files like all the CIF
dictionaries with permission 0755.


The correct permissions can only be set during packaging
unfortunately.

Cheers

Clemens

Reply via email to