Red Hat Bugzilla – Bug 806740
Add separate "latest_link" entry to remote tree configuration
Last modified: 2012-03-26 19:51:33 EDT
PulpDist 0.0.7 uses the "listing_prefix" to determine both the directories to be retrieved from the upstream server *and* the name to be used for the symlink to the latest version for snapshot trees (calculated as "latest-<listing_prefix>").
It is not always desirable that these two values be the same, so a separate "latest_link" setting should be supported that allows the name used for the symlink to be specified explicitly (with the "latest-<listing_prefix>" behaviour being retained as a default).
On further reflection, these rare cases where the name differs between the source and local copy can be handled by creating a local unchanging symlink to the symlink that is dynamically updated by the PulpDist plugin.
Further investigation has now shown that the listing_prefix/suffix concept simply doesn't map properly to the intended use cases.
These attributes will be dropped in favour of the more general "listing_pattern" option, with a new "latest_link" attribute added to handle the correct naming of the symlink created to refer to the most recently synchronised directory for snapshot trees.
And now we come full circle: the listing prefix/suffix concept actually does cover the desired use cases, *as long as* the prefix is allowed to be a full rsync wildcard pattern.
That is not currently the case, since the prefix is *also* used to define the filename for the latest link, which obviously doesn't work if the prefix contains wildcard characters. The simplest solution is therefore to require that the latest link name be specified explicitly (allowing None to be passed to request that creation of the symbolic link be omitted entirely).
Fixed in 0.0.8 by allowing rsync wildcards in listing_prefix and adding a new latest_link attribute for remote trees (defaulting to None).
When deriving a repo config from a mirror config, latest_link_name is set only if the latest_link attribute is set to something other than none.