Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 814062 - net-im/telegram-desktop-bin-3.0.1: wants to run updater
Summary: net-im/telegram-desktop-bin-3.0.1: wants to run updater
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Henning Schild
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-09-20 15:56 UTC by Sven Hesse
Modified: 2021-10-05 07:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Updated ebuild to install /etc/tdesktop/externalupdater (telegram-desktop-bin-3.0.1-r1.ebuild,1.24 KB, text/plain)
2021-09-26 16:06 UTC, Alexey Zapparov
Details
/etc/tdesktop/externalupdater file needed to stop Telegram from trying to run update (externalupdater,39 bytes, text/plain)
2021-09-26 16:07 UTC, Alexey Zapparov
Details
Updated ebuild to install /etc/tdesktop/externalupdater (telegram-desktop-bin-3.1.0-r1.ebuild,1.20 KB, text/plain)
2021-09-26 16:08 UTC, Alexey Zapparov
Details
Updated wrapper (-externalupdater flag is not respected by telegram as of 2.9.4) (telegram-desktop-bin,362 bytes, application/x-shellscript)
2021-09-26 16:08 UTC, Alexey Zapparov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Hesse 2021-09-20 15:56:56 UTC
Telegram now automatically downloads its updater into my user home directory and wants to run that, asking for the root password, on the next start.

The only way to get rid of that updating is to delete ~/.local/share/TelegramDesktop/tupdates/, but then it just downloads the update again.

Since net-im/telegram-desktop is managed by the Gentoo ebuild, the updates should be completely disabled instead.

Reproducible: Always

Steps to Reproduce:
1. Start telegram-desktop
2. Wait for it to show the "Update Telegram" button on the bottom left
3. Close Telegram
4. Start telegram-desktop again
Actual Results:  
A prompt to enter the root password is shown on the console, to run the auto-updater.

Expected Results:  
No updates should be done outside the package manager.
Comment 1 Esteve Varela Colominas 2021-09-24 00:34:18 UTC
I can't reproduce this. Considering the -r1 version isn't being specified, are you sure you're running net-im/telegram-desktop, and not net-im/telegram-desktop-bin (note the -bin part)?

If you're sure, please run the following commands and show me the output:
    sudo ebuild /var/db/repos/gentoo/net-im/telegram-desktop/telegram-desktop-3.0.1-r1.ebuild clean configure
    sudo grep DESKTOP_APP_DISABLE_AUTOUPDATE /var/tmp/portage/net-im/telegram-desktop-3.0.1-r1/work/telegram-desktop-3.0.1_build/CMakeCache.txt
On my system, and any other system, this should say "DESKTOP_APP_DISABLE_AUTOUPDATE:BOOL=ON".

Also, an additional question, do the updater-related settings pop up in settings->advanced?
Comment 2 Sven Hesse 2021-09-24 01:01:19 UTC
Oh, you're absolutely right, I've been running net-im/telegram-desktop-bin. My bad, sorry!

I guess the bug does still apply to that package, though? Unless that's fixed with 3.1.0.

Personally, I'm switching over to net-im/telegram-desktop, then.
Comment 3 Sven Hesse 2021-09-24 01:35:03 UTC
(Also, 3.0.1-r1 doesn't seem to exist? https://gitweb.gentoo.org/repo/gentoo.git/tree/net-im/telegram-desktop only has 3.0.1)
Comment 4 Esteve Varela Colominas 2021-09-24 11:03:26 UTC
Right, -r1 hasn't been pushed yet, my bad.
Comment 5 Alexey Zapparov 2021-09-26 15:20:19 UTC
As of 2.9.4 -externalupdater flag has been ignored. Instead, we should create /etc/tdesktop/externalupdater file with only line pointing telegram binary itself:

  echo /usr/lib/telegram-desktop-bin/Telegram > /etc/tdesktop/externalupdater
Comment 6 Alexey Zapparov 2021-09-26 16:06:33 UTC
Created attachment 741492 [details]
Updated ebuild to install /etc/tdesktop/externalupdater

This ebuild needs externalupdater file
Comment 7 Alexey Zapparov 2021-09-26 16:07:37 UTC
Created attachment 741495 [details]
/etc/tdesktop/externalupdater file needed to stop Telegram from trying to run update
Comment 8 Alexey Zapparov 2021-09-26 16:08:09 UTC
Created attachment 741498 [details]
Updated ebuild to install /etc/tdesktop/externalupdater
Comment 9 Alexey Zapparov 2021-09-26 16:08:57 UTC
Created attachment 741501 [details]
Updated wrapper (-externalupdater flag is not respected by telegram as of 2.9.4)
Comment 10 Henning Schild 2021-10-03 07:58:59 UTC
telegram-desktop-bin disables the internal updater with appending the cmdline arg  "-externalupdater". But i have seen the internal updater still doing something a while ago.
Looking at the sourcecode it still has code for that cmdline switch so i was expecting a glitch in my setup.

Alexey Zapparov, did you find any evidence on why your suggestion is "correct". I think we should rather get in touch with upstream to repair that switch (in case it is broken), instead of coming up with a workaround that might not work for long either.
Comment 11 Henning Schild 2021-10-03 08:03:12 UTC
https://github.com/telegramdesktop/tdesktop/commit/8b7b0fa570775338a4fa28a245405e0d3f9e0b77

removed "-externalupdater", first released in 2.9.4
Comment 12 Henning Schild 2021-10-03 09:06:25 UTC
https://github.com/telegramdesktop/tdesktop/commit/b19dcf0653dc2deb00ca2edffc4bb7cafcb4a863

did add that very weird interface where the config file contains a line to point to the binary in order to disable the internal updater ... but it is what it is and creating such a file does the trick
Comment 13 Larry the Git Cow gentoo-dev 2021-10-03 15:34:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4d5d2b25219999249569b6031b6514f653047f1

commit d4d5d2b25219999249569b6031b6514f653047f1
Author:     Henning Schild <henning@hennsch.de>
AuthorDate: 2021-10-03 08:39:51 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2021-10-03 15:24:09 +0000

    net-im/telegram-desktop-bin: disable internal updater again
    
    Upstream silently dropped the "-externalupdater" switch. Instead we need
    to create a file in /etc to disable the internal updater.
    
    Closes: https://bugs.gentoo.org/814062
    Signed-off-by: Henning Schild <henning@hennsch.de>
    Closes: https://github.com/gentoo/gentoo/pull/22472
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 net-im/telegram-desktop-bin/files/telegram-desktop-bin           | 9 ---------
 ...top-bin-3.0.1.ebuild => telegram-desktop-bin-3.0.1-r1.ebuild} | 9 +++++----
 ...top-bin-3.1.0.ebuild => telegram-desktop-bin-3.1.0-r1.ebuild} | 9 +++++----
 ...top-bin-3.1.1.ebuild => telegram-desktop-bin-3.1.1-r1.ebuild} | 9 +++++----
 4 files changed, 15 insertions(+), 21 deletions(-)
Comment 14 Alexey Zapparov 2021-10-03 16:04:04 UTC
Henning Schild, sorry for not providing the links to relevant upstream commits and pull-requests (somehow I thought I did). Thanks for resolving it.
Comment 15 Henning Schild 2021-10-05 07:00:03 UTC
Thanks for the report and digging out a solution. What was merged was inspired by your suggestions.