Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prestonsn opened this issue Jul 11, 2022 · 0 comments

Comments

@prestonsn
Copy link
Contributor

prestonsn commented Jul 11, 2022

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.

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

No branches or pull requests

1 participant