Sample Header Ad - 728x90

How to move a package's local git repo to another builddir and skip redownloading it yay or pacman?

0 votes
1 answer
363 views
I am using Arch. Last night I started installing a package whose repo size is ~2GB, but my internet connection is very slow, so I let it run overnight. It finished the download, but timed out at the sudo password prompt. Normally I would simply rerun it and let it do its thing, but when I tried that, the installation failed because the partition where yay's cache resides is quite full, so the package cannot be built there. That would've happened anyway, obviously, regardless of the timeout. I'm curious is it possible to move the downloaded repo to a different partition, and tell yay to continue where it left off, or, alternatively, if I can finish the build manually without breaking anything (e.g. yay's awareness of installed packages). I googled around a bit, and found the --builddir flag, so I tried simply giving it an alternate build directory on another partition. That did what I expected, but it still had to redownload everything. So I aborted it and copied the package repository (the one downloaded overnight) to that directory and ran yay again, hoping it would recognize the repository and continue where it left off. But it got confused because the branch name was the same as the directory name:
error resetting : fatal: ambiguous argument 'HEAD': both revision and filename
Use '--' to separate paths from revisions, like this:
'git  [...] -- [...]'
Finally, I tried running the installation manually by running makepkg -si in that alternative builddir, and I got the following error:
ERROR: /path/to/builddir/package is not a clone of git://
    Aborting...
I'll just delete everything and redownload it to the alternate builddir, but I'm curious what would be the best way to install the package without redownloading everything if I really had to.
Asked by ReoTheYokel (25 rep)
Mar 8, 2021, 07:07 AM
Last activity: Mar 8, 2021, 10:57 AM