Mercurial > cgi-bin > hgweb.cgi > tincan
comparison install-static @ 59:60907204a265 draft
Support case-insensitive filesystems properly.
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 31 May 2019 21:20:22 -0700 |
parents | 243603aaab7e |
children |
comparison
equal
deleted
inserted
replaced
58:e08e24707da1 | 59:60907204a265 |
---|---|
6 | 6 |
7 import os, sys | 7 import os, sys |
8 from argparse import ArgumentParser | 8 from argparse import ArgumentParser |
9 import shutil | 9 import shutil |
10 from stat import S_ISDIR, S_ISREG | 10 from stat import S_ISDIR, S_ISREG |
11 from tincan import _casef | |
11 | 12 |
12 # V a r i a b l e s | 13 # V a r i a b l e s |
13 | 14 |
14 NOT_STATIC = set([".pspx", ".pt", ".py", ".pyc"]) | 15 NOT_STATIC = set([".pspx", ".pt", ".py", ".pyc"]) |
15 MYNAME = os.path.basename(sys.argv[0]) | 16 MYNAME = os.path.basename(sys.argv[0]) |
24 "{0}: {1!r} - no such directory\n".format(MYNAME, d)) | 25 "{0}: {1!r} - no such directory\n".format(MYNAME, d)) |
25 sys.exit(2) | 26 sys.exit(2) |
26 | 27 |
27 def copydir(source, target, exclude=True): | 28 def copydir(source, target, exclude=True): |
28 for entry in os.listdir(source): | 29 for entry in os.listdir(source): |
29 if exclude and entry == WINF: | 30 if exclude and _casef(entry, "upper") == WINF: |
30 continue | 31 continue |
31 if entry.startswith(".") or os.path.splitext(entry)[1] in NOT_STATIC: | 32 if entry.startswith(".") or _casef(os.path.splitext(entry)[1]) in NOT_STATIC: |
32 continue | 33 continue |
33 spath = os.path.join(source, entry) | 34 spath = os.path.join(source, entry) |
34 tpath = os.path.join(target, entry) | 35 tpath = os.path.join(target, entry) |
35 stype = os.stat(spath).st_mode | 36 stype = os.stat(spath).st_mode |
36 try: | 37 try: |