Skip to content
Snippets Groups Projects
Commit 71a24b9f authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

update_repo: correct fix for missing metadata RPMs

On running update_repo tool with the given option to delete some RPMs
need to remove all files found by this given pattern. The loop checking
metadata deletes files, but only which were presented in it. However
it is possible that some broken update left orphan files: they are
present in the storage, but does not mentioned in the metadata.
parent c5d7e139
No related branches found
No related tags found
No related merge requests found
......@@ -871,6 +871,17 @@ function remove_rpm {
done
done
# Remove all files found by the given pattern in the options.
# The loop above already delete files, but only which were
# presented in the metadata. However it is possible that some
# broken update left orphan files: they are present in the
# storage, but does not mentioned in the metadata.
for suffix in 'x86_64' 'noarch' 'src'; do
file="$bucket_path/$packpath/${remove}-1.${os}${option_dist}.${suffix}.rpm"
$aws ls $file || continue
$aws rm $file
done
# check if any RPM files were newly registered
[ "$updated_rpms" == "0" ] && \
return || echo "Updating dists"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment