<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt-desktop-upgrades/adu-download, branch main</title>
<subtitle>Automated upgrades for desktop systems</subtitle>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/'/>
<entry>
<title>Add list of upgradeable source packages to notification</title>
<updated>2022-04-11T13:39:18+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-04-11T13:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=ef128a0d2fb57d752fc71febf6573ba965b077e5'/>
<id>ef128a0d2fb57d752fc71febf6573ba965b077e5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Split long command over multiple lines</title>
<updated>2022-04-11T13:38:27+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-04-11T13:38:27+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=e7887ec3a6ae680da35c5e4d869be40e1c3e2605'/>
<id>e7887ec3a6ae680da35c5e4d869be40e1c3e2605</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix upgrade count when there are no upgrades</title>
<updated>2022-04-04T14:02:37+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-04-04T14:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=e69d9645d4525f288a8e2b8a99b2abe582ea92cc'/>
<id>e69d9645d4525f288a8e2b8a99b2abe582ea92cc</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Experimental support for `apt-listbugs` during downloads</title>
<updated>2022-03-21T14:39:03+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-21T14:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=1e1e75f0d5c6e6bfbf67b36266aa97edc7fb8bf1'/>
<id>1e1e75f0d5c6e6bfbf67b36266aa97edc7fb8bf1</id>
<content type='text'>
You have to explicitly enable it though
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
You have to explicitly enable it though
</pre>
</div>
</content>
</entry>
<entry>
<title>Clarify desktop notification text</title>
<updated>2022-03-17T16:53:26+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-17T16:53:26+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=cdec9ddfeb168861f92a202d77b711b4e096c63f'/>
<id>cdec9ddfeb168861f92a202d77b711b4e096c63f</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pipe download output through `cat` so it always succeeds</title>
<updated>2022-03-17T11:09:07+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-17T11:09:07+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=f9621d88100d2e3ce6b0061d0789401e57c4b1e8'/>
<id>f9621d88100d2e3ce6b0061d0789401e57c4b1e8</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Notify logged-in users when updates are availble.</title>
<updated>2022-03-17T10:59:49+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-17T10:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=8ae543fa8d3fdf08bcc61dcb27cafd987344ada2'/>
<id>8ae543fa8d3fdf08bcc61dcb27cafd987344ada2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cut down on log spam while downloading updates</title>
<updated>2022-03-16T17:03:08+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-16T17:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=f306054c40bd31cb856287126ee484e84dc1b30e'/>
<id>f306054c40bd31cb856287126ee484e84dc1b30e</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass `--with-new-pkgs` to `apt-get upgrade`</title>
<updated>2022-03-16T15:35:45+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-16T15:35:45+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=e0f03f2b2a83c2f0f32033fd11e652ee982e1a7c'/>
<id>e0f03f2b2a83c2f0f32033fd11e652ee982e1a7c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Exit scripts early if there's nothing to do</title>
<updated>2022-03-16T15:05:09+00:00</updated>
<author>
<name>Adam Spragg</name>
<email>adam@spra.gg</email>
</author>
<published>2022-03-16T15:05:09+00:00</published>
<link rel='alternate' type='text/html' href='https://spragg-ssl.co.uk/projects/cgit.cgi/apt-desktop-upgrades/commit/?id=4c4291d40daf4eb235faf89c7832f6c389607ce8'/>
<id>4c4291d40daf4eb235faf89c7832f6c389607ce8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
