From cf571c615a98ef6829b84beeaea733d12725f77c Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 15 Apr 2024 12:22:51 +0300 Subject: [PATCH] [eos-update-notifier] fixed the news bug; downgrade some features --- eos-update-notifier/PKGBUILD | 6 +- eos-update-notifier/eos-update-notifier | 100 ++++--------------- eos-update-notifier/eos-update-notifier.conf | 28 +----- 3 files changed, 25 insertions(+), 109 deletions(-) diff --git a/eos-update-notifier/PKGBUILD b/eos-update-notifier/PKGBUILD index 73219832..6f982636 100644 --- a/eos-update-notifier/PKGBUILD +++ b/eos-update-notifier/PKGBUILD @@ -2,7 +2,7 @@ pkgname=eos-update-notifier pkgdesc="Software update notifier and 'news for you' for EndeavourOS users." -pkgver=24.4.1 +pkgver=24.4.2 pkgrel=1 arch=('any') license=('GPL') @@ -34,12 +34,12 @@ source=( $_url/$pkgname.service $_url/checkupdatesext ) -sha512sums=('078ce9641e68a1d36f6eba5ab9ec3c0cd9b99ec8cfb361ca810d24d8d90582becaa614888e4eaae5f2129c5fa7038a46b4f125152a03783f09c9b78edd9e659a' +sha512sums=('714bc84ca42d71e0832c114e95e5b6ee758f8a132e07ff985520de38c86b36ad306488cee6e6fca9ce7e716a52a558c22148e6e88e76201e34aaa7d87e16cf67' '8873c225c650f272221e8057b28bb6bd917e6da1e97baa79eafe42e8f1e7efb485dc094d66cba55fe4cc7421a556048e0ae171371766d36d7dfe8add79ac6e3d' 'd046e675f98a52b9c310e970c5a0b0bc92b08b60d55b9d39140516977e8a6ceb4b3f9d9b05d12fce377b5744f4563e5e66a86ceecafb57f5bd486f968dc57234' '76c99cf430236325e12f7633d85bc3a1055dc2c5d23619c494cf98c447b7beb5da7d71870cef68f1caa39db713e22221f8fdd75b05bdda5adc90fa29136b7445' 'd5d4d92a9fd0d7a4425bb7000d208d717846ff30c2c31abac94c88840d3e8edc4862a6aacbb576330ff9d7644e63cf90e509caad629d9ed516f378e62b26e168' - '00114dc497b9db53221fd87c1911c1a4e1f40013997c4ba48439deaebbe92b69c30ebc86164acc7d4154a1b40a1beaef72749934c63a49c3a7bacbd5c0c7e6bf' + '2af338ba293d87f434be119bf2e2051e07815ea238c92e9a5b436a5c405e1eef0cc23d33cde1a07c5475570110b35da70f7562e6db5bef36af78d08dbf5736d6' 'c33d879c3a0dd3309e633b15f6bde41543317131a2ab15b077f97f7532e88e2afb426ebd299e5d3309b6677e4fdea93b2452548c9904f219d5a5d43e87586157' 'a1e17d8f2f1579b000dacdc7a37be698c29528365d9e94d636ceffb3eb8346e16b4ff8ca04ce8ea35d9fff346fe548449d3609f3d448219eb5d89b2c3a5ac571' 'daa4868b0e2a554990b4091cade1e99f92cf1b450afa5bbe49183e622d53a3994f2227d5d8cf852e22a8c5781c7780433fbf529556131a8b48effe51b9e7e7e1' diff --git a/eos-update-notifier/eos-update-notifier b/eos-update-notifier/eos-update-notifier index a5719056..0fa54ac4 100755 --- a/eos-update-notifier/eos-update-notifier +++ b/eos-update-notifier/eos-update-notifier @@ -2,16 +2,6 @@ # # EOS update notifier for the current user. # -# The package includes the following files: -# eos-update-notifier (this file) -# eos-update-notifier.conf (configuration file) -# eos-update-notifier.desktop (initializes the systemd service for the current user) -# eos-update-notifier.service (systemd service) -# eos-update-notifier.timer (systemd timer) -# /tmp/eos-update-notifier.log.* (temporary log file, re-created at every invocation) -# arch-news-for-you (show Arch news relevant for you) -# eos-arch-news (show Arch news; showing is based on date only) -# ####################################################################### EOS_SCRIPTS_YAD=/usr/share/endeavouros/scripts/eos-script-lib-yad @@ -188,17 +178,6 @@ GetUpdateCount() { fi } -OpenWebPage() { - local app - for app in /bin/kde-open /bin/xdg-open /bin/exo-open ; do - if [ -x $app ] ; then - $app "$1" - return 0 - fi - done - eos_yad_DIE "sorry, cannot open web page '$1'" -} - Update_common() { # Check upstream updates first. @@ -220,21 +199,22 @@ Update_common() { GetUpdateCount if [ -n "$updates" ] ; then - [ "$ShowArchNewsPage" = "yes" ] && OpenWebPage https://archlinux.org/news - local retvalue=0 - local tmpfile=$(mktemp) - eos-kernel-nvidia-update-check --no-color $(echo "$updates" | tail -n +3 | awk '{print $1}') 2> $tmpfile || { - cat $tmpfile | eos_yad_problem "Warning" --text="Update conflict detected. Do you want to continue (not recommended)?" \ - --width=800 --height=300 \ - --button=' Continue!$ICO_OPERATION_TEST!Ignore this warning and continue':2 - retvalue=$? - case "$retvalue" in - 0) retvalue=1 ;; # eos_yad_problem returns 0 when quitting! - *) retvalue=0 ;; # the above code returns 2 when continuing - esac - } - rm -f $tmpfile - [ $retvalue -ne 0 ] && exit 1 + if lsmod | grep -w ^nvidia >/dev/null ; then + local retvalue=0 + local tmpfile=$(mktemp) + eos-kernel-nvidia-update-check --no-color $(echo "$updates" | tail -n +3 | awk '{print $1}') 2> $tmpfile || { + cat $tmpfile | eos_yad_problem "Warning" --text="Update conflict detected. Do you want to continue (not recommended)?" \ + --width=800 --height=300 \ + --button=' Continue!$ICO_OPERATION_TEST!Ignore this warning and continue':2 + retvalue=$? + case "$retvalue" in + 0) retvalue=1 ;; # eos_yad_problem returns 0 when quitting! + *) retvalue=0 ;; # the above code returns 2 when continuing + esac + } + rm -f $tmpfile + [ $retvalue -ne 0 ] && exit 1 + fi if [ $update_focused -eq 0 ] ; then SystemLockActive b || return @@ -322,40 +302,6 @@ Update_common() { fi } -CheckArchNews() { - if [ "$AllowNewsCheckWhileUpdating" = "no" ] ; then - test -e $system_lockfile && return - fi - - test -n "$CheckArchNewsForYou" || CheckArchNewsForYou=yes - test -n "$ArchNewsProg" || ArchNewsProg=arch-news-for-you # original default - - if [ "$CheckArchNewsForYou" = "yes" ] ; then - local tmpdays=hide - case "$ArchNewsProg" in - eos-arch-news) - # eos-arch-news does not (yet) use $newsdays ... - tmpdays="--save" - ;; - arch-news-for-you) - if [ "$newsdays" -gt 0 ] ; then - tmpdays="$newsdays" - fi - ;; - *) - log2 "Warning: configuration problem with variable 'ArchNewsProg'. Please check file '$EOS_UPDATE_NOTIFIER_CONF'." - ;; - esac - if [ "$tmpdays" != "hide" ] ; then - if [ "$verbosity" = "high" ] ; then - $ArchNewsProg $tmpdays - else - $ArchNewsProg $tmpdays 2>/dev/null - fi - fi - fi -} - SystemLockActive() { if [ -e $system_lockfile ] ; then debug "Sorry, another program is currently using pacman databases." @@ -378,8 +324,9 @@ CheckTimeoutVal() { Main2() { local CheckAurUpdates=yes - local CheckArchNewsForYou=yes - local ArchNewsProg=eos-arch-news + # local CheckArchNewsForYou=yes + # local ArchNewsProg=eos-arch-news + # local ShowArchNewsPage=no local UN_NotifyTimeout=30s local UN_NotifyTrayTimeout=30s local SyncAfterUpdate=no @@ -396,10 +343,6 @@ Main2() { # Config file values should be OK. - if [ "$pkgsonly" = "no" ] ; then - CheckArchNews - fi - # check package manager lock SystemLockActive a || return @@ -656,11 +599,6 @@ Options: Default: $iwt. -nw=X Max time (seconds) to show the "No updates available" window. Default: $no_updates__indicator_wait_time. - -news=X Show the 'Arch latest news for you' within the last X days. - If X is 0, then no news are displayed. - Default: X is $newsdays. - Note: this has effect only if configuration ArchNewsProg is - 'arch-news-for-you'. -q Be quieter with dialogs. --changelog Show the changelog of this package. EOF diff --git a/eos-update-notifier/eos-update-notifier.conf b/eos-update-notifier/eos-update-notifier.conf index 62a5f681..717a84e2 100644 --- a/eos-update-notifier/eos-update-notifier.conf +++ b/eos-update-notifier/eos-update-notifier.conf @@ -7,29 +7,13 @@ CheckAurUpdates=yes # yes or no ## Note: the AUR helper program can be set in file ## /etc/eos-script-lib-yad.conf, variable EOS_AUR_HELPER. -## Use additional EOS updater. +## Use additional EOS updater (deprecated!). ## This program will be called by the eos-update-notifier after ## updating Arch/EOS and AUR packages. ## Input parameter is the log file name. ## Additional updater must return a similar exit code as 'checkupdates'. # -AdditionalEosUpdater="" - -## Check also Arch news for you: -# -CheckArchNewsForYou=no # yes or no - -## Check news while updating? -# -AllowNewsCheckWhileUpdating=yes # yes or no - -## Program for showing the Arch news. -## 'eos-arch-news' shows news based on the date and shows the news -## only if there are newer news than at the previous check. -## Note: 'arch-news-for-you' was outdated and is now removed. -## This option was added in eos-update-notifier version 0.9-1. -# -ArchNewsProg=eos-arch-news +AdditionalEosUpdater="" # note: support for this will be removed ## Prefer tray notification or small window for nofitying about updates? ## @@ -63,12 +47,6 @@ UN_NotifyTrayTimeout=30s # for 'notify+tray' ## UpdateNotifyIcon is the icon name that will be used when showing available updates. ## The default is 'system-software-update'. If that icon does not exist on your system, ## you can change the icon to something that does. +## You can alternatively add the full path of the icon file. # UpdateNotifyIcon=system-software-update - -## ShowArchNewsPage defines whether to show or not the Arch news page when -## native updates are available. -## Supported values: yes or no. -## Default: no. -# -ShowArchNewsPage=no