Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild-all6
-rwxr-xr-xcleanup-isos50
2 files changed, 29 insertions, 27 deletions
diff --git a/build-all b/build-all
index b0a19d6..ba4b725 100755
--- a/build-all
+++ b/build-all
@@ -221,9 +221,9 @@ date +%s > "${ARCHISOS_DIR}/lastupdate"
# cleanup mirror and move old ISOs to the archive
echo "Cleaning up old ISOs and pushing them into the archive"
-#~ "${base_dir}/cleanup-isos" \
- #~ --mirror-dir="/srv/http/mirror/mirror.archlinux32.org" \
- #~ --archive-dir="/srv/http/mirror/archive.archlinux32.org/iso"
+ "${base_dir}/cleanup-isos" \
+ --mirror-dir="/srv/http/mirror/mirror.archlinux32.org" \
+ --archive-dir="/srv/http/mirror/archive.archlinux32.org"
# set permissions correctly of all generated or changed fles
echo "Fixing/setting permissions.."
diff --git a/cleanup-isos b/cleanup-isos
index 5b46a8e..d135a7d 100755
--- a/cleanup-isos
+++ b/cleanup-isos
@@ -2,7 +2,7 @@
# parameters
MIRROR_DIR="/srv/http/mirror/mirror.archlinux32.org"
-ARCHIVE_DIR="/srv/http/mirror/archive.archlinux32.org/iso"
+ARCHIVE_DIR="/srv/http/mirror/archive.archlinux32.org"
usage() {
>&2 echo ""
@@ -72,30 +72,32 @@ if [ $# -gt 0 ]; then
exit 2
fi
-echo "checking for old isos in '${mirror_dir}'..."
+archiso_dir="${mirror_dir}/archisos/"
+archived_archiso_dir="${archive_dir}/iso/"
+
+echo "checking for old isos in '${archiso_dir}'..."
+
+find "${archiso_dir}" \( -name 'archlinux32-*' -o -name 'archlinux-*' \) -not -name 'archlinux32-'"${date}"'-*' \
+| while read -r to_delete; do
+ archived_file="${archived_archiso_dir}/${to_delete#${archiso_dir}/}"
+ if [ -f "${to_delete}" -a -f "${archived_file}" ]; then
+ if diff -q "${to_delete}" "${archived_file}" >/dev/null; then
+ rm "${to_delete}"
+ printf '%s\n' "${to_delete}" \
+ | sed '
+ s@^.*/@@
+ s/\./\\./g
+ s@.*@/ \0$/d@
+ '
+ fi
+ fi
+done \
+>> "${tmp_dir}/delete-regex"
+sed -i -f "${tmp_dir}/delete-regex" "${archiso_dir}/sha512sums"
+sed -i -f "${tmp_dir}/delete-regex" "${archiso_dir}/md5sums"
+
+echo '... done.'
exit 0
-#--TODO FROM HERE
-
- find "${destination}" \( -name 'archlinux32-*' -o -name 'archlinux-*' \) -not -name 'archlinux32-'"${date}"'-*' \
- | while read -r to_delete; do
- if diff -q "${to_delete}" "${archive}/iso/${to_delete#${destination}/}" >/dev/null; then
- rm "${to_delete}"
- printf '%s\n' "${to_delete}" \
- | sed '
- s@^.*/@@
- s/\./\\./g
- s@.*@/ \0$/d@
- '
- fi
- done \
- >> "${tmp_dir}/delete-regex"
- sed -i -f "${tmp_dir}/delete-regex" "${destination}/sha512sums"
- sed -i -f "${tmp_dir}/delete-regex" "${destination}/md5sums"
-
- echo '... done.'
- ;;
-
-