update-package.md

 1We need to update an AUR package (or multiple).
 2
 3Code style:
 4
 5- Language(s): PKGBUILD is bash; .install is POSIX-sh–compatible functions
 6- Indent 2 spaces; UTF-8; LF endings; no trailing whitespace
 7- Quote variables: use double quotes around "$pkgdir" "$srcdir" and paths
 8- Strings: single quotes for literals; double quotes when expanding vars
 9- Arrays: arch, license, provides, conflicts use ( ... ) syntax
10- Functions: prepare(), build(), check(), package(); only define needed ones
11- No sudo, networking, or user config in build/package functions
12- Use install -Dm755 for binaries; set exact modes explicitly
13- Checksums: keep hashes in sync with sources
14- Keep .SRCINFO in lockstep with PKGBUILD; don’t commit build artifacts
15
16During update, follow this strict workflow. If a planning or todo tool is
17available, fill it out _in detail_ with these steps; you might get interrupted
18and have to pick up where you left off based on that todo/planning tool's
19output.
20
211. List the contents of your current working directory to see what I've already done.
22   - If you see text files, read them.
23   - If you see directories, list their contents.
24     - If by its contents, it seems like the repository of the project we're packaging, ignore it for now.
25   - If there are sub-directories of your current working directory with suffixes like `-bin` or `-git`, we're actually going to be updating _multiple_ AUR packages for the _same_ piece of software.
26     - `-git` packages clone the primary branch (main, master, trunk, etc.) and build and install the software from that source. We do not specify versions for these packages; updpkgsums determines the version and edits the PKGBUILD.
27     - `-bin` packages download the project-built and project-distributed binary and install that.
28     - Packages without a suffix download the nearest thing to a release archive we can find and build/install that source.
29   - There are no sub-directories of your current working directory, we're only updating one package. Look to your current working directory to determine whether we're creating a suffix-less package, or one with `-git` or `-bin`.
302. We're upgrading to version `$VERSION`. Read the PKGBUILD(s), and then edit the version number for non`-git` packages.
313. Update checksums and/or versions with `updpkgsums`.
324. Consider the diagnostics and present _all_ issues to me, whether you think they're relevant or not. Include reasoning why those issues are relevant, or why they're not. We'll work on any genuine issues until they're resolved before proceeding.
335. Install dependencies and build/install the package(s) by giving _me_ a code block of `makepkg -Ccsi` commands I can copy/paste. If there are multiple packages, include `cd` prior to `makepkg`. We'll work on any issues that arise during this step until they're resolved.
346. After I build the packages, run `namcap` on `./package-name-*.pkg.tar.zst` to lint them. Again, report all the issues to me and we'll work on them before continuing.
357. Generate each package's `.SRCINFO` by, again, giving me a series `makepkg --printsrcinfo > .SRCINFO`. If just one package, no `cd` is necessary. Just `makepkg`.
368. Clean all artifacts with `git clean -fdx`
379. If PKGBUILD and .SRCINFO are the only two files you've modified during this session, `git add` and `git commit` them. If there are other files you've modified that are tracked by git, please show me the diff and ask which you should commit.
38
39If anything other than `pkgver` is edited during the course of this flow, make sure to re-run `shellcheck` and `namcap` if appropriate.