Skip to content

Only perform cache directory diskspace check when a download is necessary. #334

Description

@prestonsn

Is your feature request related to a problem? Please describe.

Current behaviour of the check introduced by #321 will verify diskspace regardless of if a download (and hence the cache directory size change) takes place. The call as it is right now looks like:

pSolvedPkgInfo->nNeedDownload =
    pSolvedPkgInfo->pPkgsToInstall ||
    pSolvedPkgInfo->pPkgsToUpgrade ||
    pSolvedPkgInfo->pPkgsToDowngrade ||
    pSolvedPkgInfo->pPkgsToReinstall;

if (pSolvedPkgInfo->nNeedDownload)
{
    dwError = TDNFCheckDownloadCacheBytes(pSolvedPkgInfo, qwAvailCacheBytes);
    BAIL_ON_TDNF_ERROR(dwError);
}

As mentioned in this comment #321 (comment):

I am wondering about corner cases:

* if the file is already downloaded to cache, would this check for remaining space even though download isn't needed?

* similar, if we do `tdnf install ./foo-1.2.3.rpm` or `tdnf install file:///some/path/foo-1.2.3.rpm` we don't download, so no need to check for the size. I don't think this is addressed.

One solution may be to move the TDNFCheckDownloadCacheBytes() call to right before libcurl is used to fetch the package from the repository.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions