Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archive
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-14 15:55:47 +0200
committerErich Eckner <git@eckner.net>2019-05-14 15:55:47 +0200
commit442c44aad056639748f91ca39c681215f042fc86 (patch)
treeae623817576a3a77cceb4a0bc46f1bd07d0a346c /archive
parentb4e392fc2086e685c16c388c9736e95b8e749f4b (diff)
archive: symlinks for last, week and month repos
Diffstat (limited to 'archive')
-rwxr-xr-xarchive40
1 files changed, 40 insertions, 0 deletions
diff --git a/archive b/archive
index 4b7aef4..c2e810e 100755
--- a/archive
+++ b/archive
@@ -86,6 +86,46 @@ if [ ! -d "${todays_path}" ]; then
done
done
done
+ rm -f \
+ "${archive_root}/repos/last" \
+ "${archive_root}/repos/week" \
+ "${archive_root}/repos/month"
+ ln -s \
+ "${todays_path}" \
+ "${archive_root}/repos/last"
+ first_of_month=$(
+ find "${archive_root}/repos" -mindepth 3 -maxdepth 3 \
+ | sed '
+ s,^.*/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)$,\1/\2 \3,
+ t
+ d
+ ' \
+ | sort -k1r,1 -k2,2 \
+ | head -n1 \
+ | tr ' ' '/'
+ )
+ ln -s \
+ "${archive_root}/repos/${first_of_month}" \
+ "${archive_root}/repos/month"
+ first_of_week=$(
+ find "${archive_root}/repos" -mindepth 3 -maxdepth 3 \
+ | sed '
+ s,^.*/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)$,\1-\2-\3,
+ t
+ d
+ ' \
+ | sort \
+ | tail -n7 \
+ | while read -r date; do
+ date '+%Y/%m/%d %G %V' -d "${date}"
+ done \
+ | sort -k2r,3 -k1,1 \
+ | head -n1 \
+ | cut -d' ' -f1
+ )
+ ln -s \
+ "${archive_root}/repos/${first_of_week}" \
+ "${archive_root}/repos/week"
fi
# release lock