Publish aptly repos to enable reuse of prevously build packages
Signed-off-by: Scott Little <scott.little@windriver.com> Change-Id: I19c34523f389e0d7520b359e1d3ae37721168535
This commit is contained in:
parent
0d1d0e9f0c
commit
956f84754e
@ -98,8 +98,7 @@ publish_file() {
|
|||||||
find_publish_dirs() {
|
find_publish_dirs() {
|
||||||
find "$PUBLISH_ROOT" -mindepth 1 -maxdepth 1 \
|
find "$PUBLISH_ROOT" -mindepth 1 -maxdepth 1 \
|
||||||
-type d \
|
-type d \
|
||||||
-name '[0-9][0-9][0-9][0-9]*' \
|
-name '[0-9][0-9][0-9][0-9]*'
|
||||||
-not -name "$PUBLISH_TIMESTAMP"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
find_checksum_files() {
|
find_checksum_files() {
|
||||||
|
@ -20,6 +20,8 @@ unset GREP_OPTIONS GREP_COLORS GREP_COLOR
|
|||||||
|
|
||||||
DEB_REPO_ORIGIN="starlingx"
|
DEB_REPO_ORIGIN="starlingx"
|
||||||
|
|
||||||
|
APTLY_REPOS=("deb-local-build" "deb-local-source")
|
||||||
|
|
||||||
BUILD_TYPES=("std")
|
BUILD_TYPES=("std")
|
||||||
if $BUILD_RT || $BUILD_ISO; then
|
if $BUILD_RT || $BUILD_ISO; then
|
||||||
BUILD_TYPES+=("rt")
|
BUILD_TYPES+=("rt")
|
||||||
@ -179,6 +181,7 @@ publish_3rdparty_sources() {
|
|||||||
check_pipe_status || exit 1
|
check_pipe_status || exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_publish_3rdparty_sources() {
|
do_publish_3rdparty_sources() {
|
||||||
local src_dir="$1"
|
local src_dir="$1"
|
||||||
local dst_root_dir="$2"
|
local dst_root_dir="$2"
|
||||||
@ -204,6 +207,50 @@ do_publish_3rdparty_sources() {
|
|||||||
check_pipe_status || exit 1
|
check_pipe_status || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_publish_repo() {
|
||||||
|
local src_dir="$1"
|
||||||
|
local dst_dir_root="$2"
|
||||||
|
local checksums_filename="$3"
|
||||||
|
local published_checksum_files_list_file="$4"
|
||||||
|
|
||||||
|
local sub_path=""
|
||||||
|
local sub_dir=""
|
||||||
|
local dst_dir=""
|
||||||
|
|
||||||
|
mkdir -p "$dst_dir_root"
|
||||||
|
find "$src_dir" -type f \
|
||||||
|
| while read filename ; do
|
||||||
|
sub_path="${filename#$src_dir/}"
|
||||||
|
sub_dir="${sub_path%/*}"
|
||||||
|
dst_dir="$dst_dir_root/$sub_dir"
|
||||||
|
mkdir -p "$dst_dir"
|
||||||
|
publish_file "$filename" "$dst_dir" "$published_checksum_files_list_file" >>"$dst_dir/$checksums_filename" || exit 1
|
||||||
|
done
|
||||||
|
check_pipe_status || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
publish_aptly_public_repos() {
|
||||||
|
local checksum_files_list_file="$TEMP_DIR/published_package_checksum_files"
|
||||||
|
|
||||||
|
# Find old checksums
|
||||||
|
find_checksum_files "${PUBLISH_SUBDIR}/outputs/std/packages" \
|
||||||
|
"${PUBLISH_SUBDIR}/outputs/rt/packages" \
|
||||||
|
"${PUBLISH_SUBDIR}/outputs/aptly" \
|
||||||
|
>"$checksum_files_list_file" || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
# copy/link package files
|
||||||
|
local aptly_repo
|
||||||
|
for aptly_repo in "${APTLY_REPOS[@]}" ; do
|
||||||
|
notice "publishing aptly repo $aptly_repo"
|
||||||
|
local repo_src_dir="$BUILD_OUTPUT_HOME/aptly/public/$aptly_repo"
|
||||||
|
local repo_dst_dir="$PUBLISH_DIR/outputs/aptly/$aptly_repo"
|
||||||
|
|
||||||
|
do_publish_repo "$repo_src_dir" "$repo_dst_dir" \
|
||||||
|
"$CHECKSUMS_FILENAME" "$checksum_files_list_file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
if $DRY_RUN ; then
|
if $DRY_RUN ; then
|
||||||
bail "DRY_RUN=false is not supported, bailing out"
|
bail "DRY_RUN=false is not supported, bailing out"
|
||||||
fi
|
fi
|
||||||
@ -213,3 +260,4 @@ mkdir -p "$PUBLISH_ROOT"
|
|||||||
publish_3rdparty_sources
|
publish_3rdparty_sources
|
||||||
publish_3rdparty_binaries
|
publish_3rdparty_binaries
|
||||||
publish_package_sources_and_binaries
|
publish_package_sources_and_binaries
|
||||||
|
publish_aptly_public_repos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user