summaryrefslogtreecommitdiff
path: root/yocto-poky/scripts/combo-layer
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/scripts/combo-layer')
-rwxr-xr-xyocto-poky/scripts/combo-layer49
1 files changed, 12 insertions, 37 deletions
diff --git a/yocto-poky/scripts/combo-layer b/yocto-poky/scripts/combo-layer
index 7435a176b..91270415f 100755
--- a/yocto-poky/scripts/combo-layer
+++ b/yocto-poky/scripts/combo-layer
@@ -73,7 +73,7 @@ class Configuration(object):
else:
# Apply special type transformations for some properties.
# Type matches the RawConfigParser.get*() methods.
- types = {'signoff': 'boolean'}
+ types = {'signoff': 'boolean', 'update': 'boolean'}
if name in types:
value = getattr(parser, 'get' + types[name])(section, name)
self.repos[repo][name] = value
@@ -380,7 +380,7 @@ tail -c +18 $tmpname | head -c -4
if not parent:
parent = '.'
# May run outside of the current directory, so do not assume that .git exists.
- filter_branch.extend(['--tree-filter', 'mkdir -p .git/tmptree && mv $(ls -1 -a | grep -v -e ^.git$ -e ^.$ -e ^..$) .git/tmptree && mkdir -p %s && mv .git/tmptree %s' % (parent, dest_dir)])
+ filter_branch.extend(['--tree-filter', 'mkdir -p .git/tmptree && find . -mindepth 1 -maxdepth 1 ! -name .git -print0 | xargs -0 -I SOURCE mv SOURCE .git/tmptree && mkdir -p %s && mv .git/tmptree %s' % (parent, dest_dir)])
filter_branch.append('HEAD')
runcmd(filter_branch)
runcmd('git update-ref -d refs/original/refs/heads/%s' % name)
@@ -567,7 +567,7 @@ def get_repos(conf, repo_names):
sys.exit(1)
if not repos:
- repos = conf.repos
+ repos = [ repo for repo in conf.repos if conf.repos[repo].get("update", True) ]
return repos
@@ -662,7 +662,14 @@ def action_update(conf, args):
patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision)
rev_cmd_range = patch_cmd_range
- file_filter = repo.get('file_filter',"")
+ file_filter = repo.get('file_filter',".")
+
+ # Filter out unwanted files
+ exclude = repo.get('file_exclude', '')
+ if exclude:
+ for path in exclude.split():
+ p = "%s/%s" % (dest_dir, path) if dest_dir != '.' else path
+ file_filter += " ':!%s'" % p
patch_cmd = "git format-patch -N %s --output-directory %s %s -- %s" % \
(prefix,repo_patch_dir, patch_cmd_range, file_filter)
@@ -681,38 +688,6 @@ def action_update(conf, args):
runcmd("%s %s %s %s" % (repo['hook'], patch, revlist[count], name))
count=count-1
- # Step 3a: Filter out unwanted files and patches.
- exclude = repo.get('file_exclude', '')
- if exclude:
- filter = ['filterdiff', '-p1']
- for path in exclude.split():
- filter.append('-x')
- filter.append('%s/%s' % (dest_dir, path) if dest_dir != '.' else path)
- for patch in patchlist[:]:
- filtered = patch + '.tmp'
- with open(filtered, 'w') as f:
- runcmd(filter + [patch], out=f)
- # Now check for empty patches.
- if runcmd(['filterdiff', '--list', filtered]):
- # Possibly modified.
- os.unlink(patch)
- os.rename(filtered, patch)
- else:
- # Empty, ignore it. Must also remove from revlist.
- with open(patch, 'r') as f:
- fromline = f.readline()
- if not fromline:
- # Patch must have been empty to start with. No need
- # to remove it.
- continue
- m = re.match(r'''^From ([0-9a-fA-F]+) .*\n''', fromline)
- rev = m.group(1)
- logger.debug('skipping empty patch %s = %s' % (patch, rev))
- os.unlink(patch)
- os.unlink(filtered)
- patchlist.remove(patch)
- revlist.remove(rev)
-
# Step 4: write patch list and revision list to file, for user to edit later
patchlist_file = os.path.join(os.getcwd(), patch_dir, "patchlist-%s" % name)
repo['patchlist'] = patchlist_file
@@ -945,5 +920,5 @@ if __name__ == "__main__":
except Exception:
ret = 1
import traceback
- traceback.print_exc(5)
+ traceback.print_exc()
sys.exit(ret)