Lines Matching refs:os
18 import os
22 os.path.dirname(os.path.dirname(os.path.dirname(
23 os.path.abspath(__file__)))))
27 sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "rules"))
96 shutil.copy(source, os.path.join(platform_installed_path, system_path))
109 if not os.path.exists(source):
117 if os.path.isfile(source):
118 dest_dir = os.path.join(platform_installed_path,
119 os.path.dirname(dest))
120 elif os.path.isdir(source):
121 dest_dir = os.path.join(platform_installed_path, dest)
122 if not os.path.exists(dest_dir):
123 os.makedirs(dest_dir, exist_ok=True)
124 if os.path.isdir(source):
126 for filename in os.listdir(source):
129 shutil.copy2(os.path.join(source, filename),
130 os.path.join(platform_installed_path, dest, filename))
132 … shutil.copytree(source, os.path.join(platform_installed_path, dest), dirs_exist_ok=True)
134 shutil.copy2(source, os.path.join(platform_installed_path, dest))
140 symlink_src_file = os.path.basename(dest)
142 symlink_dest_dir = os.path.dirname(dest)
143 symlink_dest_file = os.path.join(platform_installed_path,
145 if not os.path.exists(symlink_dest_file):
146 os.symlink(symlink_src_file, symlink_dest_file)
150 symlink_src_file = os.path.join(platform_installed_path, dest)
152 … symlink_dest_file = os.path.join(platform_installed_path, dest.split('/')[0], name)
153 … relpath = os.path.relpath(os.path.dirname(symlink_src_file), os.path.dirname(symlink_dest_file))
154 if not os.path.exists(os.path.dirname(symlink_dest_file)):
155 os.makedirs(os.path.dirname(symlink_dest_file), exist_ok=True)
156 if not os.path.exists(symlink_dest_file):
157 os.symlink(os.path.join(relpath, os.path.basename(dest)), symlink_dest_file)
160 dest_file = os.path.join(platform_installed_path, dests[0])
161 if os.path.exists(dest_file):
162 os.remove(dest_file)
163 os.symlink(symlink_path, dest_file)
164 if not os.path.lexists(dest_file):
219 if os.path.exists(system_install_base_dir):
222 os.makedirs(system_install_base_dir, exist_ok=True)
224 vendor_install_base_dir = os.path.join(args.platform_installed_path,
226 if os.path.exists(vendor_install_base_dir):
230 eng_system_install_base_dir = os.path.join(args.platform_installed_path,
232 if os.path.exists(eng_system_install_base_dir):
236 eng_chipset_install_base_dir = os.path.join(args.platform_installed_path,
238 if os.path.exists(eng_chipset_install_base_dir):
242 sys_prod_install_base_dir = os.path.join(args.platform_installed_path,
244 if os.path.exists(sys_prod_install_base_dir):
248 chip_prod_install_base_dir = os.path.join(args.platform_installed_path,
250 if os.path.exists(chip_prod_install_base_dir):
254 updater_install_base_dir = os.path.join(args.platform_installed_path,
256 if os.path.exists(updater_install_base_dir):
260 updater_vendor_install_base_dir = os.path.join(args.platform_installed_path,
262 if os.path.exists(updater_vendor_install_base_dir):
266 ramdisk_install_base_dir = os.path.join(args.platform_installed_path,
268 if os.path.exists(ramdisk_install_base_dir):
280 if os.path.exists(args.system_image_zipfile):
281 os.unlink(args.system_image_zipfile)