Yay: Is it possible to keep the src directory?

Created on 13 Nov 2018  路  6Comments  路  Source: Jguer/yay

When I update a package from a git repository, the whole package is rebuilt every time. Is it possible to keep the src directory and to recompile only what needs to be recompiled? (Using makepkg -f, maybe)

Enhancement stale

Most helpful comment

I actually give it a go and keeping src around does indeed stop it from recompiling everything. Despite my assumption about the extracting updating mtime.

So such a flag would make sense then. --nocleanbuild I guess?

All 6 comments

That's a makepkg function.
-e, --noextract Do not extract source files (use existing $srcdir/ dir)

yay -S somepackage-git --mflags="-e" --save

Then you don't need to specify it again. That saves it to the configuration file.

EDIT: Derp. See below.

Did you test that? Keeping the src directory is actually default makepkg behaviour (Although yes you are correct in the fact that you'd need to also use -e to avoid re-extracting). Yay explicitly uses -C/-c to clean up src/pkg after it's done and there's no flag to stop that.

So while -e would be going in the right direction It's not possible to use it with yay.

Not that I have tested this but I would assume this is actually impossible even with makepkg. Yes -e would work, but then you can't build anything apart from the current version you previously extracted. If you instead just keep the src dir then the re-extract. Each file is going to get its mtime updated, causing make or whatever to rebuild everything anyway.

I don't think the -e flag is necessary, and as @Morganamilo said, it would allow building only the version previously extracted. After I install a git package once with makepkg and delete the .tar.xzarchive created, the package will not be rebuilt from scratch on further calls of makepkg. So maybe all that is needed is an option to prevent yay from cleaning up src?

I actually give it a go and keeping src around does indeed stop it from recompiling everything. Despite my assumption about the extracting updating mtime.

So such a flag would make sense then. --nocleanbuild I guess?

So such a flag would make sense then. --nocleanbuild I guess?

That would be great. :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrienLemaire picture AdrienLemaire  路  3Comments

renom picture renom  路  3Comments

pantuts picture pantuts  路  3Comments

mmirate picture mmirate  路  3Comments

makeworld-the-better-one picture makeworld-the-better-one  路  3Comments