diff --git a/_webi/installers.js b/_webi/installers.js index 35b222a..0bbed6c 100644 --- a/_webi/installers.js +++ b/_webi/installers.js @@ -16,7 +16,7 @@ var BAD_SH_RE = /[<>'"`$\\]/; Installers.renderBash = async function ( pkgdir, rel, - { baseurl, pkg, tag, ver, os = '', arch = '', libc = '', formats, latest }, + { baseurl, pkg, tag, ver, os = '', arch = '', libc = '', formats }, ) { if (!Array.isArray(formats)) { formats = []; @@ -99,11 +99,12 @@ Installers.renderBash = async function ( ['WEBI_PKG_PATHNAME', pkgFile], ['WEBI_PKG_FILE', pkgFile], // TODO replace with pathname ['PKG_NAME', pkg], + ['PKG_STABLE', rel.stable], + ['PKG_LATEST', rel.latest], ['PKG_OSES', (rel.oses || []).join(' ')], ['PKG_ARCHES', (rel.arches || []).join(' ')], ['PKG_LIBCS', (rel.libcs || []).join(' ')], ['PKG_FORMATS', (rel.formats || []).join(' ')], - ['PKG_LATEST', latest], ]; for (let env of envReplacements) { diff --git a/_webi/package-install.tpl.sh b/_webi/package-install.tpl.sh index 38b90e2..ef45a46 100644 --- a/_webi/package-install.tpl.sh +++ b/_webi/package-install.tpl.sh @@ -36,7 +36,7 @@ __bootstrap_webi() { fi fi - WEBI_PKG_PATH="${WEBI_DOWNLOAD_DIR}/webi/${PKG_NAME:-error}/${WEBI_VERSION:-latest}" + WEBI_PKG_PATH="${WEBI_DOWNLOAD_DIR}/webi/${PKG_NAME:-error}/${WEBI_VERSION:-stable}" # get the special formatted version # (i.e. "go is go1.14" while node is "node v12.10.8") @@ -127,7 +127,10 @@ __bootstrap_webi() { echo "" echo " $(t_err "Error: no '${PKG_NAME:-"Unknown Package"}@${WEBI_TAG:-"Unknown Tag"}' release for '${WEBI_OS:-"Unknown OS"}' (${WEBI_LIBC:-"Unknown Libc"}) on '${WEBI_ARCH:-"Unknown CPU"}' as one of '${WEBI_FORMATS:-"Unknown File Type"}'")" echo "" - echo " Latest Version: ${PKG_LATEST}" + echo " Latest Stable: ${PKG_STABLE}" + if test "${PKG_LATEST}" != "${PKG_STABLE}"; then + echo " Next Version: ${PKG_LATEST}" + fi echo " CPUs: $PKG_ARCHES" echo " OSes: $PKG_OSES" echo " libcs: $PKG_LIBCS" diff --git a/_webi/serve-installer.js b/_webi/serve-installer.js index eae8519..2193999 100644 --- a/_webi/serve-installer.js +++ b/_webi/serve-installer.js @@ -120,8 +120,7 @@ InstallerServer.helper = async function ({ name: projectName, date: new Date(), }); - let latest = projInfo.versions[0]; - Object.assign(tmplParams, { latest }); + let latestVersions = Builds.enumerateLatestVersions(projInfo); //console.log('projInfo', projInfo); let buildTargetInfo = { @@ -130,6 +129,8 @@ InstallerServer.helper = async function ({ arches: projInfo.arches, libcs: projInfo.libcs, formats: projInfo.formats, + latest: latestVersions.latest, + stable: latestVersions.stable, }; // TODO .findMatchingPackages() should probably account for this