pkgbuild: Fix sha256sums array after 0.35.0 bump
Build Arch package / build (push) Successful in 27s
Build Arch package / build (push) Successful in 27s
update.sh replaced only the first sha256sums line and left orphan hashes, so makepkg could not source PKGBUILD. Rewrite both deb and launch-shim sums; reset pkgrel to 1 for the first 0.35.0 package.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
pkgbase = grok-bot-bin
|
pkgbase = grok-bot-bin
|
||||||
pkgdesc = Grok Bot desktop agent (official .deb repackaged)
|
pkgdesc = Grok Bot desktop agent (official .deb repackaged)
|
||||||
pkgver = 0.35.0
|
pkgver = 0.35.0
|
||||||
pkgrel = 2
|
pkgrel = 1
|
||||||
url = https://cursor.com/download/bot
|
url = https://cursor.com/download/bot
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
license = LicenseRef-proprietary
|
license = LicenseRef-proprietary
|
||||||
@@ -30,6 +30,6 @@ pkgbase = grok-bot-bin
|
|||||||
source = grok-bot-launch.sh
|
source = grok-bot-launch.sh
|
||||||
noextract = grok-bot_0.35.0_amd64.deb
|
noextract = grok-bot_0.35.0_amd64.deb
|
||||||
sha256sums = ed254e819d0f0419a1df9771009363074f65f80d8175d2ee0fc62900087ebd99
|
sha256sums = ed254e819d0f0419a1df9771009363074f65f80d8175d2ee0fc62900087ebd99
|
||||||
sha256sums = ed254e819d0f0419a1df9771009363074f65f80d8175d2ee0fc62900087ebd99
|
sha256sums = 886c8b55eb44d2f7812be50dcc1571907dc2d7e755171e67e916f497634f09eb
|
||||||
|
|
||||||
pkgname = grok-bot-bin
|
pkgname = grok-bot-bin
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
pkgname=grok-bot-bin
|
pkgname=grok-bot-bin
|
||||||
pkgver=0.35.0
|
pkgver=0.35.0
|
||||||
_commit=1c5a6ceb364c4dd53f0069f72cc4239220ed471e
|
_commit=1c5a6ceb364c4dd53f0069f72cc4239220ed471e
|
||||||
pkgrel=2
|
pkgrel=1
|
||||||
pkgdesc="Grok Bot desktop agent (official .deb repackaged)"
|
pkgdesc="Grok Bot desktop agent (official .deb repackaged)"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://cursor.com/download/bot"
|
url="https://cursor.com/download/bot"
|
||||||
@@ -42,8 +42,8 @@ source=(
|
|||||||
"grok-bot-launch.sh"
|
"grok-bot-launch.sh"
|
||||||
)
|
)
|
||||||
noextract=("grok-bot_${pkgver}_amd64.deb")
|
noextract=("grok-bot_${pkgver}_amd64.deb")
|
||||||
sha256sums=('ed254e819d0f0419a1df9771009363074f65f80d8175d2ee0fc62900087ebd99')
|
sha256sums=(
|
||||||
'fb888b2204c8a51c71a9f5f9a2913ac10561f3ef6939c1245ecae4e837d4ada2'
|
'ed254e819d0f0419a1df9771009363074f65f80d8175d2ee0fc62900087ebd99'
|
||||||
'886c8b55eb44d2f7812be50dcc1571907dc2d7e755171e67e916f497634f09eb'
|
'886c8b55eb44d2f7812be50dcc1571907dc2d7e755171e67e916f497634f09eb'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+41
-10
@@ -23,20 +23,51 @@ deb_url="https://downloads.cursor.com/grokbot/stable/${commit}/linux/x64/grok-bo
|
|||||||
tmp=$(mktemp)
|
tmp=$(mktemp)
|
||||||
trap 'rm -f "$tmp"' EXIT
|
trap 'rm -f "$tmp"' EXIT
|
||||||
curl -fsSL --retry 3 "$deb_url" -o "$tmp"
|
curl -fsSL --retry 3 "$deb_url" -o "$tmp"
|
||||||
sha=$(sha256sum "$tmp" | cut -d' ' -f1)
|
deb_sha=$(sha256sum "$tmp" | cut -d' ' -f1)
|
||||||
|
shim_sha=$(sha256sum grok-bot-launch.sh | cut -d' ' -f1)
|
||||||
|
|
||||||
|
# Reset pkgrel on upstream version bumps.
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s/^pkgver=.*/pkgver=${version}/" \
|
-e "s/^pkgver=.*/pkgver=${version}/" \
|
||||||
-e "s/^_commit=.*/_commit=${commit}/" \
|
-e "s/^_commit=.*/_commit=${commit}/" \
|
||||||
-e "s/^sha256sums=.*/sha256sums=('${sha}')/" \
|
-e "s/^pkgrel=.*/pkgrel=1/" \
|
||||||
PKGBUILD
|
PKGBUILD
|
||||||
|
|
||||||
# Refresh .SRCINFO source URL + hashes without requiring makepkg.
|
python3 - "$deb_sha" "$shim_sha" <<'PY'
|
||||||
sed -i \
|
import pathlib, re, sys
|
||||||
-e "s/^\\tpkgver = .*/\\tpkgver = ${version}/" \
|
deb_sha, shim_sha = sys.argv[1], sys.argv[2]
|
||||||
-e "s#^\\tsource = https://downloads.cursor.com/grokbot/stable/.*/linux/x64/grok-bot_.*_amd64.deb#\\tsource = https://downloads.cursor.com/grokbot/stable/${commit}/linux/x64/grok-bot_${version}_amd64.deb#" \
|
p = pathlib.Path("PKGBUILD")
|
||||||
-e "s/^\\tnoextract = grok-bot_.*_amd64.deb/\\tnoextract = grok-bot_${version}_amd64.deb/" \
|
text = p.read_text()
|
||||||
-e "s/^\\tsha256sums = .*/\\tsha256sums = ${sha}/" \
|
block = f"sha256sums=(\n '{deb_sha}'\n '{shim_sha}'\n)"
|
||||||
.SRCINFO
|
text2, n = re.subn(r"sha256sums=\([^\)]*\)", block, text, count=1, flags=re.S)
|
||||||
|
if n != 1:
|
||||||
|
raise SystemExit(f"sha256sums replace failed (n={n})")
|
||||||
|
p.write_text(text2)
|
||||||
|
PY
|
||||||
|
|
||||||
echo "Updated PKGBUILD and .SRCINFO to ${version} sha256=${sha}"
|
python3 - "$version" "$commit" "$deb_sha" "$shim_sha" <<'PY'
|
||||||
|
import pathlib, re, sys
|
||||||
|
version, commit, deb_sha, shim_sha = sys.argv[1:5]
|
||||||
|
p = pathlib.Path(".SRCINFO")
|
||||||
|
lines = []
|
||||||
|
saw_sha = False
|
||||||
|
for line in p.read_text().splitlines(True):
|
||||||
|
if line.startswith("\tpkgver ="):
|
||||||
|
lines.append(f"\tpkgver = {version}\n"); continue
|
||||||
|
if line.startswith("\tpkgrel ="):
|
||||||
|
lines.append("\tpkgrel = 1\n"); continue
|
||||||
|
if line.startswith("\tsource = https://downloads.cursor.com/grokbot/stable/"):
|
||||||
|
lines.append(f"\tsource = https://downloads.cursor.com/grokbot/stable/{commit}/linux/x64/grok-bot_{version}_amd64.deb\n"); continue
|
||||||
|
if line.startswith("\tnoextract = grok-bot_"):
|
||||||
|
lines.append(f"\tnoextract = grok-bot_{version}_amd64.deb\n"); continue
|
||||||
|
if line.startswith("\tsha256sums ="):
|
||||||
|
if not saw_sha:
|
||||||
|
lines.append(f"\tsha256sums = {deb_sha}\n")
|
||||||
|
lines.append(f"\tsha256sums = {shim_sha}\n")
|
||||||
|
saw_sha = True
|
||||||
|
continue
|
||||||
|
lines.append(line)
|
||||||
|
p.write_text("".join(lines))
|
||||||
|
PY
|
||||||
|
|
||||||
|
echo "Updated PKGBUILD and .SRCINFO to ${version} deb_sha=${deb_sha} shim_sha=${shim_sha}"
|
||||||
|
|||||||
Reference in New Issue
Block a user