• Re: How to get an email notification every time a package is updated up

    From Greg Wooledge@21:1/5 to All on Sun Jun 30 04:50:01 2024
    On Sat, Jun 29, 2024 at 19:15:55 -0700, B wrote:
    My objective is to get an email notification when an update is available for a specific Debian package.

    I already have questions.

    Your Subject header includes the word "upstream". This word appears
    *nowhere* else in the entire email, and it completely moves the goalposts.

    Are you looking for notifications that a new Debian *package* has become available, or are you looking for notifications that the *upstream*
    developer has released a new version, which may or may not have a
    corresponding set of Debian packages?

    My next question: is this a package that's *installed* on your system?

    If you only care about new Debian packages, and if the package is one
    that's installed on your system, then you should be able to slap
    something together using "apt-get update" (or unattended-upgrades) and "apt-cache policy pkgname".

    Oh hey, good timing -- a new point release was apparently just dropped.
    After an "apt-get update", I have:

    hobbit:~$ apt-cache policy bash
    bash:
    Installed: 5.2.15-2+b2
    Candidate: 5.2.15-2+b7
    Version table:
    5.2.15-2+b7 500
    500 http://deb.debian.org/debian bookworm/main amd64 Packages
    *** 5.2.15-2+b2 100
    100 /var/lib/dpkg/status

    Note that the "Installed:" and "Candidate:" lines differ. We can write
    a simple shell script to compare them.


    hobbit:~$ cat pkgcheck
    #!/bin/bash

    if (($# != 1)); then
    echo "usage: pkgcheck PKGNAME" >&2
    exit 2
    fi

    installed= candidate=
    while read -r line; do
    case $line in
    Installed:*) installed=${line##* } ;;
    Candidate:*) candidate=${line##* } ;;
    esac
    done < <(apt-cache policy "$1")

    if [[ "$installed" != "$candidate" ]]; then
    printf '%s\n Installed: %s\n Candidate: %s\n' \
    "$1" "$installed" "$candidate"
    exit 1
    fi

    exit 0


    hobbit:~$ ./pkgcheck bash
    bash
    Installed: 5.2.15-2+b2
    Candidate: 5.2.15-2+b7
    hobbit:~$ ./pkgcheck libc6
    hobbit:~$

    Will this do? It isn't clever about handling packages that have multiple candidates, so you might want to think about how to deal with those, if
    you have that kind of situation. You can also add some bells and whistles, like a -q option or whatever you want.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Will Mengarini on Sun Jun 30 05:30:01 2024
    On Sat, Jun 29, 2024 at 20:12:36 -0700, Will Mengarini wrote:
    All we still need to know is whether the OP cares
    about packages that aren't installed, or whether some
    other aspect of Greg's solution isn't sufficient.

    If there's interest in new versions of uninstalled packages, then we
    have an additional bit of complexity -- how do you know whether the
    candidate package is "new"? You would need an "old" version number
    to compare against.

    Possible answers include "the candidate version number that I got the
    last time I ran the script" or "a version number that I'll provide as
    a second argument to the script". We'd need to know what the OP has
    in mind here.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Will Mengarini@21:1/5 to All on Sun Jun 30 05:20:01 2024
    * Greg Wooledge <greg@wooledge.org> [24-06/29=Sa 22:48 -0400]:
    Your Subject header includes the word "upstream". This word appears *nowhere* else in the entire email, and it completely moves the goalposts.

    "Upstream" was a misleading misnomer intended to refer to anything
    ... well, "upstream" of the OP's system. The OP didn't realize
    that 'upstream' has essentially become a term of art in package
    management, referring to whence code comes before it's packaged.

    * B <b@mydomainnameisbiggerthanyours.com> [24-06/29=Sa 19:15 -0700]:
    [...] requirements [...] For a given package, if I want to know
    about changes in unstable, then it must not generate notifications
    against stable, experimental, source, or some other architecture.

    [...] Tracker and the Debian mailing lists [...] are dev-oriented,
    not user-oriented. Notifications/NEWS occurs when source/uploads get
    accepted, not when built packages are released to the FTP servers.

    So the OP wants to know about Debian package updates.

    If you only care about new Debian packages, and if the
    package is one that's installed on your system [...]

    All we still need to know is whether the OP cares
    about packages that aren't installed, or whether some
    other aspect of Greg's solution isn't sufficient.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Crawley@21:1/5 to Greg Wooledge on Sun Jun 30 06:40:01 2024
    On 30/06/2024 12:19, Greg Wooledge wrote:
    On Sat, Jun 29, 2024 at 20:12:36 -0700, Will Mengarini wrote:
    All we still need to know is whether the OP cares
    about packages that aren't installed, or whether some
    other aspect of Greg's solution isn't sufficient.

    If there's interest in new versions of uninstalled packages, then we
    have an additional bit of complexity -- how do you know whether the
    candidate package is "new"? You would need an "old" version number
    to compare against.

    Possible answers include "the candidate version number that I got the
    last time I ran the script" or "a version number that I'll provide as
    a second argument to the script". We'd need to know what the OP has
    in mind here.


    rmadison will fetch data about package versions available in the Debian repositories.
    Its output might be usefully parsed by a script.

    --
    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B@21:1/5 to Greg Wooledge on Sun Jun 30 07:50:02 2024
    On 6/29/24 7:48 PM, Greg Wooledge wrote:
    Your Subject header includes the word "upstream". This word appears
    *nowhere* else in the entire email, and it completely moves the goalposts.

    Are you looking for notifications that a new Debian*package* has become available, or are you looking for notifications that the*upstream*
    developer has released a new version, which may or may not have a corresponding set of Debian packages?

    Good question but Will's interpretation is correct. This is the Debian
    *User* mailing list after all.

    My bad. I was aware of the meaning of "upstream" in regards to package maintainership but wasn't thinking someone would fixate on that when I
    used that in the subject. Just throw that word away.

    My next question: is this a package that's*installed* on your system?

    No. Not even the same arch or release as the installed system. I'll even
    go further and tell you I want these notifications on a Windows system
    or an iPhone. And the Debian systems are air-gapped with no Internet access.

    It seems crazy that in all the history of Debian, nobody said "There's a package I care about and I want to get immediately when a new version is released." And if they had, doing an "apt-get update" every minute of
    the day would not have been any part of the desired outcome.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B@21:1/5 to John Crawley on Sun Jun 30 07:50:02 2024
    On 6/29/24 9:30 PM, John Crawley wrote:

    rmadison will fetch data about package versions available in the
    Debian repositories.
    Its output might be usefully parsed by a script.

    Thank you! I totally forgot about madison.

    https://qa.debian.org/madison.php

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael =?utf-8?B?S2rDtnJsaW5n?=@21:1/5 to All on Sun Jun 30 11:00:01 2024
    On 29 Jun 2024 19:15 -0700, from b@mydomainnameisbiggerthanyours.com (B):
    My objective is to get an email notification when an update is available for a specific Debian package.

    It sounds simple. Something like this should already exist, right? The requirements are trivial. Yet after doing a lot of research I can't find an existing solution that doesn't have problems.

    Does anyone have any suggestions or input?

    I will readily admit that it doesn't immediately meet all of your
    criteria, but one possible venue especially if you are only interested
    in a few specific packages might be to point e.g. rss2email at the
    package events RSS feed available through tracker.debian.org. At that
    point you can use typical email filtering to further filter it down to
    only those events you are interested in (for example, only those that
    mention "into stable").

    --
    Michael Kjörling 🔗 https://michael.kjorling.se “Remember when, on the Internet, nobody cared that you were a dog?”

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B@21:1/5 to All on Sun Jun 30 11:40:01 2024
    On 6/30/24 1:55 AM, Michael Kjörling wrote:
    I will readily admit that it doesn't immediately meet all of your
    criteria, but one possible venue especially if you are only interested
    in a few specific packages might be to point e.g. rss2email at the
    package events RSS feed available through tracker.debian.org. At that
    point you can use typical email filtering to further filter it down to
    only those events you are interested in (for example, only those that
    mention "into stable").

    Thanks for the suggestion, but unfortunately I already researched that
    and there are problems.

    The RSS news feed  would not be needed in this case. Tracker can already
    send emails directly to you.

    There is the debian-changes@lists.debian.org and debian-devel-changes@lists.debian.org mailing lists, if you want to get notified for everything.

    Otherwise, you can select specific packages and keyword/event types
    through the web interface. Register, login, and then add your subscriptions:

    https://tracker.debian.org/accounts/subscriptions/

    Like I think I said in my original email, Tracker is
    dev/source-oriented, not user/package-oriented. Notifications are sent
    out when new source or other uploads are accepted into the archive. This
    is not the same thing as a new package version becoming available for
    download in the repos. Many packages have completely different source
    and package names (The linux kernel for example), and of course
    architecture is usually not considered at all, unless it's a binary upload.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From debian-user@howorth.org.uk@21:1/5 to b@mydomainnameisbiggerthanyours.com on Sun Jun 30 12:40:01 2024
    B <b@mydomainnameisbiggerthanyours.com> wrote:
    It seems crazy that in all the history of Debian, nobody said
    "There's a package I care about and I want to get immediately when a
    new version is released." And if they had, doing an "apt-get update"
    every minute of the day would not have been any part of the desired
    outcome.

    I'd expect that normally when somebody is so keen about a particular
    package, they'd be more interested to know when a new upstream version
    of the package appeared, rather than it appearing in a debian update.
    So the answer would depend on a lot of factors and wouldn't have a
    general answer.

    But in general, if there isn't an event-driven mechanism available(*)
    then a polling solution is generally the next step.

    * e.g. accepting notifications of all updates and filtering for the
    interesting one.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to All on Sun Jun 30 15:10:01 2024
    On Sat, Jun 29, 2024 at 22:46:00 -0700, B wrote:
    On 6/29/24 7:48 PM, Greg Wooledge wrote:
    My next question: is this a package that's*installed* on your system?

    No. Not even the same arch or release as the installed system. I'll even go further and tell you I want these notifications on a Windows system or an iPhone. And the Debian systems are air-gapped with no Internet access.

    https://mywiki.wooledge.org/BashFAQ/064

    21. If^H^HWhen the newbie's question is ambiguous, the proper
    interpretation will be whichever one makes the problem the hardest
    to solve.

    Good to know the universe hasn't changed.

    Now, levity aside, let's say you write a PowerShell script and run it
    on your Microsoft Windows computer, and it queries the Debian repositories,
    and it learns that bash version 5.2.15-2+b7 is the currently available
    version for bookworm.

    Is this version new? Is it old? Do you want to be informed of it?

    How does your program determine whether to notify you or not?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)