5ada0fa Updated anki.misc url to point github releases instead of ankisrs.net
~tpapastylianou pushed to ~tpapastylianou/misc-updater git
5905eb3 Update current .misc files to also reflect 'geturl' as a valid subcommand in their usage strings.
~tpapastylianou pushed to ~tpapastylianou/misc-updater git
On Linux systems, one generally installs packages through their distribution's
dedicated package manager (e.g. apt
on ubuntu-based systems).
However, for whatever reason, every now and then, one needs to install a package
on their systems manually, whether this comes in the form of a pre-packaged
tarball that simply needs to be extracted at an appropriate location, or a
source-tarball that needs to be compiled and installed via the usual
./configure && make && make install
mechanism, etc.
One of the main functions of a package manager is to check whether newer releases exist for the packages installed on the system, and notify the user when such updates exist. However, in the case of MISC packages, unless a package implements its own 'check for updates' mechanism, the user is not aware when updates are released, unless they periodically remember to manually check the respective websites of all MISC packages installed on the system.
This script is a super-simple approach to solving that problem.
This repository contains a simple script which checks a selection of MISC packages, and notifies the user when a new version has been released for any of them. In my case, it currently checks for:
Additionally, the script checks 'itself' for updates as well (i.e. if a new release of misc-updater exists here on sourcehut!)
Each MISC package is represented by a simple .misc
executable script, placed
in the misc-scripts folder
. The only specification for these scripts is that
they should be designed such that:
If called with a 'current' argument, the script should print the current version of the corresponding program, e.g. as installed on your system.
If called with a 'latest' argument, the script should print the latest version, e.g. as obtained from the internet.
If called with a 'check' argument, the script should perform any additional checks needed, if any. Typically, this is simply a null operation.
The name of the script should match the name of the program executable as it
exists on your system path, with the extension .misc
added to it. This is
because the program
name resulting from the filename will be used to check
the existence of the executable on your system path.
See misc-scripts/README for details to create your own misc scripts.
Note: If you've written a .misc
script that you'd like me to consider
officially adding to this repository, feel free to create a pull request (e.g.
via git send-email on sourcehut). I will test and add as appropriate; feel free
to leave copyright notices and/or author information in your own scripts. If
you desire to use a different license from the rest of the project, you're
welcome to do so, but please indicate this clearly, e.g. via a separate
program.LICENSE
file corresponding to the program
dealt with by your update
script.
Assuming you cloned the repository, e.g. in /opt/misc-updater.git
, then simply
add the /opt/misc-updater.git/bin
folder to your PATH.
If you don't know how to do this, typically you simply add this line (using the
correct directory) to your ~/.bashrc
file:
PATH="/opt/misc-updater.git/bin:$PATH"
Usage hint: I use this alongside my normal package manager's cli updater, so
that I see updates for both my system packages and MISC packages
simultaneously. For this, I have created the following alias in my .bashrc
file:
alias checkupdates='mintupdate-cli -r list; echo; misc-updates'
(where in this case, mintupdate-cli -r list
happens to be my particular
distribution's cli command to check for updates)
It goes without saying that, assuming you "installed" misc-updater by cloning the repository from sourcehut, if 'misc-updates' has an update itself, the easiest way to 'upgrade' would be to do a git pull to update your git repository.
This script is generally intended to act as an 'updater', not an 'upgrader'.
I.e. it is not intended to 'upgrade' packages, it simply checks for 'updates'
and notifies the user to act accordingly if any exist (i.e. much like a typical
package-manager's update
function).
This is partly by design, since the whole point of Manually-Installed and Source-Compiled packages is that different people have different preferences as to how or where to install their programs on their system.
Having said that, a 'misc-upgrade-scripts' folder has been provided, with an example 'upgrade' script. The functionality of misc-updater does not rely on the existence of this folder in any manner at the moment. However, if there is interest for people to add upgrade scripts, or for coming up with some sort of standardization, and/or linking a bit more formally to the updater, I will consider it.