OXYGENHUB

The .deb adds the apt repository at oxygenhub.io; the README says how 1931724b1d6b

The package ships the archive key (refreshed on every install) and, on
its first install only, writes /etc/apt/sources.list.d/oxygenhub.sources
(deb822, Signed-By), unless a source for the repository is there; purge
removes them when oh is not installed either. dist.sh takes ONLY=GLOB
to build some platforms. Tried in a clean Ubuntu 24.04.

refs oxygenhub#85
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-10-02 19:07 UTC
Signature
✔ signed by Andy McCall
Hash
1931724b1d6b51a8b37c7ca7769468f3bae40a66593f7fc91eeff3fb9d76aaec
Depends on
25c6adfaa559 648724d8e0de
Depended on by
a42f9fb47e37 8177f8177a07 b66a5c47cc61
In bookmarks
agents-in-readme bare-hashes carried-not-removed carry-identical doctor-trust identical-sides keyless-tags main merge-remote-bookmark only-help-103 paths-for-resolutions-and-amend push-notes show-stat subrepo-pin-state switch-says
In tags
v0.10.0 v0.11.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.4.3 v0.4.4 v0.4.5 v0.4.6 v0.5.0 v0.5.1 v0.6.0 v0.7.0 v0.8.0 v0.9.0
Edits
9 atoms, 2 tree operations, 3 files

Browse the tree at this change

added packaging/oxygenhub-archive-keyring.gpg +0 −0

No line changes.

