bodhi2/backend: don't change epel-release-latest symlink if destination filename is the same
https://pagure.io/epel/issue/318 Signed-off-by: Carl George <carlwgeorge@gmail.com>
This commit is contained in:
parent
d11b793965
commit
092622b6bc
1 changed files with 4 additions and 4 deletions
|
@ -474,7 +474,7 @@ def get_epel_release_rel_path(release, epel_next=False):
|
||||||
else:
|
else:
|
||||||
for path in sorted(Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*')):
|
for path in sorted(Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*')):
|
||||||
if 'Packages' in str(path) and 'x86_64' in str(path):
|
if 'Packages' in str(path) and 'x86_64' in str(path):
|
||||||
abs_path = path
|
abs_path = str(path)
|
||||||
pkg_relpath = os.path.relpath(path,EPELDEST)
|
pkg_relpath = os.path.relpath(path,EPELDEST)
|
||||||
return abs_path, pkg_relpath
|
return abs_path, pkg_relpath
|
||||||
|
|
||||||
|
@ -504,14 +504,14 @@ def update_epel_release_latest(releases):
|
||||||
# For next's epel release, use the subpackage rpm from epel repo instead of
|
# For next's epel release, use the subpackage rpm from epel repo instead of
|
||||||
# epel next repo
|
# epel next repo
|
||||||
release = release[:-1]
|
release = release[:-1]
|
||||||
path, pkg_relpath = get_epel_release_rel_path(release, True)
|
abs_path, pkg_relpath = get_epel_release_rel_path(release, True)
|
||||||
else:
|
else:
|
||||||
dest = '/pub/epel/epel-release-latest-' + major + '.noarch.rpm'
|
dest = '/pub/epel/epel-release-latest-' + major + '.noarch.rpm'
|
||||||
path, pkg_relpath = get_epel_release_rel_path(release)
|
abs_path, pkg_relpath = get_epel_release_rel_path(release)
|
||||||
|
|
||||||
if os.path.lexists(dest) and os.path.islink(dest):
|
if os.path.lexists(dest) and os.path.islink(dest):
|
||||||
origin_dest = os.path.join(EPELDEST,os.readlink(dest))
|
origin_dest = os.path.join(EPELDEST,os.readlink(dest))
|
||||||
if origin_dest != str(path):
|
if os.path.split(origin_dest)[-1] != os.path.split(abs_path)[-1]:
|
||||||
os.remove(dest)
|
os.remove(dest)
|
||||||
os.symlink(pkg_relpath, dest)
|
os.symlink(pkg_relpath, dest)
|
||||||
elif os.path.lexists(dest) and not os.path.islink(dest):
|
elif os.path.lexists(dest) and not os.path.islink(dest):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue