Attempt 2: Update epel-release-latest-<rel>.noarch.rpm on /pub/epel
Use the relative path to symlink and only use x86_64/ dir for symlinking
This reverts commit 297a736e80
.
This commit is contained in:
parent
bd0219f65f
commit
b05f8e93f6
1 changed files with 16 additions and 1 deletions
|
@ -13,6 +13,7 @@ import fedora_messaging.api
|
||||||
import fedora_messaging.config
|
import fedora_messaging.config
|
||||||
import fedora_messaging.exceptions
|
import fedora_messaging.exceptions
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.ERROR)
|
||||||
logger = logging.getLogger('updates-sync')
|
logger = logging.getLogger('updates-sync')
|
||||||
|
@ -393,6 +394,20 @@ def sync_single_release(release):
|
||||||
|
|
||||||
return needssync
|
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():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -418,7 +433,7 @@ def main():
|
||||||
to_update = list(set(to_update))
|
to_update = list(set(to_update))
|
||||||
logger.info('Filelists to update: %s', to_update)
|
logger.info('Filelists to update: %s', to_update)
|
||||||
update_fullfilelist(to_update)
|
update_fullfilelist(to_update)
|
||||||
|
update_epel_release_latest(args.releases)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue