Skip to contentSkip to conversation

npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json from remote location

DISCUSSION TRO 1 participant 2 messages Mar 1, 2021

lore
Share & tools
lore

TRO

author
#0 lore raw

Hi,
bitbake fetcher for npmsw - npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json
wondering if it is possible to download npm-shrinkwrap.json from remote before evaluating it's dependencies. For instance - https, git.
Any ideas how to deal with that problem?
cheers Thomas

author
#1 lore raw

i did this:
addtask getsw after do_fetch before do_compile

python do_getsw() {
import os
bb.debug("downloading shrinkwrap file")
os.system ("git archive --remote=ssh://[email protected] HEAD frontend/npm-shrinkwrap.json | tar -xO > /tmp/npm-shrinkwrap.json_dwnl") src_uri_sw = {'npmsw:///tmp/npm-shrinkwrap.json_dwnl;dev=True'}

try:
fetcher = bb.fetch2.Fetch(src_uri_sw, d)
fetcher.download()
except bb.fetch2.BBFetchException as e:
bb.fatal(str(e))

try:
fetcher.unpack(d.getVar('WORKDIR'))
except bb.fetch2.BBFetchException as e:
bb.fatal(str(e))

bb.debug("src_uri: " + str(src_uri_sw))
}