ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/build_utils/install.py
(Generate patch)

Comparing ray/build_utils/install.py (file contents):
Revision 1.5 by schorsch, Tue Apr 19 21:21:23 2016 UTC vs.
Revision 1.6 by schorsch, Mon Jan 8 13:38:37 2018 UTC

# Line 1 | Line 1
1 + from __future__ import division, print_function, unicode_literals
2  
3   import os
4 + import stat
5  
6 < def install_dir(env, il, sbase, tbase, dir):
7 <        fulldir = os.path.join(sbase, dir)
6 > def install_dir(env, instlist, sbase, tbase, subdir):
7 >        fulldir = os.path.join(sbase, subdir)
8          l = os.listdir(fulldir)
9 <        instdir = os.path.join(tbase, dir)
9 >        instdir = os.path.join(tbase, subdir)
10          for item in l:
11 <                if item[0] == '.' or item[-1] in '%~' or item == 'CVS':
11 >                if (item[0] == '.'
12 >                        or item[-1] in '%~'
13 >                        or item == 'CVS'
14 >                        or item.lower().startswith('cmake')):
15                          continue
16                  elif os.path.isdir(os.path.join(fulldir, item)):
17 <                        install_dir(env, il, sbase, tbase, os.path.join(dir, item))
17 >                        install_dir(env, instlist, sbase, tbase, os.path.join(subdir, item))
18                  else:
19                          inst = env.Install(instdir, os.path.join(fulldir, item))
20 <                        il.append(inst)
20 >                        instlist.append(inst)
21  
22   def install_rlibfiles(env):
23          buildrlib = env['RAD_BUILDRLIB']
24          if buildrlib[0] == '#':
25                  buildrlib = buildrlib[1:]
26          sbase = os.path.join(os.getcwd(), buildrlib)
27 <        il = []
28 <        install_dir(env, il, sbase, env['RAD_RLIBDIR'], '')
29 <        env.Append(RAD_RLIBINSTALL=il)
27 >        instlist = []
28 >        install_dir(env, instlist, sbase, env['RAD_RLIBDIR'], '')
29 >        env.Append(RAD_RLIBINSTALL=instlist)
30  
31  
32   def install_manfiles(env):
# Line 35 | Line 40 | def install_manfiles(env):
40  
41  
42   def install_script(target, source, env):
43 <        for t,s in map(None,target,source):
43 >        #for t,s in map(None,target,source):
44 >        for t,s in zip(target, source):
45                  sf = open(str(s), 'r')
46                  tf = open(str(t), 'w')
47                  tf.write(sf.read())
48 <                os.chmod(str(t), 00755)
48 >                os.chmod(str(t),
49 >                                stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
50 >                                stat.S_IRGRP | stat.S_IWGRP |
51 >                                stat.S_IROTH | stat.S_IWOTH)
52  
53   def install_tclscript(target, source, env):
54          # XXX posix only for the moment
55 <        for t,s in map(None, target,source):
55 >        #for t,s in map(None, target,source):
56 >        for t,s in zip(target, source):
57                  bindir = os.path.split(t.get_abspath())[0]
58                  instdir = os.path.split(bindir)[0]
59                  tcllibdir = os.path.join(instdir, 'lib', 'tcl')
# Line 58 | Line 68 | def install_tclscript(target, source, env):
68                                  # XXX this should really be handled by an envvar.
69                                  line = 'set radlib %s\n' % tcllibdir
70                          tf.write(line)
71 <                os.chmod(str(t), 00755)
71 >                os.chmod(str(t),
72 >                                stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
73 >                                stat.S_IRGRP | stat.S_IWGRP |
74 >                                stat.S_IROTH | stat.S_IWOTH)
75  
76   def build_with_pyinstaller(targets, sources, env):
77          workpath = env.Dir('$RAD_BUILDOBJ', 'pybuild') # --workpath @
# Line 66 | Line 79 | def build_with_pyinstaller(targets, sources, env):
79          # -F   # one-file
80          # --noconsole
81          pass
82 +
83 + # vi: set ts=4 sw=4 :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines