summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/bzr.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-19 14:32:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-22 12:03:02 +0000
commit9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7 (patch)
tree2002648fd17558c7d895d672aa65fa46f4b82250 /bitbake/lib/bb/fetch2/bzr.py
parent4acc7322a2ada941b803e1aee23d84351888eef0 (diff)
downloadpoky-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/bzr.py')
-rw-r--r--bitbake/lib/bb/fetch2/bzr.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py
index 5d9e5f907c..3caaa6fca9 100644
--- a/bitbake/lib/bb/fetch2/bzr.py
+++ b/bitbake/lib/bb/fetch2/bzr.py
@@ -34,7 +34,7 @@ from bb.fetch2 import runfetchcmd
34from bb.fetch2 import logger 34from bb.fetch2 import logger
35 35
36class Bzr(FetchMethod): 36class Bzr(FetchMethod):
37 def supports(self, url, ud, d): 37 def supports(self, ud, d):
38 return ud.type in ['bzr'] 38 return ud.type in ['bzr']
39 39
40 def urldata_init(self, ud, d): 40 def urldata_init(self, ud, d):
@@ -81,12 +81,12 @@ class Bzr(FetchMethod):
81 81
82 return bzrcmd 82 return bzrcmd
83 83
84 def download(self, loc, ud, d): 84 def download(self, ud, d):
85 """Fetch url""" 85 """Fetch url"""
86 86
87 if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK): 87 if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
88 bzrcmd = self._buildbzrcommand(ud, d, "update") 88 bzrcmd = self._buildbzrcommand(ud, d, "update")
89 logger.debug(1, "BZR Update %s", loc) 89 logger.debug(1, "BZR Update %s", ud.url)
90 bb.fetch2.check_network_access(d, bzrcmd, ud.url) 90 bb.fetch2.check_network_access(d, bzrcmd, ud.url)
91 os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path))) 91 os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path)))
92 runfetchcmd(bzrcmd, d) 92 runfetchcmd(bzrcmd, d)
@@ -94,7 +94,7 @@ class Bzr(FetchMethod):
94 bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True) 94 bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True)
95 bzrcmd = self._buildbzrcommand(ud, d, "fetch") 95 bzrcmd = self._buildbzrcommand(ud, d, "fetch")
96 bb.fetch2.check_network_access(d, bzrcmd, ud.url) 96 bb.fetch2.check_network_access(d, bzrcmd, ud.url)
97 logger.debug(1, "BZR Checkout %s", loc) 97 logger.debug(1, "BZR Checkout %s", ud.url)
98 bb.utils.mkdirhier(ud.pkgdir) 98 bb.utils.mkdirhier(ud.pkgdir)
99 os.chdir(ud.pkgdir) 99 os.chdir(ud.pkgdir)
100 logger.debug(1, "Running %s", bzrcmd) 100 logger.debug(1, "Running %s", bzrcmd)
@@ -114,17 +114,17 @@ class Bzr(FetchMethod):
114 def supports_srcrev(self): 114 def supports_srcrev(self):
115 return True 115 return True
116 116
117 def _revision_key(self, url, ud, d, name): 117 def _revision_key(self, ud, d, name):
118 """ 118 """
119 Return a unique key for the url 119 Return a unique key for the url
120 """ 120 """
121 return "bzr:" + ud.pkgdir 121 return "bzr:" + ud.pkgdir
122 122
123 def _latest_revision(self, url, ud, d, name): 123 def _latest_revision(self, ud, d, name):
124 """ 124 """
125 Return the latest upstream revision number 125 Return the latest upstream revision number
126 """ 126 """
127 logger.debug(2, "BZR fetcher hitting network for %s", url) 127 logger.debug(2, "BZR fetcher hitting network for %s", ud.url)
128 128
129 bb.fetch2.check_network_access(d, self._buildbzrcommand(ud, d, "revno"), ud.url) 129 bb.fetch2.check_network_access(d, self._buildbzrcommand(ud, d, "revno"), ud.url)
130 130
@@ -132,12 +132,12 @@ class Bzr(FetchMethod):
132 132
133 return output.strip() 133 return output.strip()
134 134
135 def sortable_revision(self, url, ud, d, name): 135 def sortable_revision(self, ud, d, name):
136 """ 136 """
137 Return a sortable revision number which in our case is the revision number 137 Return a sortable revision number which in our case is the revision number
138 """ 138 """
139 139
140 return False, self._build_revision(url, ud, d) 140 return False, self._build_revision(ud, d)
141 141
142 def _build_revision(self, url, ud, d): 142 def _build_revision(self, ud, d):
143 return ud.revision 143 return ud.revision