diff options
| -rw-r--r-- | meta/lib/oe/buildcfg.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py index 4b22f18f36..85b903fab0 100644 --- a/meta/lib/oe/buildcfg.py +++ b/meta/lib/oe/buildcfg.py | |||
| @@ -17,21 +17,21 @@ def get_scmbasepath(d): | |||
| 17 | def get_metadata_git_branch(path): | 17 | def get_metadata_git_branch(path): |
| 18 | try: | 18 | try: |
| 19 | rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path) | 19 | rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path) |
| 20 | except bb.process.ExecutionError: | 20 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 21 | rev = '<unknown>' | 21 | rev = '<unknown>' |
| 22 | return rev.strip() | 22 | return rev.strip() |
| 23 | 23 | ||
| 24 | def get_metadata_git_revision(path): | 24 | def get_metadata_git_revision(path): |
| 25 | try: | 25 | try: |
| 26 | rev, _ = bb.process.run('git rev-parse HEAD', cwd=path) | 26 | rev, _ = bb.process.run('git rev-parse HEAD', cwd=path) |
| 27 | except bb.process.ExecutionError: | 27 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 28 | rev = '<unknown>' | 28 | rev = '<unknown>' |
| 29 | return rev.strip() | 29 | return rev.strip() |
| 30 | 30 | ||
| 31 | def get_metadata_git_toplevel(path): | 31 | def get_metadata_git_toplevel(path): |
| 32 | try: | 32 | try: |
| 33 | toplevel, _ = bb.process.run('git rev-parse --show-toplevel', cwd=path) | 33 | toplevel, _ = bb.process.run('git rev-parse --show-toplevel', cwd=path) |
| 34 | except bb.process.ExecutionError: | 34 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 35 | return "" | 35 | return "" |
| 36 | return toplevel.strip() | 36 | return toplevel.strip() |
| 37 | 37 | ||
| @@ -39,21 +39,21 @@ def get_metadata_git_remotes(path): | |||
| 39 | try: | 39 | try: |
| 40 | remotes_list, _ = bb.process.run('git remote', cwd=path) | 40 | remotes_list, _ = bb.process.run('git remote', cwd=path) |
| 41 | remotes = remotes_list.split() | 41 | remotes = remotes_list.split() |
| 42 | except bb.process.ExecutionError: | 42 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 43 | remotes = [] | 43 | remotes = [] |
| 44 | return remotes | 44 | return remotes |
| 45 | 45 | ||
| 46 | def get_metadata_git_remote_url(path, remote): | 46 | def get_metadata_git_remote_url(path, remote): |
| 47 | try: | 47 | try: |
| 48 | uri, _ = bb.process.run('git remote get-url {remote}'.format(remote=remote), cwd=path) | 48 | uri, _ = bb.process.run('git remote get-url {remote}'.format(remote=remote), cwd=path) |
| 49 | except bb.process.ExecutionError: | 49 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 50 | return "" | 50 | return "" |
| 51 | return uri.strip() | 51 | return uri.strip() |
| 52 | 52 | ||
| 53 | def get_metadata_git_describe(path): | 53 | def get_metadata_git_describe(path): |
| 54 | try: | 54 | try: |
| 55 | describe, _ = bb.process.run('git describe --tags --dirty', cwd=path) | 55 | describe, _ = bb.process.run('git describe --tags --dirty', cwd=path) |
| 56 | except bb.process.ExecutionError: | 56 | except (bb.process.ExecutionError, bb.process.NotFoundError): |
| 57 | return "" | 57 | return "" |
| 58 | return describe.strip() | 58 | return describe.strip() |
| 59 | 59 | ||
