Changes in tools/dest_build.py [0a0b3d8:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dest_build.py
r0a0b3d8 ra35b458 42 42 def duplicate_tree(src_path, dest_path, current): 43 43 "Duplicate source directory tree in the destination path" 44 44 45 45 for name in os.listdir(os.path.join(src_path, current)): 46 46 if name in exclude_names: 47 47 next 48 48 49 49 following = os.path.join(current, name) 50 50 src = os.path.join(src_path, following) … … 52 52 dest_parent = os.path.join(dest_path, current) 53 53 dest_stat = os.stat(src) 54 54 55 55 # Create shadow directories 56 56 if stat.S_ISDIR(dest_stat.st_mode): 57 57 if not os.path.exists(dest): 58 58 os.mkdir(dest) 59 59 60 60 if not os.path.isdir(dest): 61 61 raise IOError(errno.ENOTDIR, "Destination path exists, but is not a directory", dest) 62 62 63 63 duplicate_tree(src_path, dest_path, following) 64 64 else: 65 65 # Compute the relative path from destination to source 66 66 relative = os.path.relpath(src, dest_parent) 67 67 68 68 # Create symlink 69 69 if not os.path.exists(dest): … … 78 78 usage(sys.argv[0]) 79 79 return 1 80 80 81 81 # Source tree path 82 82 src_path = os.path.abspath(sys.argv[1]) … … 84 84 print("<SRC_PATH> must be a directory") 85 85 return 2 86 86 87 87 # Destination tree path 88 88 dest_path = os.path.abspath(sys.argv[2]) 89 89 if not os.path.exists(dest_path): 90 90 os.mkdir(dest_path) 91 91 92 92 if not os.path.isdir(dest_path): 93 93 print("<DEST_PATH> must be a directory") 94 94 return 3 95 95 96 96 # Duplicate source directory tree 97 97 duplicate_tree(src_path, dest_path, "") 98 98 99 99 # Run the build from the destination tree 100 100 os.chdir(dest_path) 101 101 args = ["make"] 102 102 args.extend(sys.argv[3:]) 103 103 104 104 return subprocess.Popen(args).wait() 105 105
Note:
See TracChangeset
for help on using the changeset viewer.