From fe7a763d0785c58a3b1c641eddf342464dac03af Mon Sep 17 00:00:00 2001 From: Privacy Sandbox Team Date: Fri, 10 May 2024 03:00:49 -0400 Subject: [PATCH] Release 0.62.0 (2024-05-10) ### Features * Add --dir flag to normalize-dist Bug: b/339407401 Change-Id: I3038aad94327edd2a51c5b909ca727362d1bb16d GitOrigin-RevId: bcec63e6c845816d3b5b5030f5a9b92aefecea5b --- CHANGELOG.md | 7 +++++++ tools/normalize-dist | 47 +++++++++++++++++++++++++++++++++----------- version.txt | 2 +- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4074d..3ced111 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## 0.62.0 (2024-05-10) + + +### Features + +* Add --dir flag to normalize-dist + ## 0.61.1 (2024-05-10) diff --git a/tools/normalize-dist b/tools/normalize-dist index 93627d2..cfa86e1 100755 --- a/tools/normalize-dist +++ b/tools/normalize-dist @@ -19,13 +19,40 @@ set -o pipefail set -o errexit +declare TOP_LEVEL_DIR=dist + +function usage() { + local exitval=${1-1} + cat &>/dev/stderr < + --dir directory to normalize recursively. Default: ${TOP_LEVEL_DIR} +USAGE + # shellcheck disable=SC2086 + exit ${exitval} +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --dir) + TOP_LEVEL_DIR="$2" + shift 2 || usage + ;; + -h | --help) usage 0 ;; + *) + printf "unrecognized arg: %s\n" "$1" + usage + ;; + esac +done + trap _cleanup EXIT function _cleanup() { local -r -i STATUS=$? if [[ ${STATUS} -eq 0 ]]; then - printf "normalize-dist completed successfully\n" &>/dev/stderr + printf "normalize-dist [%s] completed successfully\n" "${TOP_LEVEL_DIR}" &>/dev/stderr else - printf "Error: normalize-dist completed with status code: %s\n" "${STATUS}" &>/dev/stderr + printf "Error: normalize-dist [%s] completed with status code: %s\n" "${TOP_LEVEL_DIR}" "${STATUS}" &>/dev/stderr fi exit 0 } @@ -40,9 +67,7 @@ readonly GROUP USER="$(builder::id u)" readonly USER -readonly TOP_LEVEL_DIRS="dist" - -printf "Setting file ownership [%s], group [%s] in dirs [%s]\n" "${USER}" "${GROUP}" "${TOP_LEVEL_DIRS}" +printf "Setting file ownership [%s], group [%s] in dirs [%s]\n" "${USER}" "${GROUP}" "${TOP_LEVEL_DIR}" declare -a runner=() if [[ -f /.dockerenv ]]; then runner+=(bash -c) @@ -51,11 +76,9 @@ else fi "${runner[@]}" " -for TOP_LEVEL_DIR in ${TOP_LEVEL_DIRS}; do - find \${TOP_LEVEL_DIR} -type f ! -executable -exec chmod 644 {} \; - find \${TOP_LEVEL_DIR} -type f -executable -exec chmod 755 {} \; - find \${TOP_LEVEL_DIR} -type d -exec chmod 755 {} \; - chgrp --recursive ${GROUP} \${TOP_LEVEL_DIR} - chown --recursive ${USER} \${TOP_LEVEL_DIR} -done +find ${TOP_LEVEL_DIR} -type f ! -executable -exec chmod 644 {} \; +find ${TOP_LEVEL_DIR} -type f -executable -exec chmod 755 {} \; +find ${TOP_LEVEL_DIR} -type d -exec chmod 755 {} \; +chgrp --recursive ${GROUP} ${TOP_LEVEL_DIR} +chown --recursive ${USER} ${TOP_LEVEL_DIR} " diff --git a/version.txt b/version.txt index 317b248..7e9253a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.61.1 \ No newline at end of file +0.62.0 \ No newline at end of file