Bug 11407

Summary: devtool should warn user of prior download after reset
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Brian Kurle <brianx.j.kurle>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, randy.macleod, sgw
Version: 2.4   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard: .
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Brian Kurle 2017-04-24 23:05:10 UTC
devtool reset [-a|<recipe>] will warn user that the sources/<recipe> will be left behind.  Moreover, subsequent issuance of a 'devtool add' will error out on the prior sources/ directory.

However, if the sources/ is removed, and a new 'devtool add' with a corrected URI for the recipe is given, it will use the prior "cached" downloaded version with no failure or warning.

E.g.,

$ devtool add --version 2.4.2 mbedtls https://tls.mbed.org/download/start/mbedtls-2.4.2-apache.tgz
# (downloads a landing page, not the desired tarball)

$ devtool reset -a
NOTE: Cleaning sysroot for recipe mbedtls...
NOTE: Leaving source tree /home/bjkurlex/mbedtls/dev2/workspace/sources/mbedtls as-is; if you no longer need it then please delete it manually

An additional NOTE: here to warn the user that a prior version of the downloaded file (whether valid or not) is left as well.  

Otherwise, it is is assumed (even after removing the aforementioned sources/ directory) that a new "corrected" add will work.

# issuing "corrected" URI
$ devtool add --version 2.4.2 mbedtls https://tls.mbed.org/download/mbedtls-2.4.2-apache.tgz

This will fail and isn't obvious to a new user that the prior downloaded version is negating the corrected URI even though the sources directory previously warned was removed.

Another approach is to cache the URI associated with the download and if the URI changes (but the file does not), then it should be redownloaded.
Comment 1 Paul Eggleton 2017-07-21 08:35:05 UTC
FWIW I have fixed an aspect of this which is handling of URLs that return an HTML page:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=047d37633b2d451ee4f53c635d3f48b9b0732e44

The underlying issue of a previously downloaded file with the same name is still present however.
Comment 2 Randy MacLeod 2022-06-23 15:13:07 UTC
A real bug...
Comment 3 Randy MacLeod 2023-10-24 14:24:21 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 4 Randy MacLeod 2025-02-14 16:46:27 UTC
bulk change to add Saul's non-WR address.
Comment 5 Randy MacLeod 2025-02-14 16:48:09 UTC
Bulk change: Remove Saul's old WR address.