tehn / isms

38 stars 7 forks source link

make install should install system lua for $SUDO_USER & not root #3

Closed p3r7 closed 1 year ago

p3r7 commented 2 years ago

sudo make install currently installs system lua files under /root (due to sudo), which is counter-intuitive.

this patch allows placing those files in the current user's $HOME.

an alternative approach would have been to split this target into 2 (install-bin requiring sudo, and install-system called regularly).

tehn commented 2 years ago

which linux distro are you on? this doesn't happen to me on ubuntu, and this feels like a common enough makefile--- i've never seen this hack before (but i must mention i don't spend all of my time looking at makefiles).

i'd be up for splitting the install into two components over this solution

tehn commented 2 years ago

also i appreciate that you're taking this for a spin.

i might mention that i'm planning to do some substantial overhauling (particularly on the vport system)--- so please anticipate some breakage as this is very alpha

p3r7 commented 2 years ago

which linux distro are you on?

i'm on ubuntu 20.04.

this doesn't happen to me on ubuntu

weird. maybe do we have a different default makefile interpreter (if that's a thing?).

one quick way to test the beahvior explicitly is to add this debug task:

.PHONY: whomai
whomai:
    @echo "i am $$USER"
    @echo "i live at $$HOME"

this gives me:

$ make whomai
i am eigen
i live at /home/eigen
$ sudo make whomai
[sudo] password for eigen: ######
i am root
i live at /root

please anticipate some breakage as this is very alpha

understood :ok_hand:

tehn commented 2 years ago

confirming that you are indeed correct and this must've been an oversight during my last go-fast-break-stuff period!

On Sat, Nov 5, 2022 at 4:26 PM Jordan Besly @.***> wrote:

which linux distro are you on?

i'm on ubuntu 20.04.

this doesn't happen to me on ubuntu

weird. maybe do we have a different default makefile interpreter (if that's a thing?).

one quick way to test the beahvior explicitly is to add this debug task:

.PHONY: whomai whomai:

@echo "i am $$USER"

@echo "i live at $$HOME"

this gives me:

$ make whomai

i am eigen

i live at /home/eigen

$ sudo make whomai

[sudo] password for eigen: ######

i am root

i live at /root

please anticipate some breakage as this is very alpha

understood 👌

— Reply to this email directly, view it on GitHub https://github.com/tehn/isms/pull/3#issuecomment-1304635583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB4I4HZ3L3TVLURGOQM3GLWG27IXANCNFSM6AAAAAARX5CG7U . You are receiving this because you commented.Message ID: @.***>

tehn commented 1 year ago

wondering if there's a more "canonical" install location for support files--- i'd be fine with it being a global for-all-users location

tehn commented 1 year ago

ie maybe /usr/share is better

tehn commented 1 year ago

config now in /usr/local/share