You are not logged in.
Hi. I'm working on a PKGBUILD, which install executable perl script. It is installed after all in /usr/bin/vendor_perl. It's recommended on ArchLinux Wiki. The problem is, this path isn't in $PATH, so I can't simply run it from a command line. What should I do to make this possible after package installation? I can export PATH=$PATH:/usr/bin/vendor_perl, but I don't know how to do this permanently from PKGBUILD.
Last edited by ciembor (2013-01-21 10:40:46)
my home page and my blog
Offline
Look at /etc/profile.d/. Example: https://projects.archlinux.org/svntogit … /mercurial
By the way, I think all you need to do in case of your script is relogin / source /etc/profile.d/perlbin.sh:
$ cat /etc/profile.d/perlbin.sh
# Set path to perl scriptdirs if they exist
# https://wiki.archlinux.org/index.php/Perl_Policy#Binaries_and_Scripts
# Added /usr/bin/*_perl dirs for scripts
# Remove /usr/lib/perl5/*_perl/bin in next release
[ -d /usr/bin/site_perl ] && PATH=$PATH:/usr/bin/site_perl
[ -d /usr/lib/perl5/site_perl/bin ] && PATH=$PATH:/usr/lib/perl5/site_perl/bin
[ -d /usr/bin/vendor_perl ] && PATH=$PATH:/usr/bin/vendor_perl
[ -d /usr/lib/perl5/vendor_perl/bin ] && PATH=$PATH:/usr/lib/perl5/vendor_perl/bin
[ -d /usr/bin/core_perl ] && PATH=$PATH:/usr/bin/core_perl
export PATH
# If you have modules in non-standard directories you can add them here.
#export PERLLIB=dir1:dir2
$ pacman -Qo /etc/profile.d/perlbin.sh
/etc/profile.d/perlbin.sh is owned by perl 5.16.2-2
Offline
Already being done? core/perl installs scripts in /etc/profile.d that add the vendor_perl directory to PATH when a shell starts.
Edit: Didn't see a reply was made already rule#1 never post before waking up properly le sigh.
Last edited by digirium (2013-01-21 08:09:06)
Offline
Hmm... but this script doesn't run after installing package. I had to reboot. Is there good way to enforce this?
my home page and my blog
Offline
Call the script from the install file.
Offline
That's strange, but it doesn't update PATH when I run it by hand. Both perlbin.sh and perlbin.csh. I really had to reboot:(.
//edit
OK, I'm stupid. Didn't use source, like msthev said;).
//edit
Uhh, but it dosn't work from .install .
Last edited by ciembor (2013-01-21 08:52:49)
my home page and my blog
Offline
That's strange, but it doesn't update PATH when I run it by hand.
That's normal -- by running it you create a new shell, and when the script returns, everything in regards to the environment disappears (in this case: global variables). If you want the script to run in current shell, you need to run it with the dot (or source in Bash).
A little demo:
$ echo 'export TESTVAR=yup' >test.sh
$ chmod +x test.sh
$ echo $TESTVAR
$ ./test.sh
$ echo $TESTVAR
$ . test.sh
$ echo $TESTVAR
yup
Uhh, but it dosn't work from .install .
/etc/profile.d/* gets sourced at every login. You just need to relogin (after installing) to have the variable in your profile environment (i.e. every shell you open).
Offline
Solved: http://www.reddit.com/r/archlinux/comme … itar_hero/
Thanks for support!
Last edited by ciembor (2013-01-21 10:43:37)
my home page and my blog
Offline