comparison install-static @ 51:caed7c5e8318 draft

Another bug fix.
author David Barts <n5jrn@me.com>
date Thu, 30 May 2019 22:02:02 -0700
parents ccd52fb45cff
children 243603aaab7e
comparison
equal deleted inserted replaced
50:ccd52fb45cff 51:caed7c5e8318
23 sys.stderr.write( 23 sys.stderr.write(
24 "{0}: {1!r} - no such directory\n".format(MYNAME, d)) 24 "{0}: {1!r} - no such directory\n".format(MYNAME, d))
25 sys.exit(2) 25 sys.exit(2)
26 26
27 def copydir(source, target, exclude=True): 27 def copydir(source, target, exclude=True):
28 global args
29 for entry in os.listdir(source): 28 for entry in os.listdir(source):
30 if exclude and entry == WINF: 29 if exclude and entry == WINF:
31 continue 30 continue
32 if entry.startswith(".") or os.path.splitext(entry)[1] in NOT_STATIC: 31 if entry.startswith(".") or os.path.splitext(entry)[1] in NOT_STATIC:
33 continue 32 continue
48 shutil.move(spath, tpath) 47 shutil.move(spath, tpath)
49 else: 48 else:
50 print("cp", repr(spath), repr(tpath)) 49 print("cp", repr(spath), repr(tpath))
51 copyfile(spath, tpath) 50 copyfile(spath, tpath)
52 elif S_ISDIR(stype): 51 elif S_ISDIR(stype):
53 if ttype is not None and not S_ISDIR(ttype): 52 if ttype is not None:
54 sys.stderr.write( 53 if not S_ISDIR(ttype):
55 "{0}: {1!r} not a directory\n".format(MYNAME, tpath)) 54 sys.stderr.write(
56 sys.exit(1) 55 "{0}: {1!r} not a directory\n".format(MYNAME, tpath))
57 if not S_ISDIR(ttype): 56 sys.exit(1)
57 else:
58 print("mkdir", repr(tpath)) 58 print("mkdir", repr(tpath))
59 os.mkdir(tpath) 59 os.mkdir(tpath)
60 copydir(spath, tpath, False) 60 copydir(spath, tpath, False)
61 else: 61 else:
62 sys.stderr.write( 62 sys.stderr.write(