Subject: Re: npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json from remote location To: yocto@lists.yoctoproject.org From: "TRO" X-Originating-Location: Würzburg, Bavaria, DE (212.63.82.130) X-Originating-Platform: Linux Firefox 85 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 01 Mar 2021 07:40:38 -0800 References: In-Reply-To: Message-ID: <29103.1614613238156296740@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="hLHnUntCqy9l6gZTgH4P" --hLHnUntCqy9l6gZTgH4P Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=3Dssh://git@gitXXX.git HEAD frontend/npm-= shrinkwrap.json | tar -xO > /tmp/npm-shrinkwrap.json_dwnl") src_uri_sw =3D {'npmsw:///tmp/npm-shrinkwrap.json_dwnl;dev=3DTrue'} try: fetcher =3D 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)) } --hLHnUntCqy9l6gZTgH4P Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable i did this:
addtask getsw after do_fetch before do_compile

= python do_getsw() {
    import os
  &nbs= p; bb.debug("downloading shrinkwrap file")
    os.syste= m ("git archive --remote=3Dssh://git@gitXXX.git HEAD frontend/npm-shrinkwra= p.json | tar -xO > /tmp/npm-shrinkwrap.json_dwnl")
  &nbs= p; src_uri_sw =3D {'npmsw:///tmp/npm-shrinkwrap.json_dwnl;dev=3DTrue'}
    
    try:
   &n= bsp;    fetcher =3D bb.fetch2.Fetch(src_uri_sw, d)
&nbs= p;       fetcher.download()
  =   except bb.fetch2.BBFetchException as e:
    = ;    bb.fatal(str(e))

    try:&nbs= p;       
     =    fetcher.unpack(d.getVar('WORKDIR'))
    ex= cept bb.fetch2.BBFetchException as e:
     &n= bsp;  bb.fatal(str(e))
       =          
    b= b.debug("src_uri: " + str(src_uri_sw))
} --hLHnUntCqy9l6gZTgH4P--