Bug 471542 - When initial setup, do not require sudo when not needed to install anything
Summary: When initial setup, do not require sudo when not needed to install anything
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: setup wizard (other bugs)
Version First Reported In: Git
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-28 16:57 UTC by Andrew Shark
Modified: 2023-11-14 16:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Shark 2023-06-28 16:57:17 UTC
On Arch Linux, when you run `./kdesrc-build --initial-setup`, you get the message:
```
 - Installing system packages for arch...
    Installing packages for arch/unknown
    Using installer for arch
 * Running 'sudo pacman -Syu --noconfirm --needed perl-json perl-yaml-libyaml perl-io-socket-ssl perl-libwww perl-xml-parser perl-yaml-syck autoconf automake bison flex gcc gperf make kdesdk clang cmake ninja meson boost docbook-xsl doxygen intltool pkg-config git bzr qt5-base qt5-script qt5-websockets qt5-svg qt5-tools qt5-x11extras qca-qt5 libaccounts-qt libdbusmenu-qt5 poppler-qt5 qtkeychain-qt5 phonon-qt5 wayland-protocols qrencode signond xapian-core qgpgme kdsoap xsd xerces-c vlc ruby-sass eigen mlt freecell-solver sane vala check libolm xmlto itstool libdisplay-info python-sphinx enchant jasper openexr libutempter docbook-xsl shared-mime-info giflib libxss upower udisks2 xorg-server-devel libpwquality libfakekey eigen xapian-core libdmtx ruby-test-unit gobject-introspection'
```
After that it requires to enter sudo password.

It can be improved. It can check if packages are already installed and not actually needed. So that you do not need to enter the password.

More of that, it starts to update the whole system (-Syu), and it may not be wanted. Can you please remove the "u"?

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.5.3
Comment 1 duha.bugs 2023-06-28 17:58:32 UTC
(In reply to Andrew Shark from comment #0)
> More of that, it starts to update the whole system (-Syu), and it may not be
> wanted. Can you please remove the "u"?

Arch Linux does not support partial upgrades. Either go with -S or -Syu.
For reference: https://wiki.archlinux.org/title/system_maintenance#Partial_upgrades_are_unsupported
Comment 2 Andrew Shark 2023-06-28 18:01:30 UTC
Yes, go with just -S.
Comment 3 Justin Zobel 2023-06-30 01:35:31 UTC
Moved to wishlist as this is not a bug but a feature/change request.
Comment 4 Justin Zobel 2023-06-30 01:36:18 UTC
I believe this is also not qt6 specific so removing the keyword, please re-add if it is only done in qt6 builds.
Comment 5 Andrew Shark 2023-09-14 19:07:41 UTC
As a workaround, one may run [kde-builder-launch](https://invent.kde.org/ashark/kde-builder/-/blob/master/kde-builder-launch?ref_type=heads) - a reimplemented kdesrc-run on python, which implements this logic.
Comment 6 Bug Janitor Service 2023-11-10 00:30:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/kdesrc-build/-/merge_requests/316
Comment 7 Joshua Goins 2023-11-14 16:58:09 UTC
Git commit da7af01b2cd4d893b3dd4b379abf016768aaff64 by Joshua Goins, on behalf of Andrew Shark.
Committed on 14/11/2023 at 17:57.
Pushed by redstrate into branch 'master'.

For Arch Linux --initial-setup, only run sudo pacman when needed

M  +26   -1    modules/ksb/FirstRun.pm

https://invent.kde.org/sdk/kdesrc-build/-/commit/da7af01b2cd4d893b3dd4b379abf016768aaff64