modified README.md +15 −1
…
22 unchanged lines
23 23
24 24
Builds for Linux, macOS and Windows are on the [releases page](https://oxygenhub.io/andymccall/oxygen/releases). These are early releases: the macOS and Windows builds are not signed and have had little testing.
25 25
26 -
- **Debian, Ubuntu and other Linux with apt** (x86_64 or arm64): download `oxy_VERSION_amd64.deb` (or `_arm64.deb`) and run `sudo apt install ./oxy_VERSION_amd64.deb`. It needs glibc 2.28 or later (Debian 10, Ubuntu 20.04 and newer).
26 +
- **Debian, Ubuntu and other Linux with apt** (x86_64, arm64 or riscv64): add the repository at https://oxygenhub.io/apt and install with apt, so `apt upgrade` keeps oxy current:
27 +
28 +
  ```sh
29 +
  sudo curl -fsSLo /usr/share/keyrings/oxygenhub-archive-keyring.gpg https://oxygenhub.io/apt/oxygenhub.gpg
30 +
  sudo tee /etc/apt/sources.list.d/oxygenhub.sources >/dev/null <<EOF
31 +
  Types: deb
32 +
  URIs: https://oxygenhub.io/apt
33 +
  Suites: stable
34 +
  Components: main
35 +
  Signed-By: /usr/share/keyrings/oxygenhub-archive-keyring.gpg
36 +
  EOF
37 +
  sudo apt update && sudo apt install oxy
38 +
  ```
39 +
40 +
  Or download `oxy_VERSION_amd64.deb` (or `_arm64`, `_riscv64`) from a release and run `sudo apt install ./oxy_VERSION_amd64.deb`: from 0.3.1 it adds the repository by itself. It needs glibc 2.28 or later (Debian 10, Ubuntu 20.04 and newer). The repository's key is `82DD DD14 8BC9 0BDF 6006 09E9 522E 288F 265B DE6F`.
27 41
- **Other Linux:** unpack `oxy-VERSION-linux-x86_64.tar.gz` (or `-linux-arm64`) and put `oxy` on your `PATH`.
28 42
- **macOS** (Apple Silicon or Intel): unpack `oxy-VERSION-macos-arm64.tar.gz` (or `-macos-x86_64`), then `xattr -d com.apple.quarantine oxy`, since the build is not notarised, and put it on your `PATH`.
29 43
- **Windows:** unzip `oxy-VERSION-windows-x86_64.zip` and put the folder on your `PATH`. SmartScreen may warn on first run, since the build is not signed.
…
56 unchanged lines
modified scripts/dist.sh +38 −1
…
5 unchanged lines
6 6
# plus SHA256SUMS, in target/dist/VERSION.
7 7
#
8 8
#   scripts/dist.sh [VERSION]    (default: the package version)
9 +
#   ONLY=linux-x86_64 scripts/dist.sh   builds one platform (a glob)
9 10
#
10 11
# Needs: rustup targets x86_64-pc-windows-gnu, aarch64-unknown-linux-gnu,
11 12
# x86_64-apple-darwin and aarch64-apple-darwin; cargo-zigbuild and zig on
…
4 unchanged lines
16 17
PKG=oxy                  # the cargo package
17 18
BIN=oxy                  # the binary it builds
18 19
DEB_NAME=oxy             # the Debian package
20 +
OTHER_DEB=oh            # the other package sharing the apt repository files
19 21
SUMMARY="Oxygen version control: a distributed, commutative VCS"
20 22
DESCRIPTION="Oxygen is a version control system in which changes commute: a
21 23
 state is a set of changes, merges need no merge commits, conflicts are
…
26 unchanged lines
48 50
for p in "${PLATFORMS[@]}"; do
49 51
  IFS='|' read -r target platform tool deb <<<"$p"
50 52
  triple="${target%%.2.*}"
53 +
  # ONLY=linux-x86_64 (a glob) builds just the platforms it matches.
54 +
  if [ -n "${ONLY:-}" ] && [[ "$platform" != $ONLY ]]; then continue; fi
51 55
  echo "== $platform ($target)"
52 56
  if [ "$tool" = zig ]; then
53 57
    cargo zigbuild -q --release --locked --target "$target" -p "$PKG"
…
19 unchanged lines
73 77
    install -m 0755 "$built" "$root/usr/bin/$BIN"
74 78
    cp README.md "$root/usr/share/doc/$DEB_NAME/"
75 79
    cp LICENSE "$root/usr/share/doc/$DEB_NAME/copyright"
80 +
    # The apt repository at oxygenhub.io (oxygenhub#85): the package ships
81 +
    # the archive's key and, on its first install, adds the repository, so
82 +
    # apt upgrade keeps it current. oxy and oh share the files they write.
83 +
    mkdir -p "$root/usr/share/$DEB_NAME"
84 +
    install -m 0644 packaging/oxygenhub-archive-keyring.gpg "$root/usr/share/$DEB_NAME/"
85 +
    sed "s/@PKG@/$DEB_NAME/" >"$root/DEBIAN/postinst" <<'EOF'
86 +
#!/bin/sh
87 +
set -e
88 +
if [ "$1" = configure ]; then
89 +
  # The key is refreshed on every install, so a new one reaches everyone.
90 +
  install -m 0644 /usr/share/@PKG@/oxygenhub-archive-keyring.gpg /usr/share/keyrings/oxygenhub-archive-keyring.gpg
91 +
  # The repository is added on the first install only: removing it
92 +
  # keeps it removed.
93 +
  L=/etc/apt/sources.list.d/oxygenhub.sources
94 +
  if [ -z "$2" ] && [ ! -e "$L" ] && ! grep -rqs "oxygenhub.io/apt" /etc/apt/sources.list /etc/apt/sources.list.d; then
95 +
    cat >"$L" <<SRC
96 +
Types: deb
97 +
URIs: https://oxygenhub.io/apt
98 +
Suites: stable
99 +
Components: main
100 +
Signed-By: /usr/share/keyrings/oxygenhub-archive-keyring.gpg
101 +
SRC
102 +
  fi
103 +
fi
104 +
EOF
105 +
    sed "s/@OTHER@/$OTHER_DEB/" >"$root/DEBIAN/postrm" <<'EOF'
106 +
#!/bin/sh
107 +
set -e
108 +
if [ "$1" = purge ] && ! dpkg-query -W -f='${Status}' @OTHER@ 2>/dev/null | grep -q "ok installed"; then
109 +
  rm -f /etc/apt/sources.list.d/oxygenhub.sources /usr/share/keyrings/oxygenhub-archive-keyring.gpg
110 +
fi
111 +
EOF
112 +
    chmod 0755 "$root/DEBIAN/postinst" "$root/DEBIAN/postrm"
76 113
    cat >"$root/DEBIAN/control" <<EOF
77 114
Package: $DEB_NAME
78 115
Version: $VERSION
…
12 unchanged lines
91 128
done
92 129
93 130
rm -rf "$OUT/stage"
94 -
(cd "$OUT" && sha256sum -- *.tar.gz *.zip *.deb >SHA256SUMS)
131 +
(cd "$OUT" && shopt -s nullglob && sha256sum -- *.tar.gz *.zip *.deb >SHA256SUMS)
95 132
echo "== $OUT"
96 133
ls -l "$OUT"