From c196be8798323bae0d74c7e2c44908da36845a87 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Wed, 6 Sep 2017 13:46:13 -0700 Subject: [PATCH] build_torcx_store: add package 'url' location This also moves the 'torcx' prefixing logic over to the torcx upload root introduced in the release util library. It also corrects a bug in how the source package was being determined. --- build_torcx_store | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/build_torcx_store b/build_torcx_store index f23cc79290..27cf9f6eaa 100755 --- a/build_torcx_store +++ b/build_torcx_store @@ -95,7 +95,7 @@ function torcx_package() { local version=${pkg:${#name}+1} local manifest_path="${2}" local type="${3}" - local deppkg digest file rpath sha512sum source_pkg tmproot tmppkgroot update_default + local deppkg digest file rpath sha512sum source_pkg rdepends tmproot tmppkgroot update_default local pkg_cas_file pkg_cas_root local pkg_locations=() local name=${name##*/} @@ -120,12 +120,14 @@ function torcx_package() { # Install the meta-package and its direct dependencies. for deppkg in "=${pkg}" $(torcx_dependencies "${pkg}") do - # The first file in an app-torcx package is, by convention, - # considered the source package. - [ -z "${source_pkg}" ] && source_pkg="${deppkg#=}" torcx_build "${tmproot}" "${deppkg}" done + # by convention, the first dependency in a torcx package is the primary + # source package + rdepends=($(torcx_dependencies "${pkg}")) + source_pkg="${rdepends[0]#=}" + # Pluck out shared libraries and SONAME links. sudo mv "${tmproot}"/{lib,tmplib} sudo rm -fr "${tmproot}/tmplib/debug" @@ -199,7 +201,9 @@ function torcx_package() { update_default=true pkg_locations+=("/usr/share/torcx/store/${name}:${version}.torcx.tgz") fi - # TODO: add upload bucket path to pkg_locations + if [[ "${FLAGS_upload}" -eq ${FLAGS_TRUE} ]]; then + pkg_locations+=("$(download_tectonic_torcx_url "pkg/${BOARD}/${name}/${digest}/${name}:${version}.torcx.tgz")") + fi torcx_manifest::add_pkg "${manifest_path}" \ "${name}" \ "${version}" \ @@ -236,21 +240,20 @@ set_build_symlinks latest "${FLAGS_group}-latest" # Upload the pkgs referenced by this manifest for pkg in $(torcx_manifest::get_pkg_names "${manifest_path}"); do - pkg_name="${pkgs[0]}" for digest in $(torcx_manifest::get_digests "${manifest_path}" "${pkg}"); do # no need to sign; the manifest includes their shasum and is signed. upload_files \ 'torcx pkg' \ - "${UPLOAD_ROOT}/torcx/pkg/${BOARD}/${pkg_name}/${digest}" \ + "${TORCX_UPLOAD_ROOT}/pkg/${BOARD}/${pkg}/${digest}" \ "" \ - "${TORCX_CAS_ROOT}/${pkg_name}/${digest}"/*.torcx.tgz + "${TORCX_CAS_ROOT}/${pkg}/${digest}"/*.torcx.tgz done done # Upload the manifest sign_and_upload_files \ 'torcx manifest' \ - "${UPLOAD_ROOT}/torcx/manifests/${BOARD}/${COREOS_VERSION}" \ + "${TORCX_UPLOAD_ROOT}/manifests/${BOARD}/${COREOS_VERSION}" \ "" \ "${manifest_path}"