Show
Ignore:
Timestamp:
08/20/07 14:31:10 (6 years ago)
Author:
boltrix
Message:

Now setup will set permission to every file installed, except the umit script, which distutils already take care of. The system wide umask didn't work.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/install_scripts/unix/setup.py

    r1453 r1458  
    1919 
    2020import os 
     21import os.path 
    2122import re 
    2223 
     
    2627 
    2728from glob import glob 
    28 from stat import ST_MODE 
     29from stat import ST_MODE, S_IRWXU, S_IRGRP, S_IROTH 
    2930 
    3031 
    3132VERSION = "0.9.4" 
    32 REVISION = "1451" 
     33REVISION = "1453" 
    3334 
    3435# Directories for POSIX operating systems 
     
    9899class umit_install(install): 
    99100    def run(self): 
    100         old_umask = os.umask(0022) 
    101         print ">>> Old system umask:", old_umask 
    102  
    103101        install.run(self) 
    104102 
     103        self.set_perms() 
    105104        self.fix_paths() 
    106105        self.create_uninstaller() 
     
    141140        mode = ((os.stat(uninstaller_filename)[ST_MODE]) | 0555) & 07777 
    142141        os.chmod(uninstaller_filename, mode) 
     142 
     143    def set_perms(self): 
     144        re_bin = re.compile("(bin)") 
     145        for output in self.get_outputs(): 
     146            print ">>> bin:", re_bin.findall(output) 
     147            if re_bin.findall(output): 
     148                continue 
     149 
     150            if os.path.isdir(output): 
     151                os.chmod(output, S_IRWXU | \ 
     152                                 S_IRGRP | \ 
     153                                 S_IXGRP | \ 
     154                                 S_IROTH | \ 
     155                                 S_IXOTH) 
     156            else: 
     157                os.chmod(output, S_IRWXU | \ 
     158                                 S_IRGRP | \ 
     159                                 S_IROTH) 
     160 
    143161 
    144162    def fix_paths(self):