Skip to content

beesh: Abort if download fails #58

Merged
merged 1 commit into from
Oct 19, 2023
Merged

beesh: Abort if download fails #58

merged 1 commit into from
Oct 19, 2023

Commits on Oct 18, 2023

  1. beesh: Abort if download fails

    Currently, bee doesn't detect the situation when a partial file is
    downloaded. An incomplete archive usually makes the following extract to
    fail, but the broken file is kept in the cache an needs to be removed
    manually. Only the the situation, when a failed download produced an
    empty file is explicitly handled.
    
    Currently, bee contains explicit code to ignore errors from wget.  This
    code existed in the initial commit 067ccf2 ("initial revision") from
    2010. The probably reason for it is, that the option `--no-globber` is
    used to avoid downloading a file, which already exists, a second time.
    However, wget terminates with a non-zero exit status in that case.
    
    Handle the case of an existing file in the calling code, so that we can
    treat any wget error as a real error and abort (by the `-e` setting of
    the shell).
    
    While we are at it, change code to download into a tempfile and rename
    it in the success case to avoid problems with partial downloads. This is
    more robust than the EXIT trap used by current code.
    donald committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    2cc1246 View commit details
    Browse the repository at this point in the history