catalyst-auto: Combine common functions

Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
Matt Turner 2019-09-01 19:04:59 -07:00
parent 41cdecd812
commit 492aacba77
20 changed files with 19 additions and 277 deletions

View file

@ -13,25 +13,6 @@ OPTIONAL_SPECS="ppc32/installcd-stage1.spec ppc32/installcd-stage2-minimal.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/powerpc
EMAIL_SUBJECT_PREPEND="[ppc-auto]"
give_latest_from_dates() {
sed 's,-20,~20,g' | \
sort -k +1 -n -t '~' |\
awk -F\~ \
'BEGIN{i=$1; o=$0};
{ if($1 != i && i != "") { print o; }; i=$1; o=$0; }
END { print o; };' | \
tr '~' '-'
}
# Replace the date/time stamp in the filename to "latest".
# Forms we handle:
# stage3-xxx-2018.0.tar.xz
# stage3-xxx-20180116.tar.xz
# stage3-xxx-20180116T015819Z.tar.xz
convert_filename() {
sed -E 's:-20[0-9]+(\.[0-9]+|T[0-9]+Z)?:-latest:g'
}
update_symlinks() {
# Symlink the latest stages3 to build from