You are not logged in.

#1 2019-01-08 03:28:45

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

[Trivial - cosmetic] Why does bl-welcome do apt update so many times?

Yes it needs doing on a fresh install, but it won't let you get past the beginning unless you say yes to update & upgrade.  (Regardless that the user may be running bl-welcome manually.. 5 minutes after doing updates prior to installing other things.)
After adding backports... OK need that.

But again and again before installing almost anything?  Ok it skips it for bunsen-images-extra, but all the other occasions? You just did it at the start for goodness sake... Is there really the need to waste bandwith to insure against the corner case where someone leaves bl-welcome open for 3 days between steps?  If there is, maybe there's some check you could make for when apt update was last run and run conditionally if it's been over N hours.. instead of re-running it blindly over and over?

It's relatively harmless I'll grant.. but also annoying to us autistic types.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#2 2019-01-08 13:11:40

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,902
Website

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

I don't think that check like 'was it updated/upgraded' in last n minutes (or seconds) would solve this, since repos may have been updated at just that short timeframe. So next question would also be 'how dangerous is that edge case' and when you start digging into stuff like this usually new N questions will pop out.

Solution is probably to change the script in a way to install stuff at the very end of all user selections (But that would possibly make it less modular and more prone to various errors).

p.s. If I'am wrong then some of this look interesting.

[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -cmin -5)" ] && echo "Update shall be made, more than 5 minutes passed"

Something to be used manually, 'up'.

Last edited by brontosaurusrex (2019-01-08 16:01:01)

Offline

#3 2019-01-08 23:21:50

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

We are talking about stable here, it's unlikely to be as dangerous as testing or sid, even if you left it till next week, whole point of stable is that things don't change functionally, just bugfixes and security updates.. so even if library.foo gets a revision you just miss and install something built against the revised one.. all the calls to that library remained unaltered by the patch, and your new software should run just fine.. albeit with whatever problem got fixed in that library present, which'll get fixed the next time you routinely update.  Now the situation in testing/sid is different, there the behavior of stuff *is* permitted to change, and the risk of consequences is much higher.

And if you install everything end-to-end in bl-welcome how long does it take? an hour? two on slow hardware?  if you re run it manually to pull in say the lamp stack later.. you update.. forced at the start, but once is fine, bash through saying no to stuff.. then say yes what? 2 minutes after the update if you type slow?


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#4 2019-01-08 23:28:53

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,534

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

Batching all installations would indeed be a more efficient way. Though in the cases in which repositories (like adding backports) or apt configuration are modified (which may or may not the case depending on selections), an update is necessary with apt anyway. So we'd need to cover at least these cases in the framework.
---
This is a thing RedHat's package managers yum/dnf do better though: Whenever you do a yum install, the whole invocation is transactional and it'll invalidate the repository cache if needed, and fetch updates if needed, automatically, and install them, all in one step.


New Horizons

Offline

#5 2019-01-08 23:38:06

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,534

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

Bearded_Blunder wrote:

And if you install everything end-to-end in bl-welcome how long does it take? an hour? two on slow hardware?  if you re run it manually to pull in say the lamp stack later.. you update.. forced at the start, but once is fine, bash through saying no to stuff.. then say yes what? 2 minutes after the update if you type slow?

The packages pulled in are hardly THAT big in any choice offered. I guess the biggest single package is our extra images package at 90M? If downloading a few MBytes is killing your computer, you shouldn't be doing online installs in the first place and answer all choices with "no"; there's the Debian install DVD and purchasable DVD sets consisting of 14 full DVDs for that.

Though to concede, yes, the number of 'apt update's could be reduced, but anyway, that's what .pdiff files are for – apt shouldn't download all package sources every time, but only the small differences if any, so the size of all payloads downloaded during each apt-update invocation should be small to very small and declining or be zero with any invocation (cache-hit) save HTTP overhead.


New Horizons

Offline

#6 2019-01-08 23:42:16

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

It's not the bandwith, hardly constrained there, but running on old hardware and slow vms the time it takes reading and analysing over and over while i sit rolling an extra smoke during the pause ..


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#7 2019-01-09 02:25:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,997
Website

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

Agreed it's an annoyance, and the team have discussed it in the past.

I've just checked the code and bl-welcome calls for 'apt-get update' (by way of the safeUpdate() function in /usr/lib/bunsen/common/bl-include.cfg) at the start, and again if the apt repos are changed - debian or bl backports added. If it's just a package install then no update is done.
...Ah yes, recheck, the "system tweaks" page uses promptInstall() (also from bl-include.cfg) to install a PAE kernel or full BL metapackage, and that function calls an update too. That's maybe unnecessary here, though most users won't see it.

If a second update is run soon after a previous one then as twoion says the download is very small. I certainly don't see the second update taking long enough to roll a cig. Of course BL is intended to run well on old hardware too...

There are two cases when an apt update is needed:
1) Remote data has changed.
2) Local configs have changed, so extra remote data is needed.

To cover 1) we might think of a timer to skip updates coming right after a previous one. Add a bit of extra functionality to bl-include.cfg so other scripts can benefit.

2) though, demands an update if we add repos.

twoion wrote:

Batching all installations would indeed be a more efficient way.

Indeed. Apart from repeated updates, collecting all user decisions before executing everything in one action at the end would allow users to leave the terminal and do something else. (There's also now @twoion's own bunsen-sourcemgr that might be leveraged here.) This is a long-standing goal, and I've been planning to have another look at bunsen-welcome, but after making sure that all our other packages are in shape for the Debian Buster release.

We don't want to be late with Lithium this time, and the bl-welcome updates thing is, after all, an annoyance rather than a bug. Agreed, depending on individual circumstances, maybe quite annoying. smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Online

#8 2019-01-09 02:43:58

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

johnraff wrote:

I certainly don't see the second update taking long enough to roll a cig. Of course BL is intended to run well on old hardware too...

Ever tried on a 266 MHz P2 ? You can roll a cig easily.  If you've left it a month or so then for the first one you can smoke it too.  It's useless online with any browser heavier than Dillo or Netsurf, but surprisingly LibreOffice is as usable as MS Office 2000 was under Win 2K.

On a P4, or VBox VM it's a closer call.

(Plus I can roll a cig in under 30 seconds.. I do like 500 at a time for my sister who can't use her hands well enough)

And I did self-mark it trivial.  I'd rate it a similar level to a typo somewhere, it's also probably not that hard to improve at least a little, and bl-welcome is one of the first impressions things :-)


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#9 2019-01-09 03:31:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,997
Website

Re: [Trivial - cosmetic] Why does bl-welcome do apt update so many times?

Bearded_Blunder wrote:

bl-welcome is one of the first impressions things :-)

True, that.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Online

Board footer

Powered by FluxBB