diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-03 21:43:01 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-07 09:06:35 +0000 |
| commit | 7e4fbfc1c1887a1a0507b60244aa53b8b1994edd (patch) | |
| tree | dc1a750939bbd5c3a480463eb1047b05c90bd5ce | |
| parent | 49a022d25d35115e7286e2ca2530566da2d71aa8 (diff) | |
| download | poky-7e4fbfc1c1887a1a0507b60244aa53b8b1994edd.tar.gz | |
bitbake/fetch2: Simplfy setup_srcrevs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 05fd81ad4d..af6ac734ed 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -574,7 +574,13 @@ class FetchData(object): | |||
| 574 | raise NoMethodError("Missing implementation for url %s" % url) | 574 | raise NoMethodError("Missing implementation for url %s" % url) |
| 575 | 575 | ||
| 576 | if self.method.supports_srcrev(): | 576 | if self.method.supports_srcrev(): |
| 577 | self.setup_srcrevs(d) | 577 | self.revisions = {} |
| 578 | for name in self.names: | ||
| 579 | self.revisions[name] = Fetch.srcrev_internal_helper(self, d, name) | ||
| 580 | |||
| 581 | # add compatibility code for non name specified case | ||
| 582 | if len(self.names) == 1: | ||
| 583 | self.revision = self.revisions[self.names[0]] | ||
| 578 | 584 | ||
| 579 | if hasattr(self.method, "urldata_init"): | 585 | if hasattr(self.method, "urldata_init"): |
| 580 | self.method.urldata_init(self, d) | 586 | self.method.urldata_init(self, d) |
| @@ -592,18 +598,6 @@ class FetchData(object): | |||
| 592 | self.md5 = basepath + '.md5' | 598 | self.md5 = basepath + '.md5' |
| 593 | self.lockfile = basepath + '.lock' | 599 | self.lockfile = basepath + '.lock' |
| 594 | 600 | ||
| 595 | def setup_srcrevs(self, d): | ||
| 596 | if not self.method.supports_srcrev(): | ||
| 597 | return | ||
| 598 | |||
| 599 | self.revisions = {} | ||
| 600 | for name in self.names: | ||
| 601 | self.revisions[name] = Fetch.srcrev_internal_helper(self, d, name) | ||
| 602 | |||
| 603 | # add compatibility code for non name specified case | ||
| 604 | if len(self.names) == 1: | ||
| 605 | self.revision = self.revisions[self.names[0]] | ||
| 606 | |||
| 607 | def setup_localpath(self, d): | 601 | def setup_localpath(self, d): |
| 608 | if not self.localpath: | 602 | if not self.localpath: |
| 609 | self.localpath = self.method.localpath(self.url, self, d) | 603 | self.localpath = self.method.localpath(self.url, self, d) |
