Updating a Rust port on OpenBSD
make sumwhat?!
Posted on Sat, 09 Sep 2023 07:43:38 MDT by Aaron Bieber
Updating a Rust port
OpenBSD rust ports have always been a bit tricky for me to update. Remembering the steps is a pain and there isn’t a clear “path” in the docs.
Recently someone asked me for some guidance on how to do an update.. and while writing out the steps I got frustrated and finally put things into a script.
Here is a error-check-less approach to updating a rust port:
#!/bin/sh
set -eu
PORT="$(make show=PKGNAME)"
mv -v crates.inc crates.old
touch crates.inc
make makesum
make modcargo-gen-crates > /tmp/${PORT}.crates.inc
grep ^MODCARGO /tmp/${PORT}.crates.inc > crates.inc
make clean
make makesum
make modcargo-gen-crates-licenses > /tmp/${PORT}.license.inc
grep ^MODCARGO /tmp/${PORT}.license.inc > crates.inc
rm crates.old
make clean
make && make package