Author Topic: Ipkg-link's To Home  (Read 1631 times)

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Ipkg-link's To Home
« on: February 14, 2005, 09:14:18 pm »
Hi all. I figured out & fixed a bug I was experiencing in the new ipkg-link. Has anybody else seen this? I couldn't figure out why the symlinks were being placed under /root/opt/QtPalmtop/... instead of just /opt/QtPalmtop/... I figured out that if the dest mount points specified in the /etc/ipkg.conf file had trailing slash, as mine did:

Code: [Select]
root@grond:~# grep ^dest /etc/ipkg.conf
dest root /
dest cf /mnt/cf/
dest sd /mnt/card/
dest sd1 /mnt/card1/
dest ram /mnt/ram/
Then ipkg-link would strip off the leading slash when specifying the symlink & I just happened to be sitting in root's home directory when I ran the script, so the link would be created as 'ln -s file opt/Qtpalmtop/...' instead of 'ln -s file /opt/Qtpalmtop/...'. So what I did is change two lines in the script:

Code: [Select]
root@grond:/home/opt/bin# diff ipkg-link*
31,32c31,32
<         PREFIX="${i%/}"
<         files=`cat "$PREFIX/usr/lib/ipkg/info/$PACKAGE.list" | sed -e "s:${i%/}::g"`
---
>         PREFIX="$i"
>         files=`cat "$PREFIX/usr/lib/ipkg/info/$PACKAGE.list" | sed -e "s:${i}::g"`
Notice the shell-ism around the $i variable, ${i%/}. This strips the trailing slash off of the mount point, but only if it exists, so there's no effect if there isn't one.

I hope this helps somebody else, but it seems kinda weird that I'd be the only one to experience it. So let me know what you think. thks
GROG!