diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-19 14:32:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-22 12:03:02 +0000 |
commit | 9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7 (patch) | |
tree | 2002648fd17558c7d895d672aa65fa46f4b82250 /bitbake/lib/bb/fetch2/hg.py | |
parent | 4acc7322a2ada941b803e1aee23d84351888eef0 (diff) | |
download | poky-9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7.tar.gz |
bitbake: fetch2: Stop passing around the pointless url parameter
There is no good reason to keep passing around the url parameter when
its contained within urldata (ud). This is left around due to
legacy reasons, some functions take it, some don't and its time
to cleanup.
This is fetcher internal API, there are a tiny number of external users
of the internal API (buildhistory and distrodata) which can be fixed up
after this change.
(Bitbake rev: 6a48474de9505a3700863f31839a7c53c5e18a8d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/hg.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/hg.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py index cf214816b7..76810abb7d 100644 --- a/bitbake/lib/bb/fetch2/hg.py +++ b/bitbake/lib/bb/fetch2/hg.py | |||
@@ -37,7 +37,7 @@ from bb.fetch2 import logger | |||
37 | 37 | ||
38 | class Hg(FetchMethod): | 38 | class Hg(FetchMethod): |
39 | """Class to fetch from mercurial repositories""" | 39 | """Class to fetch from mercurial repositories""" |
40 | def supports(self, url, ud, d): | 40 | def supports(self, ud, d): |
41 | """ | 41 | """ |
42 | Check to see if a given url can be fetched with mercurial. | 42 | Check to see if a given url can be fetched with mercurial. |
43 | """ | 43 | """ |
@@ -66,7 +66,7 @@ class Hg(FetchMethod): | |||
66 | 66 | ||
67 | ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d) | 67 | ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d) |
68 | 68 | ||
69 | def need_update(self, url, ud, d): | 69 | def need_update(self, ud, d): |
70 | revTag = ud.parm.get('rev', 'tip') | 70 | revTag = ud.parm.get('rev', 'tip') |
71 | if revTag == "tip": | 71 | if revTag == "tip": |
72 | return True | 72 | return True |
@@ -126,14 +126,14 @@ class Hg(FetchMethod): | |||
126 | 126 | ||
127 | return cmd | 127 | return cmd |
128 | 128 | ||
129 | def download(self, loc, ud, d): | 129 | def download(self, ud, d): |
130 | """Fetch url""" | 130 | """Fetch url""" |
131 | 131 | ||
132 | logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'") | 132 | logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'") |
133 | 133 | ||
134 | if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK): | 134 | if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK): |
135 | updatecmd = self._buildhgcommand(ud, d, "pull") | 135 | updatecmd = self._buildhgcommand(ud, d, "pull") |
136 | logger.info("Update " + loc) | 136 | logger.info("Update " + ud.url) |
137 | # update sources there | 137 | # update sources there |
138 | os.chdir(ud.moddir) | 138 | os.chdir(ud.moddir) |
139 | logger.debug(1, "Running %s", updatecmd) | 139 | logger.debug(1, "Running %s", updatecmd) |
@@ -142,7 +142,7 @@ class Hg(FetchMethod): | |||
142 | 142 | ||
143 | else: | 143 | else: |
144 | fetchcmd = self._buildhgcommand(ud, d, "fetch") | 144 | fetchcmd = self._buildhgcommand(ud, d, "fetch") |
145 | logger.info("Fetch " + loc) | 145 | logger.info("Fetch " + ud.url) |
146 | # check out sources there | 146 | # check out sources there |
147 | bb.utils.mkdirhier(ud.pkgdir) | 147 | bb.utils.mkdirhier(ud.pkgdir) |
148 | os.chdir(ud.pkgdir) | 148 | os.chdir(ud.pkgdir) |
@@ -169,7 +169,7 @@ class Hg(FetchMethod): | |||
169 | def supports_srcrev(self): | 169 | def supports_srcrev(self): |
170 | return True | 170 | return True |
171 | 171 | ||
172 | def _latest_revision(self, url, ud, d, name): | 172 | def _latest_revision(self, ud, d, name): |
173 | """ | 173 | """ |
174 | Compute tip revision for the url | 174 | Compute tip revision for the url |
175 | """ | 175 | """ |
@@ -177,10 +177,10 @@ class Hg(FetchMethod): | |||
177 | output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d) | 177 | output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d) |
178 | return output.strip() | 178 | return output.strip() |
179 | 179 | ||
180 | def _build_revision(self, url, ud, d, name): | 180 | def _build_revision(self, ud, d, name): |
181 | return ud.revision | 181 | return ud.revision |
182 | 182 | ||
183 | def _revision_key(self, url, ud, d, name): | 183 | def _revision_key(self, ud, d, name): |
184 | """ | 184 | """ |
185 | Return a unique key for the url | 185 | Return a unique key for the url |
186 | """ | 186 | """ |