aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-11Add list of upgradeable source packages to notificationHEADmainAdam Spragg
2022-04-11Split long command over multiple linesAdam Spragg
2022-04-04Fix upgrade count when there are no upgradesAdam Spragg
There's a difference between cmd | wc -l and x="$(cmd)"; echo "$x" | wc -l in that the assignment in the latter removes a trailing newline **if one exists**, but the "echo" always adds one. This means that if `cmd` produces no output, the former has 0 lines, and the latter has 1 (empty) line. I've not found an easy way to fix this in a way that `wc` can tell the difference between an empty line and a non-empty one, so I had to find a separate way to count non-empty lines. I did try `echo "$x" | grep . | wc -l`, but `shellcheck` complains with [SC2126](https://github.com/koalaman/shellcheck/wiki/SC2126). The suggested alternative, `echo "$x" | grep -c .`, causes a failure on empty inputs (i.e. when there are no upgrades) because `grep` exits with a failure status if no lines are selected. My options were then to go with `grep | wc` and silence the warning, or do `grep -c | cat` to mask the `grep` failure (again). Given that they both have the same number of commands in the pipe, but `cat` is probably *slightly* cheaper than `wc`, and the `cat` version doesn't require adding a `shellcheck`-silencing comment, let's go with that.
2022-03-21Experimental support for `apt-listbugs` during downloadsAdam Spragg
You have to explicitly enable it though
2022-03-21Make download timer fire "randomly" one per hourAdam Spragg
Not "randomly" per se (see FixedRandomDelay docs in systemd.timer(7) for more info) but don't have every user of this application all hammer the repo exactly on the hour, every hour. See variants on the "Thundering Herd" problem for more info.
2022-03-18I think that's a version 0.1v0.1Adam Spragg
2022-03-17Clarify desktop notification textAdam Spragg
The notification is supposed to read "Reboot when it is convenient - to install the updates", but I kept reading it as "Reboot - when it is convenient to install the updates.", and I couldn't figure out the "correct" punctuation to do that while remaining proper English. So move the wording about instead.
2022-03-17Do not notify systemd if `DESTDIR` differs from `PREFIX`Adam Spragg
And document it, along with other installation instructions.
2022-03-17Add the `clean` and `distclean` make targetsAdam Spragg
2022-03-17Remember the value of PREFIX between runsAdam Spragg
So when you do `make PREFIX=/usr` and then `make install`, it installs to `/usr`.
2022-03-17Change the download service to run hourlyAdam Spragg
Checking for new updates isn't resource-intensive, and the downloads will happen one way or another - this just makes them happen sooner. The main change here is that the desktop notification will happen sooner, and once per hour. I think this is reasonable, as XDG notifications don't interrupt the user's workflow, don't steal focus, and don't even need to be dismissed. It's just a heads-up, and a low-level reminder.
2022-03-17Pipe download output through `cat` so it always succeedsAdam Spragg
Pipe success is determined by the success of the last command in the pipe, and `grep` indicates failure if no lines were selected. If we don't download anything then `grep` fails, the pipe fails, and the script - due to `set -e` - then fails/aborts at that point. So pipe through `cat` last, which always succeeds.
2022-03-17Notify logged-in users when updates are availble.Adam Spragg
2022-03-17Disable `apt-listbugs` during upgradesAdam Spragg
Because if the network isn't available, it causes an abort. More details in the README.md
2022-03-16Cut down on log spam while downloading updatesAdam Spragg
Don't care about the "Reading package lists..." and other interactive fripperies, or the list of packages no longer required, or the full list of packages to be upgraded, every time we just want to download new updates. But logging the actual downloads is kinda useful, so keep those.
2022-03-16Set "DEBIAN_FRONTEND=noninteractive" for upgradesAdam Spragg
Cuts down on spam in the logs. See the debconf(7) man page for more details.
2022-03-16Pass `--with-new-pkgs` to `apt-get upgrade`Adam Spragg
To allow for kernel upgrades, which install new packages. Also, make the way we pass options to `apt-get upgrade` more consistent between calls. Notably, put all options before the command, as indicated by the apt-get(1) man page.
2022-03-16Exit scripts early if there's nothing to doAdam Spragg
2022-03-15Force creation of adu-upgrade.service symlinkAdam Spragg
So that an existing installation doesn't cause a new one to fail
2022-03-15Fix whitespaceAdam Spragg
2022-03-15Support "DESTDIR=" for "make install" and "make uninstall"Adam Spragg
2022-03-14Support setting PREFIX with `make PREFIX=...` "build" stepAdam Spragg
2022-03-13First (mostly) working version apt-desktop-upgradesAdam Spragg