Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 473878 - sparse file support in ebuilds
Summary: sparse file support in ebuilds
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 23:01 UTC by Patrick McLean
Modified: 2017-12-08 10:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McLean gentoo-dev 2013-06-19 23:01:54 UTC
It would be useful to sometimes install a sparse file via portage, currently portage will copy the contents of the file, expanding the space usage to the full size.

My proposal would be to add a SPARSE ebuild variable containing a list of paths, relative to the image directory that should be installed as sparse files. The behaviour of this should like cp --sparse=always, as in it replaces any long strings of null characters in the source file with seeks in the destination file.

If and when this: http://bugs.python.org/issue10016 upstream python bug gets fixed, this will no longer be necessary for portage. Though other package managers copy files in other ways may need modification to properly support sparse files.
Comment 1 SpanKY gentoo-dev 2013-06-20 00:36:55 UTC
(In reply to Patrick McLean from comment #0)

i don't think we'd have to make it a variable for people to opt into -- let the tools do it automatically.  latest `cp` should be able to detect it sanely.
Comment 2 Ulrich Müller gentoo-dev 2013-06-20 06:14:50 UTC
PMS doesn't specify the method used for merging, see <http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-15100012.3>. I'd also say that we shouldn't add a variable, but that package managers should just use the cp heuristic, i.e. behave like cp --sparse=auto (which is the default).
Comment 3 Ciaran McCreesh 2013-06-20 06:19:00 UTC
We shouldn't be encouraging package manglers to use 'cp' to do installs, though.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-06-20 09:19:24 UTC
Out of curiosity, what is the use case?
Comment 5 SpanKY gentoo-dev 2013-06-20 20:18:00 UTC
(In reply to Ciaran McCreesh from comment #3)

seems like another case (akin to bug 465000) where the feature set of `cp` and `install` are not aligned.  adding --sparse to `install` upstream shouldn't be too difficult ...
Comment 6 Zac Medico gentoo-dev 2017-12-08 10:14:15 UTC
In portage-2.3.17[native-extensions], doins supports sparse files due to this commit from bug 624526:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8f9d69d760a772aa4bcc695d2ac655a9f89e8d9