diff options
-rw-r--r-- | meta-oe/classes/socorro-syms.bbclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meta-oe/classes/socorro-syms.bbclass b/meta-oe/classes/socorro-syms.bbclass index c2729527d6..0312031d0d 100644 --- a/meta-oe/classes/socorro-syms.bbclass +++ b/meta-oe/classes/socorro-syms.bbclass | |||
@@ -108,6 +108,12 @@ def run_command(command, directory): | |||
108 | return output.rstrip() | 108 | return output.rstrip() |
109 | 109 | ||
110 | 110 | ||
111 | def is_local_url(url): | ||
112 | |||
113 | return \ | ||
114 | url.startswith("file:") or url.startswith("/") or url.startswith("./") | ||
115 | |||
116 | |||
111 | def git_repository_path(source_file_path): | 117 | def git_repository_path(source_file_path): |
112 | 118 | ||
113 | import re | 119 | import re |
@@ -125,12 +131,18 @@ def git_repository_path(source_file_path): | |||
125 | 131 | ||
126 | # The URL could be a local download directory. If so, get the URL again | 132 | # The URL could be a local download directory. If so, get the URL again |
127 | # using the local directory's config file. | 133 | # using the local directory's config file. |
128 | if os.path.isdir(source_long_url): | 134 | if is_local_url(source_long_url): |
129 | git_config_file = os.path.join(source_long_url, "config") | 135 | git_config_file = os.path.join(source_long_url, "config") |
130 | source_long_url = run_command( | 136 | source_long_url = run_command( |
131 | "git config --file %s --get remote.origin.url" % git_config_file, | 137 | "git config --file %s --get remote.origin.url" % git_config_file, |
132 | source_file_dir) | 138 | source_file_dir) |
133 | 139 | ||
140 | # If also the download directory redirects to a local git directory, | ||
141 | # then we're probably using source code from a local debug branch which | ||
142 | # won't be accessible by Socorro. | ||
143 | if is_local_url(source_long_url): | ||
144 | return None | ||
145 | |||
134 | # The URL can have several formats. A full list can be found using | 146 | # The URL can have several formats. A full list can be found using |
135 | # git help clone. Extract the server part with a regex. | 147 | # git help clone. Extract the server part with a regex. |
136 | url_match = re.search(".*(://|@)([^:/]*).*", source_long_url) | 148 | url_match = re.search(".*(://|@)([^:/]*).*", source_long_url) |