naneos.uploader_update
Automatic update of a Raspberry Pi installation to the newest release.
naneos-uploader-update runs from the naneos_uploader_update.timer that
the installer writes (once a day, randomized). It is cheap when there is nothing
to do: one request to the PyPI JSON of the package, whose info.version is
the newest release without pre-releases, compared with the installed version.
The service is not touched in that case.
When PyPI has a newer release, the installer of exactly that release (git tag
vX.Y.Z) is downloaded and run with --version X.Y.Z. The installer is
the updater because it also carries the unit files and config drop-ins, which
a plain pip install --upgrade would miss. It restarts the service once.
Never touched: an installation from a git ref (--ref, hardware testing) and
pre-releases. The timer is switched with --auto-update / --no-auto-update
on the installer line, with AUTO_UPDATE=on|off in the change file on the SD
card, or with systemctl enable|disable --now naneos_uploader_update.timer.
make_plan(installed=__version__, source=None, fetch=fetch_json)
Decide without changing anything.
Source code in src/naneos/uploader_update.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
run_installer(script, args)
Run the installer with its output going to our stdout (the journal).
Source code in src/naneos/uploader_update.py
112 113 114 115 | |
update(user, plan, fetch_text_=fetch_text, run=run_installer)
Download the installer of the newest release and run it. Returns its exit code.
Source code in src/naneos/uploader_update.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
version_key(version)
A sortable key for the version formats this project publishes (2.0.6, 2.0.6rc2).
Source code in src/naneos/uploader_update.py
47 48 49 50 51 52 53 54 55 | |