v0.10.0 d5d679d

publish.sh RawHistoryFolder

1#!/usr/bin/env bash
2# Builds an AUR package with makepkg, then pushes its PKGBUILD and .SRCINFO.
3# makepkg downloads every source and checks its sha256sum, so a PKGBUILD that
4# does not build, or does not match its release assets, is never published.
5#
6# Usage: publish.sh <pkgname> <PKGBUILD>
7# Env:   AUR_SSH_PRIVATE_KEY, AUR_USERNAME, AUR_EMAIL
8#        DRY_RUN=1 builds and prints the files without pushing.
9# Runs as a non-root user that may run pacman through sudo (makepkg -s).
10set -euo pipefail
11CARCH=$(uname -m)
12
13pkgname=$1
14work=$(mktemp -d)
15trap 'rm -rf "$work"' EXIT
16cp "$2" "$work/PKGBUILD"
17# The install script sets CAP_SYS_NICE; the AUR repo carries it too.
18cp "$(dirname "$0")/../neferwl.install" "$work/"
19cd "$work"
20
21makepkg --syncdeps --force --noconfirm
22# A -git pkgver() rewrites pkgver in PKGBUILD; .SRCINFO must match it.
23makepkg --printsrcinfo >.SRCINFO
24pkgver=$(sed -n 's/^\tpkgver = //p' .SRCINFO)
25
26# makepkg only fetches the sources of this machine's arch: check the others too.
27while read -r arch; do
28	if [[ $arch == "$CARCH" ]] || ! grep -q "^source_$arch=" PKGBUILD; then
29		continue
30	fi
31	{ cat /etc/makepkg.conf; echo "CARCH=$arch"; } >"makepkg-$arch.conf"
32	makepkg --config "makepkg-$arch.conf" --verifysource --noconfirm
33done < <(sed -n 's/^\tarch = //p' .SRCINFO)
34
35# pacman versions use _ where the tag has - (0.2.0-rc1 -> 0.2.0_rc1).
36got=$("pkg/$pkgname/usr/bin/neferwl" version)
37if [[ $got != "$pkgver" && $got != "${pkgver//_/-}" ]]; then
38	echo "packaged neferwl reports version $got, want $pkgver" >&2
39	exit 1
40fi
41
42if [[ ${DRY_RUN:-} == 1 ]]; then
43	cat PKGBUILD .SRCINFO
44	exit 0
45fi
46
47ssh_dir=$HOME/.ssh
48key=$ssh_dir/aur
49install -d -m 700 "$ssh_dir"
50(umask 077 && printf '%s\n' "$AUR_SSH_PRIVATE_KEY" >"$key")
51# Pinned host key. Fingerprint SHA256:RFzBCUItH9LZS0cKB5UE6ceAYhBD5C8GeOBip8Z11+4
52# is published on https://aur.archlinux.org.
53echo 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' >"$ssh_dir/known_hosts"
54export GIT_SSH_COMMAND="ssh -i $key -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$ssh_dir/known_hosts"
55
56git clone "ssh://aur@aur.archlinux.org/$pkgname.git" aur
57cp PKGBUILD .SRCINFO neferwl.install aur/
58cd aur
59git add PKGBUILD .SRCINFO neferwl.install
60if git diff --cached --quiet; then
61	echo "$pkgname $pkgver is already on the AUR"
62	exit 0
63fi
64# Commits are signed with the AUR SSH key.
65git -c user.name="$AUR_USERNAME" -c user.email="$AUR_EMAIL" \
66	-c gpg.format=ssh -c user.signingkey="$key" \
67	commit -S -m "Update to $pkgver"
68git push origin HEAD:master

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close