Lines Matching refs:os
9 import os
55 if os.sep in args.recipename:
58 elif os.path.isdir(args.recipename):
67 if args.srctree and os.path.isfile(args.srctree):
68 args.fetchuri = 'file://' + os.path.abspath(args.srctree)
87 srctree = os.path.abspath(args.srctree)
96 if srctree and os.path.exists(srctree):
98 if not os.path.isdir(srctree):
102 elif os.listdir(srctree):
169 recipes = glob.glob(os.path.join(tempdir, '*.bb'))
171 recipename = os.path.splitext(os.path.basename(recipes[0]))[0].split('_')[0]
174 recipedir = os.path.join(config.workspace_path, 'recipes', recipename)
176 recipefile = os.path.join(recipedir, os.path.basename(recipes[0]))
178 if os.path.exists(appendfile):
181 if os.path.exists(recipefile):
184 srctree = os.path.join(srctreeparent, recipename)
185 if os.path.exists(tmpsrcdir):
186 if os.path.exists(srctree):
187 if os.path.isdir(srctree):
189 os.rmdir(srctree)
204 for fn in os.listdir(tempdir):
205 shutil.move(os.path.join(tempdir, fn), recipedir)
208 …attic_recipe = os.path.join(config.workspace_path, 'attic', recipename, os.path.basename(recipefil…
209 if os.path.exists(attic_recipe):
212 if tmpsrcdir and os.path.exists(tmpsrcdir):
216 for fn in os.listdir(recipedir):
217 _add_md5(config, recipename, os.path.join(recipedir, fn))
238 if os.path.exists(os.path.join(srctree, '.git')):
243 srctree = os.path.join(srctree, args.src_subdir)
245 bb.utils.mkdirhier(os.path.dirname(appendfile))
280 layerconf_file = os.path.join(config.workspace_path, "conf", "layer.conf")
330 relpath = os.path.relpath(dst, base_outdir)
333 dst = os.path.join(dry_run_outdir, relpath)
334 dst_d = os.path.dirname(dst)
340 if not os.path.exists(dst):
351 dst_d = os.path.dirname(dst)
363 dst_d = os.path.dirname(dst)
390 path = os.path.normpath(path)
391 recurse = True if len(path.split(os.path.sep)) > 1 else False
402 for root, dirs, files in os.walk(directory):
403 ret.extend([os.path.relpath(os.path.join(root, fname), directory) for
421 srctree = os.path.abspath(args.srctree)
445 srctree = os.path.abspath(args.srctree)
458 if os.path.abspath(rd.getVar('S')) == os.path.abspath(rd.getVar('WORKDIR')):
461 local_files_dir = os.path.join(srctree, 'oe-local-files')
463 for root, _, files in os.walk(local_files_dir):
464 relpth = os.path.relpath(root, local_files_dir)
466 bb.utils.mkdirhier(os.path.join(srctree, relpth))
470 destpth = os.path.join(srctree, relpth, fn)
471 if os.path.exists(destpth):
472 os.unlink(destpth)
474 back_relpth = os.path.relpath(local_files_dir, root)
475 os.symlink('%s/oe-local-files/%s/%s' % (back_relpth, relpth, fn), destpth)
477 os.symlink('oe-local-files/%s' % fn, destpth)
478 addfiles.append(os.path.join(relpth, fn))
497 if not os.path.exists(srctree):
500 if os.path.exists(srctree):
501 if not os.path.isdir(srctree):
504 elif os.listdir(srctree):
515 os.rmdir(srctree)
561 if os.path.exists(appendfile):
562 appendbackup = os.path.join(tempdir, os.path.basename(appendfile) + '.bak')
566 bb.utils.mkdirhier(os.path.dirname(appendfile))
584 preservestampfile = os.path.join(sstate_manifests, 'preserve-stamps')
609 if os.path.exists(preservestampfile):
610 os.remove(preservestampfile)
617 if os.path.islink(srctree):
618 os.unlink(srctree)
620 os.symlink(workshareddir, srctree)
627 with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
630 with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f:
634 srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir'))
644 if os.path.islink(workshareddir):
645 os.unlink(workshareddir)
647 …if os.path.exists(workshareddir) and (not os.listdir(workshareddir) or kernelVersion != staging_ke…
650 elif not os.path.exists(workshareddir):
653 tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
654 srctree_localdir = os.path.join(srctree, 'oe-local-files')
664 if os.path.exists(srctree_localdir + '.bak'):
667 if os.path.exists(srctree_localdir):
671 if os.path.exists(tempdir_localdir):
676 if os.path.exists(tempdir_localdir):
685 shutil.copy2(os.path.join(tempdir, '.config'), srctree)
690 elif os.path.exists(appendfile):
691 os.remove(appendfile)
704 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a+') as f:
705 md5_str = '%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5)
706 f.seek(0, os.SEEK_SET)
710 if os.path.isdir(filename):
711 for root, _, files in os.walk(filename):
713 addfile(os.path.join(root, f))
721 origfile = os.path.join(config.workspace_path, '.devtool_md5')
722 newfile = os.path.join(config.workspace_path, '.devtool_md5_new')
723 preservepath = os.path.join(config.workspace_path, 'attic', recipename)
729 removefile = os.path.join(config.workspace_path, splitline[1])
740 preservefile = os.path.basename(removefile)
742 shutil.move(removefile, os.path.join(preservepath, preservefile))
744 os.remove(removefile)
753 if os.path.exists(srcdir) and os.listdir(srcdir):
754 with open(os.path.join(srcdir,"Makefile")) as f:
763 if os.path.exists(srcdir) and os.listdir(srcdir):
770 s = os.path.abspath(s)
771 workdir = os.path.abspath(workdir)
772 if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
774 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
775 srctree = os.path.join(srctree, srcsubdir)
803 srctree = os.path.abspath(args.srctree)
807 if args.no_extract and not os.path.isdir(srctree):
814 if os.path.exists(appendfile):
834 …if (os.path.exists(srcdir) and os.listdir(srcdir)) and (kernelVersion in staging_kerVer and stagin…
838 localfilesdir = os.path.join(srctree,'oe-local-files')
840 … recipe_patches = [os.path.basename(patch) for patch in oe.recipeutils.get_recipe_patches(rd)]
849 cfg = os.path.join(os.path.dirname(local_files[key]), line[-1])
856 srcabspath = os.path.abspath(srcsubdir)
857 …iles if os.path.exists(os.path.join(workdir, fname)) and (srcabspath == workdir or not os.path.j…
860 … _move_file(os.path.join(workdir, fname), os.path.join(srctree, 'oe-local-files', fname))
861 with open(os.path.join(srctree, 'oe-local-files', '.gitignore'), 'w') as f:
872 shutil.copy2(os.path.join(kconfpath, '.config'),srctree)
883 if os.path.exists(os.path.join(srctree, '.git')):
889 if os.path.exists(os.path.join(srctree, '.git')):
938 bb.utils.mkdirhier(os.path.dirname(appendfile))
944 os.path.join(srctreebase, 'oe-local-files'))
1020 appendfn = os.path.splitext(os.path.basename(append))[0]
1088 oldrecipedir = os.path.dirname(recipefile)
1089 newrecipedir = os.path.join(config.workspace_path, 'recipes', newname)
1093 newappend = os.path.join(os.path.dirname(append), newappend)
1094 newfile = os.path.join(newrecipedir, newfile)
1107 … if os.path.abspath(srctree) == os.path.join(config.workspace_path, 'sources', args.recipename):
1108 newsrctree = os.path.join(config.workspace_path, 'sources', newname)
1127 bpndir = os.path.join(oldrecipedir, bpn)
1128 if os.path.exists(bpndir):
1129 newbpndir = os.path.join(newrecipedir, newbpn)
1136 bpdir = os.path.join(oldrecipedir, bp)
1137 if os.path.exists(bpdir):
1138 newbpdir = os.path.join(newrecipedir, '%s-%s' % (newbpn, newver))
1144 for entry in os.listdir(oldrecipedir):
1145 oldpath = os.path.join(oldrecipedir, entry)
1146 newpath = os.path.join(newrecipedir, entry)
1149 os.rmdir(oldrecipedir)
1153 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'r') as f:
1158 relbpndir = os.path.relpath(bpndir, config.workspace_path) + '/'
1162 relbpdir = os.path.relpath(bpdir, config.workspace_path) + '/'
1166 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'w') as f:
1172 if splitentry[1] == os.path.relpath(append, config.workspace_path):
1173 splitentry[1] = os.path.relpath(newappend, config.workspace_path)
1176 elif splitentry[1] == os.path.relpath(recipefile, config.workspace_path):
1177 splitentry[1] = os.path.relpath(newfile, config.workspace_path)
1181 …splitentry[1] = os.path.relpath(os.path.join(newbpndir, splitentry[1][len(relbpndir):]), config.wo…
1183 …splitentry[1] = os.path.relpath(os.path.join(newbpdir, splitentry[1][len(relbpdir):]), config.work…
1245 basename = os.path.basename(fname)
1248 os.path.basename(srcuri[i].split(';')[0]) == basename):
1257 basename = os.path.basename(filename)
1259 if os.path.basename(srcuri[i].split(';')[0]) == basename:
1273 path = os.path.join(destpath, os.path.basename(path))
1275 if os.path.exists(path):
1284 os.remove(path)
1287 os.rmdir(os.path.dirname(path))
1308 existing_patches = dict((os.path.basename(path), path) for path in
1316 new_patches = sorted(os.listdir(destdir))
1326 old_basename_splitext = os.path.splitext(old_basename)
1328 old_patch_noext = os.path.splitext(old_patch)[0]
1337 bb.utils.rename(os.path.join(destdir, new_patch),
1338 os.path.join(destdir, match_name))
1343 with open(os.path.join(destdir, match_name), 'r') as f:
1368 orig_config = os.path.join(srctree, '.config.baseline')
1369 new_config = os.path.join(srctree, '.config.new')
1370 if os.path.exists(orig_config) and os.path.exists(new_config):
1382 if os.path.exists(outfile):
1385 os.unlink(outfile)
1424 local_files_dir = os.path.join(srctreebase, 'oe-local-files')
1429 tmp_index = os.path.join(srctree, '.git', 'index.tmp.devtool')
1432 env=dict(os.environ, GIT_WORK_TREE=destdir,
1435 elif os.path.isdir(local_files_dir):
1439 os.path.join(local_files_dir, '.'), destdir])
1446 fragment_path = os.path.join(destdir, fragment_fn)
1448 if os.path.exists(fragment_path):
1452 if os.path.isdir(local_files_dir):
1458 if os.path.exists(os.path.join(local_files_dir, fragment_fn)):
1459 os.unlink(os.path.join(local_files_dir, fragment_fn))
1465 srcpath = os.path.join(rd.getVar('WORKDIR'), frag_name)
1466 if os.path.exists(srcpath):
1472 if os.path.isdir(local_files_dir):
1479 workpath = os.path.join(local_files_dir, fname)
1487 if not s.endswith(os.sep):
1488 s += os.sep
1494 fworkpath = os.path.join(workdir, fname)
1496 fpath = os.path.join(srctree, os.path.relpath(fworkpath, s))
1497 if os.path.exists(fpath):
1510 relpth = os.path.relpath(entry, recipedir)
1511 if not os.sep in relpth:
1513 if os.path.isdir(entry):
1515 return os.path.join(recipedir, rd.getVar('BPN'))
1526 recipedir = os.path.basename(recipefile)
1567 files = dict((os.path.join(local_files_dir, key), val) for
1584 if os.path.isabs(basepath):
1589 _move_file(os.path.join(local_files_dir, basepath), path,
1594 _move_file(os.path.join(local_files_dir, basepath),
1595 os.path.join(files_dir, basepath),
1619 recipedir = os.path.dirname(recipefile)
1621 if not os.path.exists(append):
1625 relpatchdir = os.path.relpath(srctreebase, srctree)
1677 files = OrderedDict((os.path.join(local_files_dir, key), val) for
1679 files.update(OrderedDict((os.path.join(patches_dir, key), val) for
1687 remaining = [srcuri_entry(os.path.basename(item)) for
1703 if os.path.isabs(basepath):
1709 _move_file(os.path.join(local_files_dir, basepath), path,
1713 patchfn = os.path.join(patches_dir, basepath)
1714 if os.path.dirname(path) + '/' == dl_dir:
1718 path = os.path.join(files_dir, basepath)
1729 _move_file(os.path.join(local_files_dir, basepath),
1730 os.path.join(files_dir, basepath),
1737 _move_file(os.path.join(patches_dir, basepath),
1738 os.path.join(files_dir, basepath),
1748 logger.info('Updating recipe %s' % os.path.basename(recipefile))
1857 if not os.path.exists(args.append):
1860 if not os.path.exists(os.path.join(args.append, 'conf', 'layer.conf')):
1910 layerconf_file = os.path.join(layerconf_path, 'conf', 'layer.conf')
1911 new_layerconf_file = os.path.join(layerconf_path, 'conf', '.layer.conf')
1925 os.remove(new_layerconf_file)
1939 if recipefile and os.path.exists(recipefile):
1953 if os.path.exists(appendfile):
1957 os.remove(appendfile)
1959 preservepath = os.path.join(config.workspace_path, 'attic', pn, pn)
1961 if os.path.exists(origdir):
1962 for root, dirs, files in os.walk(origdir):
1965 _move_file(os.path.join(origdir, fn),
1966 os.path.join(preservepath, fn))
1968 preservedir(os.path.join(root, dn))
1969 os.rmdir(origdir)
1974 preservedir(os.path.dirname(recipefile))
1976 preservedir(os.path.join(config.workspace_path, 'appends', pn))
1979 if os.path.isdir(srctreebase):
1980 if os.listdir(srctreebase):
1992 os.rmdir(srctreebase)
2027 bn = os.path.basename(p)
2037 return os.path.abspath(layername)
2039 return os.path.abspath(layer_paths[0])
2044 return os.path.abspath(layer_paths[0])
2057 corebasedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
2078 recipedir = os.path.dirname(recipefile)
2081 if not os.path.isdir(destlayerdir):
2084 if os.path.abspath(destlayerdir) == config.workspace_path:
2107 origrelpath = os.path.relpath(origpath, origlayerpath)
2112 layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
2113 if not os.path.abspath(destlayerbasedir) in layerdirs:
2133 removed = [os.path.relpath(pth, recipedir) for pth in removed]
2138 fnp = os.path.join(origpath, fn)
2139 if fn in removed or not os.path.exists(os.path.join(recipedir, fn)):
2143 os.remove(fnp)
2152 for root, _, files in os.walk(recipedir):
2154 srcpath = os.path.join(root, fn)
2155 relpth = os.path.relpath(os.path.dirname(srcpath), recipedir)
2156 destdir = os.path.abspath(os.path.join(destpath, relpth))
2157 destfp = os.path.join(destdir, fn)
2163 for root, _, files in os.walk(dry_run_outdir):
2165 outf = os.path.join(root, fn)
2166 relf = os.path.relpath(outf, dry_run_outdir)
2173 … comparelist.append((os.path.abspath(os.path.join(origpath, origf)),
2175 … os.path.abspath(os.path.join(destpath, relf))))
2182 if os.path.exists(appendfile):
2190 recipedest = os.path.dirname(appendfile)
2192 recipedest = os.path.dirname(recipefile)
2193 destfp = os.path.join(recipedest, relf)
2194 if os.path.exists(destfp):
2230 return os.path.join(srctreeparent, 'sources', recipename)
2232 return os.path.join(srctreeparent, 'sources')