2024-03-29 08:09 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002546Buildsystem[All Projects] Generalpublic2018-04-21 08:27
ReporterMichael Siegel 
Assigned To 
PrioritylowSeveritytweakReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformGNU/LinuxOSDevuanOS Version1.0.0 (Jessie)
Summary0002546: Replace "sudo" with "su -c" in env.sh
DescriptionThe function "ns-apt-get-install" inside the temporary env.sh used in building NetSurf from source on GNU/Linux uses the command

  sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})

to install packages needed to build and run NetSurf on Devuan/Debian.

This is not ideal since "sudo" cannot be expected to be installed on such a system.

I therefore suggest replacing that command with

   su -c "apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})"

You could even make it

   su -c "apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB}) --no-install-recommends"

to reduce the number of packages being pulled. I've used this command in building NetSurf and it doesn't seem to have caused any harm.

It seems, however, that using "su" instead of "sudo" will break things for Ubuntu distributions, since "by default, the root account password is locked in Ubuntu" (https://help.ubuntu.com/community/RootSudo). Still, these systems can be easily configured to allow the use of "su". See https://askubuntu.com/questions/44418/how-to-enable-root-login .

Btw, the above is probably also a problem in "ns-yum-install".
Steps To ReproduceDo the following on a Devuan/Debian system that doesn't have "sudo":

$ wget http://git.netsurf-browser.org/netsurf.git/plain/Docs/env.sh
$ source env.sh
$ ns-package-install
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files

-Relationships
+Relationships

-Notes
Michael Siegel

~0001565

Michael Siegel (reporter)

The easiest way to solve this is probably for the script to look for "sudo" and use "su" if it can't be found.
Daniel Silverstone

~0001754

Daniel Silverstone (administrator)

We strongly believe that the vast majority of .deb based platforms use sudo by preference. At least as far as installations go. The extra complexity of maintaining a path which none of the developers use seems to outweight the benefits.

In general, we feel that anyone who has not got sudo installed will likely have done so because they are a "power" user and thus will be able to cope with installing the dependencies themselves.
+Notes

-Issue History
Date Modified Username Field Change
2017-06-04 17:05 Michael Siegel New Issue
2017-06-04 17:18 Michael Siegel Note Added: 0001565
2018-04-21 08:27 Daniel Silverstone Status new => closed
2018-04-21 08:27 Daniel Silverstone Resolution open => won't fix
2018-04-21 08:27 Daniel Silverstone Note Added: 0001754
+Issue History