[bitbake-devel] [PATCH] fetch/wget: Start to clean up command construction
Richard Purdie
richard.purdie at linuxfoundation.org
Sun Mar 9 18:13:31 UTC 2014
On Thu, 2014-03-06 at 21:41 +0100, Kristof Robot wrote:
> >Start to clean up wget fetcher command construction to allow clearer
> >and more extensible code structure. Drops support for ${URI} and
> >${FILE} directly in the commands.
> >
> >Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
> >[...]
> > if not checkonly and 'downloadfilename' in ud.parm:
> > dldir = d.getVar("DL_DIR", True)
> > bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
> >- basecmd += " -O " + dldir + os.sep + ud.localfile
> >+ fetchcmd += " -O " + dldir + os.sep + ud.localfile
> >
> >+ uri = ud.url.split(";")[0]
> > if checkonly:
> >- fetchcmd = d.expand(basecmd + " --spider '${URI}'")
> >+ fetchcmd = self.basecmd + " --spider '%s'" % uri
> > elif os.path.exists(ud.localpath):
> > # file exists, but we didnt complete it.. trying again..
> >- fetchcmd = d.expand(basecmd + " -c -P ${DL_DIR} '${URI}'")
> >+ fetchcmd = self.basecmd + d.expand(" -c -P ${DL_DIR} '%s'" % uri)
> > else:
> >- fetchcmd = d.expand(basecmd + " -P ${DL_DIR} '${URI}'")
> >-
>
> This patch breaks the "downloadfilename" functionality, as the
> fetchcmd append in the first if structure will be overwritten by the
> fetchcmd assignments in the second if structure, effectively losing
> the appended information.
>
> As a quick fix, I replaced
>
> fetchcmd += " -O " + dldir + os.sep + ud.localfile
>
> by
>
> self.basecmd += " -O " + dldir + os.sep + ud.localfile
>
> but there might be a better way of resolving this?
Thanks, looking at the code I think I was intending it to work
differently but confused things somewhere through the various patches.
I've pushed a fix that should resolve this, thanks for the report!
Cheers,
Richard
More information about the bitbake-devel
mailing list