MantisBT - Buildsystem
View Issue Details
0002546Buildsystem[All Projects] Generalpublic2017-06-04 18:052018-04-21 09:27
ReporterMichael Siegel 
Assigned To 
PrioritylowSeveritytweakReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformGNU/LinuxOSDevuanOS Version1.0.0 (Jessie)
Fixed in CI build #
Reported in CI build #
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.
Attached Files

Notes
(0001565)
Michael Siegel   
2017-06-04 18:18   
The easiest way to solve this is probably for the script to look for "sudo" and use "su" if it can't be found.
(0001754)
Daniel Silverstone   
2018-04-21 09:27   
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.

Issue History
2017-06-04 18:05Michael SiegelNew Issue
2017-06-04 18:18Michael SiegelNote Added: 0001565
2018-04-21 09:27Daniel SilverstoneStatusnew => closed
2018-04-21 09:27Daniel SilverstoneResolutionopen => won't fix
2018-04-21 09:27Daniel SilverstoneNote Added: 0001754