From 12d2ae00ea92a44acb8a563ffa89fa6840388239 Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Wed, 26 Feb 2020 15:33:27 +0800 Subject: [PATCH] Add script for gsi_pubsign build chaining target Bug: 149803895 Test: ./gsi-pubsign-release.sh aosp_arm64 aosp_arm64_pubsign \ aosp_arm64-artifact_path aosp_arm64_pubsign-artifact_path Merged-In: I05e82f0605eec33c0da9b5a5d5cbf3506af3706c Change-Id: I05e82f0605eec33c0da9b5a5d5cbf3506af3706c (cherry picked from commit 45c81a65e7511299fae1d3a8c53852b7d769f80c) --- gsi/gsi-pubsign-release.sh | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 gsi/gsi-pubsign-release.sh diff --git a/gsi/gsi-pubsign-release.sh b/gsi/gsi-pubsign-release.sh new file mode 100755 index 000000000..72ef05042 --- /dev/null +++ b/gsi/gsi-pubsign-release.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -e + +function usage { + cat <&2 '$DIST_DIR is not specified' + exit 1 +fi + +# Create output directory if not already present +if [[ ! -d "${DIST_DIR}" ]]; then + mkdir -p "${DIST_DIR}" +fi + +# Don't copy logs/ and files whose name starts with $SRC_PRODUCT +rsync --verbose --archive --copy-links --exclude='logs' \ + --exclude="${SRC_PRODUCT}-*" "${SRC_DIR}" "${DIST_DIR}" + +# Rename ${SRC_PRODUCT}-xxx.yyy to ${TARGET_PRODUCT}-xxx.yyy +for src_path in $(find "${SRC_DIR}" -type f -name "${SRC_PRODUCT}-*") ; do + src_file="$(basename ${src_path})" + target_file="${src_file/${SRC_PRODUCT}/${TARGET_PRODUCT}}" + cp -v "${src_path}" "${DIST_DIR}/${target_file}" +done