#325 Attempt 2: Update epel-release-latest-<rel>.noarch.rpm on /pub/epel
Merged 3 years ago by mohanboddu. Opened 3 years ago by mohanboddu.
fedora-infra/ mohanboddu/ansible el6-eol  into  master

@@ -13,6 +13,7 @@ 

  import fedora_messaging.config

  import fedora_messaging.exceptions

  

+ from pathlib import Path

  

  logging.basicConfig(level=logging.ERROR)

  logger = logging.getLogger('updates-sync')
@@ -393,6 +394,20 @@ 

  

      return needssync

  

+ def update_epel_release_latest(releases):

+     for release in releases:

+         if 'epel' in release:

+             for path in Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*'):

+                 if 'Packages' in str(path) and 'x86_64' in str(path):

+                     dest = '/pub/epel/epel-release-latest-' + release[4]+ '.noarch.rpm'

+                     if os.path.exists(dest):

+                         if not os.path.exists(os.readlink(dest)):

+                             os.remove(dest)

+                             os.symlink(os.path.relpath(path, os.path.dirname(dest)), dest)

+                             break

+                     else:

+                         os.symlink(os.path.relpath(path, os.path.dirname(dest)), dest)

+                         break

  

  def main():

      parser = argparse.ArgumentParser()
@@ -418,7 +433,7 @@ 

      to_update = list(set(to_update))

      logger.info('Filelists to update: %s', to_update)

      update_fullfilelist(to_update)

- 

+     update_epel_release_latest(args.releases)

  

  if __name__ == '__main__':

      main()

Use the relative path to symlink and only use x86_64/ dir for symlinking

This reverts commit 297a736.

This still looks like a absolute link... can you change it to a relative one?

@kevin its using a relative path - os.path.relpath(path, os.path.dirname(dest))

Yeah, I see... looks good, please merge and run playbooks and... watch to make sure there's no issues. ;)

rebased onto b05f8e9

3 years ago

rebased onto b05f8e9

3 years ago

Pull-Request has been merged by mohanboddu

3 years ago