mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 23:51:07 +02:00
Ensure .repo/alternates is writable by the invoking user.
The only way to trigger this is if references were set up, but never instantiated. BUG=chromium-os:31682 TEST=manual permission checking. Change-Id: Ibfc9dadf838f554cd10411753b5769117b1b1d42 Reviewed-on: https://gerrit.chromium.org/gerrit/24932 Reviewed-by: Brian Harring <ferringb@chromium.org> Tested-by: Brian Harring <ferringb@chromium.org> Commit-Ready: Brian Harring <ferringb@chromium.org>
This commit is contained in:
parent
9c7eff8fca
commit
334050f24e
@ -276,6 +276,14 @@ setup_env() {
|
||||
repo.reference)
|
||||
if [ -n "${REFERENCE_DIR}" ]; then
|
||||
|
||||
ALTERNATES="${FLAGS_trunk}/.repo/alternates"
|
||||
|
||||
# Ensure this directory exists ourselves, and has the correct ownership.
|
||||
[ -d "${ALTERNATES}" ] || mkdir "${ALTERNATES}"
|
||||
[ -w "${ALTERNATES}" ] || sudo chown -R "${USER}" "${ALTERNATES}"
|
||||
|
||||
unset ALTERNATES
|
||||
|
||||
IFS=$'\n';
|
||||
required=( $( "${FLAGS_trunk}/chromite/lib/rewrite_git_alternates.py" \
|
||||
"${FLAGS_trunk}" "${REFERENCE_DIR}" "${CHROOT_TRUNK_DIR}" ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user