aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2018-06-27 15:20:21 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2018-06-27 15:32:01 +0800
commit6e3c2d757a5745dee5cce0b53175b56ad3621d73 (patch)
treee61c4a459fb0127bae40c5e89f8a2bc908420a16
parent0efd0308a0927e446e1f8535c1e244e5ed3193b3 (diff)
downloadupstream-6e3c2d757a5745dee5cce0b53175b56ad3621d73.tar.gz
upstream-6e3c2d757a5745dee5cce0b53175b56ad3621d73.tar.bz2
upstream-6e3c2d757a5745dee5cce0b53175b56ad3621d73.zip
scripts/download.py: use a more terse api for fetching git commit date
The previous api [1] includes in its response patch data among other things, as such the response size can vary and be big. Use another api[2] to improve it a bit [1] Get a single commit, Repositories, https://developer.github.com/v3/repos/commits/#get-a-single-commit [2] Git Commits, Git Data, https://developer.github.com/v3/git/commits/#get-a-commit Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
-rwxr-xr-xscripts/download.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/download.py b/scripts/download.py
index f7fd534ea5..779d7b3de2 100755
--- a/scripts/download.py
+++ b/scripts/download.py
@@ -305,7 +305,7 @@ class DownloadMethodGitHubTarball(DownloadMethod):
def _init_commit_ts(self):
if self.commit_ts is not None:
return
- url = self._make_repo_url_path('commits', self.version)
+ url = self._make_repo_url_path('git', 'commits', self.version)
ct = self.commit_ts_cache.get(url)
if ct is not None:
self.commit_ts = ct
@@ -313,7 +313,7 @@ class DownloadMethodGitHubTarball(DownloadMethod):
resp = self._make_request(url)
data = resp.read()
data = json.loads(data)
- date = data['commit']['committer']['date']
+ date = data['committer']['date']
date = datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%SZ')
date = date.timetuple()
ct = calendar.timegm(date)
id='n189' href='#n189'>189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292