Closed wizard-28 closed 3 years ago
removescript and postinst should have sudo in the functions itself, the function doesn't need to be run with root, just the commands inside. Just like manually putting in the commands
As a sidenote, in 1.5, we ARE moving every command to a separate file, no writing the commands in the main script /bin/pacstall
, as this creates lot of issues, like the onces faced in this issue (If the remove command was a separate file, a simple sudo /usr/share/pacstall/scripts/removescript.sh
would work)
it would be in /usr/share/pacstall/scripts/remove.sh
instead
removescript and postinst should have sudo in the functions itself, the function doesn't need to be run with root, just the commands inside. Just like manually putting in the commands
Give a reason, why most of the stuff that people do in removescript requires root, so it makes sense to run it with root instead of doing sudo for every command
Because that's how it would manually be done
you don't run sudo su
then run post install commands
But it adds redundancy, doing sudo for every command.
I think we should should deviate from the manual way, and have root privileges in the removescript, and postinst.
Plus the syntax would be more closer to the AUR PKGBUILD syntax, so it will be easier for people to port the packages
Plus then after #72 was merged, every pacscript using removescript is actually broken
Except if people run sudo pacstall -R pkg
, but that is against the whole idea of #72
You can't run functions with sudo:
function1() {
echo "$USER"
}
henry@twilight ~ % ››› function1
henry
henry@twilight ~ % ››› sudo function1
[sudo] password for henry:
sudo: function1: command not found
henry@twilight ~ % ›››
I know, thats why I proposed it to be in a separate file
So we can sudo it
Or leave, now that I think about it giving granular permission control to the maintainer is a better idea
Describe the bug Title
To Reproduce
removescript
functionExpected behavior No errors
Screenshots
Desktop (please complete the following information):
Additional context None