diff options
Diffstat (limited to 'meta/lib/oe/buildcfg.py')
-rw-r--r-- | meta/lib/oe/buildcfg.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py index b3fe510309..27b059b834 100644 --- a/meta/lib/oe/buildcfg.py +++ b/meta/lib/oe/buildcfg.py | |||
@@ -28,6 +28,35 @@ def get_metadata_git_revision(path): | |||
28 | rev = '<unknown>' | 28 | rev = '<unknown>' |
29 | return rev.strip() | 29 | return rev.strip() |
30 | 30 | ||
31 | def get_metadata_git_toplevel(path): | ||
32 | try: | ||
33 | toplevel, _ = bb.process.run('git rev-parse --show-toplevel', cwd=path) | ||
34 | except bb.process.ExecutionError: | ||
35 | return "" | ||
36 | return toplevel.strip() | ||
37 | |||
38 | def get_metadata_git_remotes(path): | ||
39 | try: | ||
40 | remotes_list, _ = bb.process.run('git remote', cwd=path) | ||
41 | remotes = remotes_list.split() | ||
42 | except bb.process.ExecutionError: | ||
43 | remotes = [] | ||
44 | return remotes | ||
45 | |||
46 | def get_metadata_git_remote_url(path, remote): | ||
47 | try: | ||
48 | uri, _ = bb.process.run('git remote get-url {remote}'.format(remote=remote), cwd=path) | ||
49 | except bb.process.ExecutionError: | ||
50 | return "" | ||
51 | return uri.strip() | ||
52 | |||
53 | def get_metadata_git_describe(path): | ||
54 | try: | ||
55 | describe, _ = bb.process.run('git describe --tags', cwd=path) | ||
56 | except bb.process.ExecutionError: | ||
57 | return "" | ||
58 | return describe.strip() | ||
59 | |||
31 | def is_layer_modified(path): | 60 | def is_layer_modified(path): |
32 | try: | 61 | try: |
33 | subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e; | 62 | subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e; |