Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: aus9 on February 21, 2013, 09:07:51 AM
-
I am just curious so low priority and anyone can answer as I am just testing my thoughts on this install script
libgs
#!/bin/sh
if [ ! -f /usr/local/bin/gs ]; then
ln -s gsc /usr/local/bin/gs
fi
[ -f /usr/local/lib/libgs.so.8 ] || ln -s /usr/local/lib/libgs.so.9 /usr/local/lib/libgs.so.8
I suspect
The first bit says if no file for gs then sym link gsc (without a pathway) to the missing file.
Why no full pathway is a question?
The second bit says for an old shared object found, sym link to the new updated file
Feel free to correct my understandings pls.
Why am I asking when I am not the maintainer etc.
--wellllll I am thinking of maintaining, but have yet to seek permisson
and have a script a built but I just want to see if there is a smarter way to my understanding
Obviously if I don't understand the script, people will have a lack of confidence in my tczs
hmmm ok they already have such .....I don't mind being the village idiot, it takes the pressure off
thanks for reading
trivia......maybe this was written when it was not so easy for people to update, so I can remove the second bit right?
b) now we have ghostscript tce.installed
#!/bin/sh
if [ -f /usr/local/bin/gsc ]; then
rm /usr/local/bin/gs
ln -s /tmp/tcloop/ghostscript/usr/local/bin/gs /usr/local/bin
fi
I am lost, what happens when someone installs both?
-
Hi aus9
Why no full pathway is a question?
The ln command is going to /usr/local/bin/ and from there creating a link from gs to gsc.
The second bit says for an old shared object found, sym link to the new updated file
I think the second bit says if /usr/local/lib/libgs.so.8 does not exist, create a link called /usr/local/lib/libgs.so.8 which
points to /usr/local/lib/libgs.so.9. I suspect that should be left in because some app hardcoded /usr/local/lib/libgs.so.8
as a requirement.
-
Rich
thanks for helping but still confused, let stay with linking I have only known about
ln -s realfile newfile
so I just did a quick test, trying to reverse the order as per script
sudo ln -s gsc /bin/cat
ln: failed to create symbolic link `/bin/cat': File exists
Do you see why I am confused? while my old way is fine
sudo ln -s /bin/cat /bin/gsc
tc@box:~$ ls /bin/gsc
/bin/gsc
If I do this
sudo ln -s /bin/cat gsc
tc@box:~$ ls ~/gsc
/home/tc/gsc
and that appears to be of the type "create a link to TARGET in the current directory"
thanks for reading
-
I am lost, what happens when someone installs both?
Assuming my brain hasn't fallen asleep on me, libgs only sets up /usr/local/bin/gs if it doesn't exist, whilst ghostscript will forcibly replace an existing /usr/local/bin/gs with it's version. So in theory, if a user installs both, ghostscript's version will always take priority over libgs's version.
thanks for helping but still confused, let stay with linking I have only known about
ln -s realfile newfile
Correct. So after libgs's script runs, you should be able to do this:
$ ls -l /usr/local/bin/gs
lrwxrwxrwx 1 root root 6 Feb 22 11:00 /usr/local/bin/gs -> gscWhich would point to the gsc relative to gs's path, or /usr/local/bin/gsc
If your link target is a directory, then the link is created inside that directory with the same name as the target, which is how ghostscript's tce.installed script works.
-
althalus as Rich may have wrote
The ln command is going to /usr/local/bin/ and from there creating a link from gs to gsc
we can agree its the reverse ,,,,,from realfile=gsc to gs
and that makes sense as libgs does not have a realfile = gs
libgs only sets up /usr/local/bin/gs if it doesn't exist, whilst ghostscript will forcibly replace an existing /usr/local/bin/gs with it's version
Great! That helps my understanding of those scripts. One of the reason I was posting is because I did not understand that point.
The other issue I am taking up with my fav maintainer so solved for now.
I think I prefer full pathways as I understand them better but I do know how to use inside folders
eg cd /usr/local/bin && ln -s realfile newfile
thanks heaps guys.
-
Hi aus9
Personally I always use:
ln -s path/to/file path/to/link
-
althalus as Rich may have wrote
The ln command is going to /usr/local/bin/ and from there creating a link from gs to gsc
I think Rich and I are saying the same thing, with different words. I understand a link from gs to gsc to mean:
gc -> gsc
Which is what you'd see if you ran ls -l gc
-
Hi aus9
Personally I always use:
ln -s path/to/file path/to/link
Perhaps you meant
ln -s /path/to/file /path/to/linkinstead?
-
Hi althalus
That is correct. If you read my explanation carefully, it states it creates the link (gs) in the directory path preceding
it, then points it to the file (gsc) in the same directory because the file (gsc) does not have a path preceding it.
-
Hi tinypoodle
Perhaps you meant
Code: [Select]
ln -s /path/to/file /path/to/link
instead?
If I want an absolute path, then yes. But I can use a relative path downward from where I am, or even:
ln -s ../a/b/file ../../../d/e/f/linkI left out the leading / because the path can be whatever suits your needs, though maybe I should have explained
that when I wrote it to begin with.
-
tc@box:~$ mkdir test7 && touch test7/bar
tc@box:~$ ln -s test7/bar test7/foo
tc@box:~$ file test7/*
test7/bar: empty
test7/foo: broken symbolic link to `test7/bar'
-
Hi tinypoodle
You are right, it's not quite that straight forward. The path to file appears to be influenced by the path to link.
To make that work you would have to do:
tc@box:~/msrbcusips/bonddurations$ mkdir x
tc@box:~/msrbcusips/bonddurations$ touch x/y
tc@box:~/msrbcusips/bonddurations$ ln -s ../x/y x/z
tc@box:~/msrbcusips/bonddurations$ ls -l x
total 0
-rw-r--r-- 1 tc staff 0 Feb 21 23:41 y
lrwxrwxrwx 1 tc staff 6 Feb 21 23:41 z -> ../x/yIn which case you might as well do:
tc@box:~/msrbcusips/bonddurations$ mkdir x
tc@box:~/msrbcusips/bonddurations$ touch x/y
tc@box:~/msrbcusips/bonddurations$ ln -s y x/z
tc@box:~/msrbcusips/bonddurations$ ls -l x
total 0
-rw-r--r-- 1 tc staff 0 Feb 21 23:47 y
lrwxrwxrwx 1 tc staff 1 Feb 21 23:47 z -> y