Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 858698 Details for
Bug 1060801
[RFE] Support for relative symlinks of RPMs in yum distributor
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
patch against 2.3 branch
pulp-relative-symlinks.patch (text/plain), 3.59 KB, created by
Dennis Gregorovic
on 2014-02-03 16:24:50 UTC
(
hide
)
Description:
patch against 2.3 branch
Filename:
MIME Type:
Creator:
Dennis Gregorovic
Created:
2014-02-03 16:24:50 UTC
Size:
3.59 KB
patch
obsolete
>diff --git a/pulp_rpm/plugins/distributors/yum_distributor/distributor.py b/pulp_rpm/plugins/distributors/yum_distributor/distributor.py >index 218240e..988c018 100644 >--- a/pulp_rpm/plugins/distributors/yum_distributor/distributor.py >+++ b/pulp_rpm/plugins/distributors/yum_distributor/distributor.py >@@ -342,7 +342,8 @@ class YumDistributor(Distributor): > drpm_units = publish_conduit.get_units(criteria=criteria) > pkg_units += drpm_units > # Create symlinks under repo.working_dir >- pkg_status, pkg_errors = self.handle_symlinks(pkg_units, repo.working_dir, progress_callback) >+ _LOG.info("%s %s" % (pkg_units, repo.working_dir)) >+ pkg_status, pkg_errors = self.handle_symlinks(pkg_units, repo.working_dir, progress_callback, relative_symlinks=config.get('relative_symlinks')) > if not pkg_status: > _LOG.error("Unable to publish %s items" % (len(pkg_errors))) > >@@ -483,7 +484,7 @@ class YumDistributor(Distributor): > if progress_callback: > progress_callback(type_id, status) > >- def handle_symlinks(self, units, symlink_dir, progress_callback=None): >+ def handle_symlinks(self, units, symlink_dir, progress_callback=None, relative_symlinks=False): > """ > @param units list of units that belong to the repo and should be published > @type units [AssociatedUnit] >@@ -515,7 +516,7 @@ class YumDistributor(Distributor): > continue > _LOG.debug("Unit exists at: %s we need to symlink to: %s" % (source_path, symlink_path)) > try: >- if not util.create_symlink(source_path, symlink_path): >+ if not util.create_symlink(source_path, symlink_path, relative=relative_symlinks): > msg = _("Unable to create symlink for: %(symlink_path)s" > " pointing to %(source_path)s" % {'symlink_path': symlink_path, > 'source_path': source_path}) >@@ -527,7 +528,7 @@ class YumDistributor(Distributor): > > if self.package_dir is not None: > symlink_path = os.path.join(symlink_dir, self.package_dir, relpath) >- if not util.create_symlink(source_path, symlink_path): >+ if not util.create_symlink(source_path, symlink_path, relative=relative_symlinks): > msg = _("Unable to create symlink for: %(symlink_path)s" > " pointing to %(source_path)s" % {'symlink_path': symlink_path, > 'source_path': source_path}) >diff --git a/pulp_rpm/src/pulp_rpm/yum_plugin/util.py b/pulp_rpm/src/pulp_rpm/yum_plugin/util.py >index 93fdbb6..b98b540 100644 >--- a/pulp_rpm/src/pulp_rpm/yum_plugin/util.py >+++ b/pulp_rpm/src/pulp_rpm/yum_plugin/util.py >@@ -219,7 +219,7 @@ def cleanup_file(file_path): > except (OSError, IOError), e: > _LOG.info("Error [%s] trying to clean up file path [%s]" % (e, file_path)) > >-def create_symlink(source_path, symlink_path): >+def create_symlink(source_path, symlink_path, relative=False): > """ > @param source_path source path > @type source_path str >@@ -232,6 +232,8 @@ def create_symlink(source_path, symlink_path): > """ > if symlink_path.endswith("/"): > symlink_path = symlink_path[:-1] >+ if relative: >+ source_path = os.path.relpath(source_path, symlink_path) > if os.path.lexists(symlink_path): > if not os.path.islink(symlink_path): > _LOG.error("%s is not a symbolic link as expected." % (symlink_path))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1060801
: 858698