vmware / vmware/tdnf

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

Open
#334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
130
Forks
55
Avg merge
1d 23h
Merged PRs (30d)
7

Description

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

Current behaviour of the check introduced by https://github.com/vmware/tdnf/pull/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 https://github.com/vmware/tdnf/pull/321#issuecomment-1179221201:

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing TDNFCheckDownloadCacheBytes() call and the repository download path where libcurl fetches packages. Ensure the cache-space check runs only when a package must actually be downloaded, including cases involving cached packages and local or file:// RPMs; verify the relevant install behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.