I'm working on a yum-utils patch to the 'reposync' utility that might
have an interesting connection with Cobbler's YUM repo mirroring and
hardlink-creation functions.
My 'reposync' patch adds a command-line option ('--package-cache
<PATH>') in which it looks for any existing local RPM files. Before
trying to download an RPM file, 'reposync' checks whether a file
matching that name, size, and checksum already exists, locally. If
so, 'reposync' will hard link to the existing file instead of
downloading a new copy. Multiple '--package-cache' options will work
fine, if you want to check against multiple directories. The search
for existing RPMs is recursive, and it follows directory symlinks but
not file symlinks.
The patch also implements an option to create symlinks to RPMs in
cases where hard links won't work--for instance, when there are local
RPM files on a loopback-mounted ISO.
Cobbler couldn't integrate this without a little work, though, since
it don't think the 'cobbler reposync' action allows us to pass
arbitrary options to 'reposync', either globally or on a per-repo
basis. (Correct me if I'm wrong, here--I'm using whatever version is
packaged in the current stable F11 repos.) Right now, I'd like to add
a per-repo config directive that accepts one ore more strings; each
string gets expanded to a list of directories as if you'd ran `find
<STRING> -mindepth 1 -maxdepth 1 -type d`; for each directory PATH,
Cobbler passes a '--package-cache <PATH>' option to 'reposync'. I'd
also like to have a boolean flag for the symlink option.
The 'reposync' patch is currently in a working state, and I'd like to
see it accepted soon, but I can't really say if/when that will happen.
I posted a copy to the YUM mailing list, earlier tonight, if anyone
wants to take a look.
Assuming the 'reposync' patch is accepted, does this seem like an
appropriate functionality for Cobbler? I think it would augment the
existing 'hardlink' support nicely, since it lets us take advantage of
existing copies to save downloading time/bandwidth as well as storage
space. If there's a decent chance that Cobbler would accept it, I'd
probably start drafting a patch, soon.
Ryan B. Lynch
[email protected]
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler