Пример #1
0
 def _remove(self, pkg):
     yum.YumPackager._remove(self, pkg)
     options = pkg.get('packager_options') or {}
     links = options.get('links') or []
     for entry in links:
         if sh.islink(entry['target']):
             sh.unlink(entry['target'])
Пример #2
0
 def _remove(self, pkg):
     response = yum.YumPackager._remove(self, pkg)
     if response:
         options = pkg.get('packager_options', {})
         links = options.get('links', [])
         for entry in links:
             src = entry['source']
             tgt = entry['target']
             if sh.islink(tgt):
                 sh.unlink(tgt)
     return response
Пример #3
0
 def _install(self, pkg):
     yum.YumPackager._install(self, pkg)
     options = pkg.get('packager_options', {})
     links = options.get('links', [])
     for entry in links:
         src = entry['source']
         tgt = entry['target']
         if not sh.islink(tgt):
             # This is actually a feature, EPEL must not conflict
             # with RHEL, so X pkg installs newer version in
             # parallel.
             #
             # This of course doesn't work when running from git
             # like anvil does....
             sh.symlink(src, tgt)
     return True
Пример #4
0
 def _install(self, pkg):
     yum.YumPackager._install(self, pkg)
     options = pkg.get('packager_options') or {}
     links = options.get('links') or []
     for entry in links:
         tgt = entry.get('target')
         src = entry.get('source')
         if not tgt or not src:
             continue
         src = glob.glob(src)
         if not isinstance(tgt, (list, tuple)):
             tgt = [tgt]
         if len(src) != len(tgt):
             raise RuntimeError("Unable to link %s sources to %s locations" % (len(src), len(tgt)))
         for i in range(len(src)):
             i_src = src[i]
             i_tgt = tgt[i]
             if not sh.islink(i_tgt):
                 sh.symlink(i_src, i_tgt)