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

@ -165,6 +165,25 @@ parse_args() {
done
}
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.bz2
# stage3-xxx-20180116.tar.bz2
# stage3-xxx-20180116T015819Z.tar.bz2
convert_filename() {
sed -E 's:-20[0-9]+(\.[0-9]+|T[0-9]+Z)?:-latest:g'
}
# Let's get our own namespaces/etc... to avoid leaking crap.
containerize() {
# If we've already relaunched, nothing to do.

View file

@ -17,25 +17,6 @@ SET_default_SPECS="stage1.spec stage3.spec"
SET_default_OPTIONAL_SPECS="installcd-stage1.spec installcd-stage2-minimal.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/alpha
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.bz2
# stage3-xxx-20180116.tar.bz2
# stage3-xxx-20180116T015819Z.tar.bz2
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

View file

@ -40,16 +40,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/${ARCH}
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do

View file

@ -41,16 +41,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/${ARCH}
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do

View file

@ -15,25 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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.bz2
# stage3-xxx-20180116.tar.bz2
# stage3-xxx-20180116T015819Z.tar.bz2
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
local d f

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -15,17 +15,6 @@ SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
EMAIL_SUBJECT_PREPEND="[${SUBARCH}-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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/builds/default ; do

View file

@ -17,25 +17,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/hppa
EMAIL_SUBJECT_PREPEND="[hppa-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.bz2
# stage3-xxx-20180116.tar.bz2
# stage3-xxx-20180116T015819Z.tar.bz2
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
local d f t

View file

@ -12,25 +12,6 @@ OPTIONAL_SPECS="installcd-stage1.spec installcd-stage2-minimal.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/ia64
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.bz2
# stage3-xxx-20180116.tar.bz2
# stage3-xxx-20180116T015819Z.tar.bz2
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
local d f

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

View file

@ -14,25 +14,6 @@ SPECS="stage1.spec stage3.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/powerpc
EMAIL_SUBJECT_PREPEND="[ppc64le-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

View file

@ -12,25 +12,6 @@ SET_netboot_SPECS="netboot/netboot.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/s390
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
local d f

View file

@ -12,25 +12,6 @@ SET_netboot_SPECS="netboot/netboot.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/s390
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
local d f

View file

@ -10,25 +10,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/sparc
EMAIL_SUBJECT_PREPEND="[sparc-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
local d f

View file

@ -27,16 +27,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/${ARCH}
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do

View file

@ -27,16 +27,6 @@ KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/${ARCH}
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
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 '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do