Verified Commit 68895d3e authored by boklm's avatar boklm
Browse files

Bug 41604: Keep update-responses files from previous release

We were keeping update-responses directories from the previous release
if they are not in the new one, which happens when a release is not for
all platforms.

We were also keeping the `download-*.json` files. However, in the case
of android-only releases we also need to keep `downloads.json` and
`.htaccess`.

To simplify we now keep all files and directories from the previous
release which are not in the new one, including files starting with a
dot (such as `.htaccess`).
parent 04fdae04
Loading
Loading
Loading
Loading
+5 −15
Changes for tools/signing/upload-update_responses-to-staticiforme: 5 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -26,23 +26,13 @@ trap "rm -Rf $old_ur" EXIT
mv "$tbb_version_type" "$old_ur/$tbb_version_type"
tar -xf "$update_responses_tar"

# Keep download-*.json files from previous release if they are not in
# the new release. This happens when a release does not include some
# platforms. See tor-browser-build#41039.
IFS=$'\n'
for file in $(ls -1 "$old_ur/$tbb_version_type"/download-*.json)
do
  fname=$(basename "$file")
  test -f "$tbb_version_type/$fname" && continue
  mv "$file" "$tbb_version_type/$fname"
done

# Keep directory from previous release if they are not in the new release.
# Keep files and directories from previous release if they are not in
# the new release.
# This happens when a release does not include some platforms.
for file in $(ls -1 "$old_ur/$tbb_version_type")
IFS=$'\n'
for file in $(ls -a1 "$old_ur/$tbb_version_type")
do
  test -d "$old_ur/$tbb_version_type/$file" || continue
  test -d "$tbb_version_type/$file" && continue
  test -e "$tbb_version_type/$file" && continue
  mv -f "$old_ur/$tbb_version_type/$file" "$tbb_version_type/$file"
done