Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fpp fails when called from a symlink in Linux #33

Closed
lsmag opened this issue May 7, 2015 · 8 comments
Closed

fpp fails when called from a symlink in Linux #33

lsmag opened this issue May 7, 2015 · 8 comments

Comments

@lsmag
Copy link

lsmag commented May 7, 2015

I'm creating an Arch package for PathPicker right now but I can't make a symlink to fpp work. This is the error I get:

/home/lsmag/my-symlink-fpp: line 18: cd: /home/lsmag//home/lsmag/PathPicker: No such file or directory
python2: can't open file '/src/processInput.py': [Errno 2] No such file or directory
python2: can't open file '/src/choose.py': [Errno 2] No such file or directory
:D

As you can see, the problem is /home/lsmag//home/lsmag/PathPicker = /home/lsmag/ + /home/lsmag/PathPicker, which is the predictable output of both dirname and readlink.

Using readlink -f, however, the command runs just fine. This is how it is on my machine now:

while [ -h "$WHEREAMI" ]; do
  WHEREAMI=$(readlink -f "$WHEREAMI")
done

I don't know if it still works on Macs, though.

@mochimisu
Copy link

you'll have to be a little bit careful - osx ships with posix readlink, and this script is written for osx. iirc, the posix readlink doesnt have the -f flag

on linux you'll be using gnu readlink, which is different and has the -f flag.

that's not the issue, thogh

it looks like readlink is giving you an absolute path when the script was written for a readlink that gives a relative path. this is probably because you symlinked fpp using an absolute path, which, imo, should be valid.

it wbn if the WHEREAMI resolution would respect symlinks created with absolute paths.

@pcottle
Copy link
Contributor

pcottle commented May 8, 2015

@lsmag can you see if #16 fixes this for you?

@pcottle
Copy link
Contributor

pcottle commented May 8, 2015

I think since we added the if [[ $SOURCE == /* ]]; then in #16 then this will work for both relative and absolute symlinks -- so I'm going to call this closed! @lsmag can you try pulling down 16 and then trying?

@pcottle pcottle closed this as completed May 8, 2015
@lsmag
Copy link
Author

lsmag commented May 8, 2015

Yup, it worked, thanks =D

@lsmag
Copy link
Author

lsmag commented May 8, 2015

I uploaded the package to AUR, it can be installed using yaourt, aura or even downloading the package and calling # pacman -U <path-to-pathpicker.tar.gz>. Maybe change the README to add that?

@pcottle
Copy link
Contributor

pcottle commented May 11, 2015

@lsmag what does pacman do besides unpack the tar? does it handle symlinking and sha checks and such?

@pcottle
Copy link
Contributor

pcottle commented May 11, 2015

lets track this in #43

@lsmag
Copy link
Author

lsmag commented May 12, 2015

@pcottle the package I built will download fpp from git, unpack on /opt and create a symlink on /usr/bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants