Files
windsurf-aur/update-windsurf.sh
T
biggyandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> ea2e327511 Update to version 3.0.21
Bump pkgver and sha256sums for devin-desktop 3.0.21. Drop stale
appdata/zsh mv lines from build() — no longer present in the deb.
Update updater to use dynamic deb_path from the Packages index,
remove .SRCINFO auto-update (now handled manually), reset pkgrel=1
on each bump, and switch build hint to paru -Bi. Add pkg/ to cleanup.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-04 18:27:53 +02:00

90 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Devin AUR package updater
set -e
PKGDIR="$(dirname "$0")"
PKGBUILD="$PKGDIR/PKGBUILD"
SRCINFO="$PKGDIR/.SRCINFO"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Get current version from PKGBUILD
current_ver=$(grep -E '^pkgver=' "$PKGBUILD" | cut -d= -f2)
echo "Current PKGBUILD version: $current_ver"
# Fetch latest version from apt repository
echo "Checking Devin repository..."
latest_info=$(curl -s "https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/apt/dists/stable/main/binary-amd64/Packages.gz" | zcat)
latest_ver=$(echo "$latest_info" | grep -A1 "Package: devin-desktop" | grep "Version:" | head -1 | sed 's/Version: \([0-9.]*\).*/\1/')
deb_path=$(echo "$latest_info" | grep -A20 "Package: devin-desktop" | grep "Filename:" | head -1 | sed 's/Filename: //')
if [[ -z "$latest_ver" ]]; then
echo -e "${RED}Error: Could not fetch latest version${NC}"
exit 1
fi
echo "Latest available version: $latest_ver"
# Compare versions
if [[ "$current_ver" == "$latest_ver" ]]; then
echo -e "${GREEN}Already up to date!${NC}"
exit 0
fi
# Check if latest is newer (simple version comparison)
if printf '%s\n%s\n' "$current_ver" "$latest_ver" | sort -V -C; then
echo -e "${YELLOW}Update available: $current_ver$latest_ver${NC}"
else
echo -e "${YELLOW}Repository version ($latest_ver) is older than PKGBUILD ($current_ver)${NC}"
echo "Skipping update."
exit 0
fi
# Download and calculate SHA256
deb_url="https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/apt/${deb_path}"
echo ""
echo "Downloading ${latest_ver} for SHA256 verification..."
echo "URL: $deb_url"
new_sha256=$(curl -sL "$deb_url" | sha256sum | cut -d' ' -f1)
if [[ -z "$new_sha256" ]] || [[ ${#new_sha256} -ne 64 ]]; then
echo -e "${RED}Error: Failed to calculate SHA256${NC}"
exit 1
fi
echo ""
echo "New SHA256: $new_sha256"
echo ""
# Show diff
echo "Proposed changes:"
echo " PKGBUILD: pkgver=$latest_ver"
echo " PKGBUILD: sha256sums=('$new_sha256' ...)"
echo ""
# Ask for confirmation
read -p "Update PKGBUILD? [Y/n] " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]] && [[ -n $REPLY ]]; then
echo "Update cancelled."
exit 0
fi
# Update PKGBUILD
echo "Updating PKGBUILD..."
sed -i "s/^pkgver=.*/pkgver=$latest_ver/" "$PKGBUILD"
sed -i "s/sha256sums=('[^']*'/sha256sums=('$new_sha256'/" "$PKGBUILD"
sed -i "s/^pkgrel=.*/pkgrel=1/" "$PKGBUILD"
echo -e "${GREEN}Updated to version $latest_ver${NC}"
echo ""
echo "Review changes with: git diff"
echo "Build with: paru -Bi ."