[Yum-devel] Patch: Hard-link packages that have already been downloaded.
Ryan Lynch
ryan.b.lynch at gmail.com
Fri Sep 18 00:33:43 UTC 2009
I've attached a patch against 'reposync.py' that implements a feature
I desperately need: Before attempting to download a package, the
'reposync' command can link to an existing local copy of the package,
if one exists. By default, it creates only hardlinks, so the existing
file and the repository must share a filesystem, but a command-line
option will allow symlinks when they don't.
The command-line option '--package-cache <DIR_PATH>' will tell
'reposync' where to look for existing packages, and it can be
specified multiple times. The command line option
'--cache-symlinks-ok' turns on symlinking for cases where hardlinks
won't work. The command-line option '--checksum' turns on
checksum-based integrity checking for verifying local package
sameness.
PLAGIARISM NOTE: I basically cribbed my entire effort from a patch
that Daniel Berrange originally submitted to this mailing list in 2007
[1]. Seth Vidal indicated that he approved of the general concept,
but requested that Daniel add a stronger integrity check for package
identity [2]. Several months later, Daniel submitted a new patch
implementing checksum verification [3], but I couldn't find a response
(acceptance or denial) in the mailing list archives. This
functionality is not part of the current source tree, so I'm assuming
that the whole thing just slipped through the cracks. In case he
maintains any interest in the patch, I've emailed Daniel for comments,
and I'm CCing him in case he doesn't follow the list.
However, my version is *NOT* exactly the same as Daniel's original
patch. I am working against the current source tree, roughly two
years later, so there are a few nominal differences. I also added the
option to make symlinks in cases where hardlinks aren't appropriate.
Also, I modified the local search function to follow directory
symlinks, which the original did not.
I have tested these changes locally, but not exhaustively. I am
willing to rework it, given some feedback about what's good/bad. I
don't have much experience in the YUM code, so I appreciate the chance
to learn.
-R
Ryan B. Lynch
ryan.b.lynch at gmail.com
[1] - http://lists.baseurl.org/pipermail/yum/2007-May/020949.html
[2] - http://lists.baseurl.org/pipermail/yum/2007-May/020951.html
[3] - http://lists.baseurl.org/pipermail/yum/2007-August/021162.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-utils_reposync.py_hardlink.diff
Type: text/x-patch
Size: 8810 bytes
Desc: not available
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20090917/2b2b6931/attachment-0001.bin>
More information about the Yum-devel
mailing list