From e391e72ce85ae7c0f44f781b5eb7c614da0c8a02 Mon Sep 17 00:00:00 2001 From: "Berk D. Demir" Date: Sun, 31 May 2026 12:15:04 -0700 Subject: [PATCH 1/2] _1password-gui: update.sh - simplify macOS Beta handling --- pkgs/by-name/_1/_1password-gui/update.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/_1/_1password-gui/update.sh b/pkgs/by-name/_1/_1password-gui/update.sh index b4a2fb91f1f2..6013eddf18ab 100755 --- a/pkgs/by-name/_1/_1password-gui/update.sh +++ b/pkgs/by-name/_1/_1password-gui/update.sh @@ -17,11 +17,7 @@ CURL=( "-H" "user-agent: nixpkgs#_1password-gui update.sh" # repology requires a descriptive user-agent ) -JQ=( - "jq" - "--raw-output" - "--exit-status" # exit non-zero if no output is produced -) +JQ=("jq" "--raw-output") read_local_versions() { @@ -37,7 +33,7 @@ read_local_versions() { read_remote_versions() { local channel="$1" - local darwin_beta_maybe + local chan_os ver if [[ ${channel} == "stable" ]]; then remote_versions["stable/linux"]=$( @@ -60,13 +56,15 @@ read_remote_versions() { # Handle macOS Beta app-update feed quirk. # If there is a newer release in the stable channel, queries for beta # channel will return the stable channel version; masking the current beta. - darwin_beta_maybe=$( + chan_os="${channel}/darwin" + ver=$( "${CURL[@]}" "${APP_UPDATES_URI_BASE}/Y" \ - | "${JQ[@]}" 'select(.available == "1") | .version' + | "${JQ[@]}" 'select(.available == "1" and (.version | endswith(".BETA"))) | .version' ) - # Only consider versions that end with '.BETA' - if [[ ${darwin_beta_maybe} =~ \.BETA$ ]]; then - remote_versions["beta/darwin"]=${darwin_beta_maybe} + if [[ -n ${ver} ]]; then + remote_versions["${chan_os}"]="${ver}" + else + echo "No remote version for ${chan_os}" >&2 fi fi } From 679ea6f248d3a7e389f7206187991f7f666f9bd2 Mon Sep 17 00:00:00 2001 From: "Berk D. Demir" Date: Sun, 31 May 2026 12:18:48 -0700 Subject: [PATCH 2/2] _1password-gui: update.sh - Use upstream's APT repo for version checks Seemingly the upstream stopped updating their AUR[^1]. We were using Repology for easy queries against this repo. Switch to scraping upstream's APT repo. Looks like they only distribute the amd64 binaries of _1password-gui from their repo, as opposed to _1password-cli which ships both amd64 and aarch64. We assume updates are releases for both architectures, at the same time. [^1] https://aur.archlinux.org/packages/1password --- pkgs/by-name/_1/_1password-gui/update.sh | 48 +++++++++++++++++------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/_1/_1password-gui/update.sh b/pkgs/by-name/_1/_1password-gui/update.sh index 6013eddf18ab..b1fa7a6a1feb 100755 --- a/pkgs/by-name/_1/_1password-gui/update.sh +++ b/pkgs/by-name/_1/_1password-gui/update.sh @@ -1,10 +1,14 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p jq curl +#!nix-shell -i bash -p jq curl gawk #shellcheck shell=bash set -euo pipefail -# For Linux version checks we rely on Repology API to check 1Password managed Arch User Repository. -REPOLOGY_PROJECT_URI="https://repology.org/api/v1/project/1password" +# For Linux version checks we query upstream's APT repository. +# +# Repository only offers amd64 packages for the desktop app. +# We assume updates are always for both architectures. +OP_APT_REPO_DIST_BASE="https://downloads.1password.com/linux/debian/amd64/dists" +OP_APT_REPO_COMPONENT_INDEX="main/binary-amd64/Packages" # For Darwin version checks we query the same endpoint 1Password 8 for Mac queries. # This is the base URI. For stable channel an additional path of "N", for beta channel, "Y" is required. @@ -33,25 +37,43 @@ read_local_versions() { read_remote_versions() { local channel="$1" + local apt_index="${OP_APT_REPO_DIST_BASE}/${channel}/${OP_APT_REPO_COMPONENT_INDEX}" + local apt_awk_prog=$' + /^Package: 1password$/ { pkg_is_1password_gui=1 } + /^Version/ && pkg_is_1password_gui { print $2; exit } + ' local chan_os ver if [[ ${channel} == "stable" ]]; then - remote_versions["stable/linux"]=$( - "${CURL[@]}" "${REPOLOGY_PROJECT_URI}" \ - | "${JQ[@]}" '.[] | select(.repo == "aur" and .srcname == "1password" and .status == "newest") | .version' - ) + chan_os="${channel}/linux" + ver=$("${CURL[@]}" "${apt_index}" | awk "${apt_awk_prog}") + if [[ -n ${ver} ]]; then + remote_versions["${chan_os}"]="${ver}" + else + echo "No remote version for ${chan_os}" >&2 + fi - remote_versions["stable/darwin"]=$( + chan_os="${channel}/darwin" + ver=$( "${CURL[@]}" "${APP_UPDATES_URI_BASE}/N" \ | "${JQ[@]}" 'select(.available == "1") | .version' ) + if [[ -n ${ver} ]]; then + remote_versions["${chan_os}"]="${ver}" + else + echo "No remote version for ${chan_os}" >&2 + fi else - remote_versions["beta/linux"]=$( - # AUR version string uses underscores instead of dashes for betas. - # We fix that with a `sub` in jq query. - "${CURL[@]}" "${REPOLOGY_PROJECT_URI}" \ - | "${JQ[@]}" '.[] | select(.repo == "aur" and .srcname == "1password-beta") | .version | sub("_"; "-")' + chan_os="${channel}/linux" + ver=$( + # Deb package version string uses tilde instead of dashes for betas. + "${CURL[@]}" "${apt_index}" | awk "${apt_awk_prog}" | sed 's/~/-/' ) + if [[ -n ${ver} ]]; then + remote_versions["${chan_os}"]="${ver}" + else + echo "No remote version for ${chan_os}" >&2 + fi # Handle macOS Beta app-update feed quirk. # If there is a newer release in the stable channel, queries for beta