diff options
-rw-r--r-- | build/conf/local.conf.sample | 4 | ||||
-rw-r--r-- | meta/classes/packaged-staging.bbclass | 27 |
2 files changed, 30 insertions, 1 deletions
diff --git a/build/conf/local.conf.sample b/build/conf/local.conf.sample index 149c73d664..14af548efd 100644 --- a/build/conf/local.conf.sample +++ b/build/conf/local.conf.sample | |||
@@ -159,3 +159,7 @@ ENABLE_BINARY_LOCALE_GENERATION = "1" | |||
159 | # on an x86_64 host. | 159 | # on an x86_64 host. |
160 | # Supported values are i586 and x86_64 | 160 | # Supported values are i586 and x86_64 |
161 | #SDKMACHINE="i586" | 161 | #SDKMACHINE="i586" |
162 | |||
163 | # Poky can try and fetch packaged-staging packages from a http, https or ftp | ||
164 | # mirror. Set this variable to the root of a pstage directory on a server. | ||
165 | #PSTAGE_MIRROR ?= "http://someserver.tld/share/pstage" | ||
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 74855c4ab3..4789ecc3b1 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass | |||
@@ -135,7 +135,9 @@ do_clean_prepend() { | |||
135 | 135 | ||
136 | stagepkg = bb.data.expand("${PSTAGE_PKG}", d) | 136 | stagepkg = bb.data.expand("${PSTAGE_PKG}", d) |
137 | bb.note("Removing staging package %s" % stagepkg) | 137 | bb.note("Removing staging package %s" % stagepkg) |
138 | os.system('rm -rf ' + stagepkg) | 138 | # Add a wildcard to the end of stagepkg to also get its md5 |
139 | # if it's a fetched package | ||
140 | os.system('rm -rf ' + stagepkg + '*') | ||
139 | } | 141 | } |
140 | 142 | ||
141 | staging_helper () { | 143 | staging_helper () { |
@@ -159,6 +161,27 @@ staging_helper () { | |||
159 | fi | 161 | fi |
160 | } | 162 | } |
161 | 163 | ||
164 | def staging_fetch(stagepkg, d): | ||
165 | import bb.fetch | ||
166 | |||
167 | # only try and fetch if the user has configured a mirror | ||
168 | if bb.data.getVar('PSTAGE_MIRROR', d) != "": | ||
169 | # Copy the data object and override DL_DIR and SRC_URI | ||
170 | pd = d.createCopy() | ||
171 | dldir = bb.data.expand("${PSTAGE_DIR}/${PSTAGE_PKGPATH}", pd) | ||
172 | mirror = bb.data.expand("${PSTAGE_MIRROR}/${PSTAGE_PKGPATH}/", pd) | ||
173 | srcuri = mirror + os.path.basename(stagepkg) | ||
174 | bb.data.setVar('DL_DIR', dldir, pd) | ||
175 | bb.data.setVar('SRC_URI', srcuri, pd) | ||
176 | |||
177 | # Try a fetch from the pstage mirror, if it fails just return and | ||
178 | # we will build the package | ||
179 | try: | ||
180 | bb.fetch.init([srcuri], pd) | ||
181 | bb.fetch.go(pd, [srcuri]) | ||
182 | except: | ||
183 | return | ||
184 | |||
162 | PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_sysroot package_write_deb package_write_ipk package_write package_stage qa_staging" | 185 | PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_sysroot package_write_deb package_write_ipk package_write package_stage qa_staging" |
163 | 186 | ||
164 | SCENEFUNCS += "packagestage_scenefunc" | 187 | SCENEFUNCS += "packagestage_scenefunc" |
@@ -174,6 +197,8 @@ python packagestage_scenefunc () { | |||
174 | pstage_cleanpackage(removepkg, d) | 197 | pstage_cleanpackage(removepkg, d) |
175 | 198 | ||
176 | stagepkg = bb.data.expand("${PSTAGE_PKG}", d) | 199 | stagepkg = bb.data.expand("${PSTAGE_PKG}", d) |
200 | if not os.path.exists(stagepkg): | ||
201 | staging_fetch(stagepkg, d) | ||
177 | 202 | ||
178 | if os.path.exists(stagepkg): | 203 | if os.path.exists(stagepkg): |
179 | path = bb.data.getVar("PATH", d, 1) | 204 | path = bb.data.getVar("PATH", d, 1) |