You are not logged in.

#1 2020-03-23 03:15:27

unmellow
Member
Registered: 2020-03-12
Posts: 25

[SOLVED] how to add shell to etc/shells

i have this package https://github.com/unmellow/ion-aur
and it's a login shell i need the path to ion in this case /usr/bin/ion to be added to
/etc/shells but idk how i tried puting

post_install() {
        sudo echo "/usr/bin/ion" | /etc/shells
}

post_remove() {
    sed -i 's/.usr.bin.ion//g' /etc/shells
}
in the .install file but permission is denied
is their some hook or systemd thing i can use and if so how do i use it?

Last edited by unmellow (2020-03-24 22:46:06)

Offline

#2 2020-03-23 03:18:57

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,520

Re: [SOLVED] how to add shell to etc/shells

you don't use sudo when it's already running as root, and pipes for that make no sense at all. See shell package in the repos (bash, zsh, fish, etc) for examples.

Offline

#3 2020-03-23 12:47:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,854
Website

Re: [SOLVED] how to add shell to etc/shells

And your sed command leaves a blank line.  If you want to delete that line, delete it, dont replace it with a blank.  And you should probably match the actual line you want to delete, not a substring with some wildcards that could (admittedly the odds are ridiculously trivial) get a false postive match on something else:

sed -i '/^\/usr\/bin\/ion$/d' /etc/shells

You could break the /etc/shells file for anyone who starts using my yet-to-be-released shell called busrbintion. tongue  While silly, it's certainly bad practice to leave a risk of significant breakage from bad code just because we can't currenly imagine exactly how it would fail in the future.

Last edited by Trilby (2020-03-23 12:54:30)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2020-03-24 22:45:38

unmellow
Member
Registered: 2020-03-12
Posts: 25

Re: [SOLVED] how to add shell to etc/shells

thanks @Trilby @Scimmia i just copied what i found here https://git.archlinux.org/svntogit/pack … ckages/zsh
and replaced zsh with ion lel i didn't realise i could just use this site to see the pkgbuild for core packages
thanks again

Offline

#5 2020-03-24 23:10:46

loqs
Member
Registered: 2014-03-06
Posts: 10,093

Re: [SOLVED] how to add shell to etc/shells

Missing makedepends git,  MIT license file is not installed.  $pkgdir is not quoted.
Package uses upstream git without pinning to an object but does not have a pkgver function or -git suffix in pkgname.

Last edited by loqs (2020-03-24 23:21:07)

Offline

Board footer

Powered by FluxBB