Immich: replace diff command with comm as a workaround
This commit is contained in:
parent
d7d9a85409
commit
a0960ea131
14
ct/immich.sh
14
ct/immich.sh
@ -32,12 +32,12 @@ function update_script() {
|
|||||||
SOURCE_DIR=${STAGING_DIR}/image-source
|
SOURCE_DIR=${STAGING_DIR}/image-source
|
||||||
if [[ -f ~/.intel_version ]]; then
|
if [[ -f ~/.intel_version ]]; then
|
||||||
curl -fsSLO https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/machine-learning/Dockerfile
|
curl -fsSLO https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/machine-learning/Dockerfile
|
||||||
readarray -t INTEL_URLS <<<"$(sed -n "/intel/p" ./Dockerfile | awk '{print $3}')"
|
readarray -t INTEL_URLS < <(sed -n "/intel/p" ./Dockerfile | awk '{print $3}')
|
||||||
INTEL_RELEASE="$(grep "intel-opencl-icd" ./Dockerfile | awk -F '_' '{print $2}')"
|
INTEL_RELEASE="$(grep "intel-opencl-icd" ./Dockerfile | awk -F '_' '{print $2}')"
|
||||||
if [[ "$INTEL_RELEASE" != "$(cat ~/.intel_version)" ]]; then
|
if [[ "$INTEL_RELEASE" != "$(cat ~/.intel_version)" ]]; then
|
||||||
msg_info "Updating Intel iGPU dependencies"
|
msg_info "Updating Intel iGPU dependencies"
|
||||||
for url in "${INTEL_URLS[@]}"; do
|
for url in "${INTEL_URLS[@]}"; do
|
||||||
curl -fsSLO $url
|
curl -fsSLO "$url"
|
||||||
done
|
done
|
||||||
$STD dpkg -i ./*.deb
|
$STD dpkg -i ./*.deb
|
||||||
rm ./*.deb
|
rm ./*.deb
|
||||||
@ -48,11 +48,11 @@ function update_script() {
|
|||||||
if [[ -f ~/.immich_library_revisions ]]; then
|
if [[ -f ~/.immich_library_revisions ]]; then
|
||||||
curl -fsSLO https://raw.githubusercontent.com/immich-app/base-images/refs/heads/main/server/bin/build-lock.json
|
curl -fsSLO https://raw.githubusercontent.com/immich-app/base-images/refs/heads/main/server/bin/build-lock.json
|
||||||
jq -cr '.sources[].revision' ./build-lock.json >~/.new_revisions
|
jq -cr '.sources[].revision' ./build-lock.json >~/.new_revisions
|
||||||
readarray -t UPDATED_REVISIONS <<<"$(diff --unchanged-line-format= --old-line-format= --new-line-format='%L' ~/.immich_library_revisions ~/.new_revisions)"
|
readarray -t UPDATED_REVISIONS < <(comm -13 <(sort ~/.immich_library_revisions) <(sort ~/.new_revisions))
|
||||||
if [[ "$(echo "$UPDATED_REVISIONS" | wc -w)" -gt 0 ]]; then
|
if [[ "$(echo "$UPDATED_REVISIONS" | wc -w)" -gt 0 ]]; then
|
||||||
readarray -t NAMES <<<"$(for revision in "${UPDATED_REVISIONS[@]}"; do
|
readarray -t NAMES < <(for revision in "${UPDATED_REVISIONS[@]}"; do
|
||||||
jq -cr --arg jq_revision $revision '.sources[] | select(.revision == $jq_revision).name' ./build-lock.json
|
jq -cr --arg jq_revision "$revision" '.sources[] | select(.revision == $jq_revision).name' ./build-lock.json
|
||||||
done)"
|
done)
|
||||||
rm -rf "$SOURCE_DIR"
|
rm -rf "$SOURCE_DIR"
|
||||||
mkdir -p "$SOURCE_DIR"
|
mkdir -p "$SOURCE_DIR"
|
||||||
cd "$BASE_DIR"
|
cd "$BASE_DIR"
|
||||||
@ -173,9 +173,9 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
mv ~/.new_revisions ~/.immich_library_revisions
|
mv ~/.new_revisions ~/.immich_library_revisions
|
||||||
rm ~/build-lock.json
|
|
||||||
msg_ok "Image-processing libraries compiled"
|
msg_ok "Image-processing libraries compiled"
|
||||||
fi
|
fi
|
||||||
|
rm ~/build-lock.json
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user