zhengzkkai / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

dst appending #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My opkg.conf looks as such

src  src   file:///home/ryan/src/packages/
dest target root/

I then run the command line in the directory /home/ryan/src/packages,
where there is a root/ , opkg.conf, and tmp/

./opkg-cl -cache opkg.cache  -conf opkg.conf  -t `pwd`/tmp -d target
--add-arch i386:1 update

Question 1:
In the dest directory, the path is appended so the root looks as such
(install one package zlib)

Which is correct :)
root/
root/usr
root/usr/lib
root/usr/lib/libz.so
root/usr/lib/libz.so.1
root/usr/lib/libz.so.1.2.5
root/lib

But this (below) .... Why is the path being appended to the dest path?

root/home
root/home/ryan
root/home/ryan/src
root/home/ryan/src/packages
root/home/ryan/src/packages/lib
root/home/ryan/src/packages/lib/opkg
root/home/ryan/src/packages/lib/opkg/info
root/home/ryan/src/packages/lib/opkg/info/zlib.control
root/home/ryan/src/packages/lib/opkg/info/zlib.list
root/home/ryan/src/packages/lib/opkg/status

It should be

root/lib/opkg/....

Right?

Original issue reported on code.google.com by ryan.raa...@gmail.com on 6 Oct 2010 at 8:44

GoogleCodeExporter commented 9 years ago
Looks suspiciously like what I'm experiencing...
Can you post your --with-opkglibdir and --with-opkgetcdir values?

Also... I thought every "dest" was supposed to be an absolute path. Your 
"root/" works because you run opkg-cl from directory exactly one level up...

Original comment by paintitg...@gmail.com on 26 Jan 2012 at 10:18

GoogleCodeExporter commented 9 years ago
Well, the problem is apparently in libopkg/pkg_dest.c. Look at the 
pkg_dest_init function. The dest->opkg_dir variable is made from root_dir and 
the suffix from OPKG_STATE_DIR_PREFIX macro, which is made from OPKGLIBDIR and 
"/opkg".

OPKGLIBDIR is an absolute path (/usr/lib by default), and I'm pretty sure the 
absolute paths aren't suitable for being someone else's suffixes.

The solution is to either edit configure.ac (and mention in its help section 
that --with-opkglibdir should NOT be an absolute path), or remove that path 
concatenation mentioned above. Guess we'll have to wait for the project 
authors' opinion on that...

Original comment by paintitg...@gmail.com on 26 Jan 2012 at 11:47

GoogleCodeExporter commented 9 years ago
OPKGLIBDIR is supposed to be an absolute path, we might just end up with a 
double '/' when it's joined to root_dir, which isn't a big issue here.

However, I think root_dir should also be an absolute path. So 'dest' lines in 
opkg.conf must be absolute paths. When the documentation for opkg.conf is 
written, this needs to be mentioned.

Original comment by paul.betafive on 28 Sep 2013 at 1:27

GoogleCodeExporter commented 9 years ago
Wait a moment. You marked the issue as invalid and didn't tell the reporter 
what to do to work it around, or at least what to change in his config file.

Original comment by paintitg...@gmail.com on 30 Oct 2013 at 11:27

GoogleCodeExporter commented 9 years ago
Apologies, I could probably have been clearer with this. I was trying to 
quickly work through old issues which were reported years before my involvement 
with the project to determine if they still needed adressing.

The 'dest' lines in the configuration should specify absolute paths. Adding an 
absolute path such as '/usr/lib' as a suffix to another path such as '/root/' 
may result in '/root//usr/lib' but that double forward slash should be ignored 
by the filesystem.

It seems that the relative 'dest' path is confusing opkg when it tries to write 
its status files.

Original comment by paul.betafive on 30 Oct 2013 at 11:38

GoogleCodeExporter commented 9 years ago
Okay, but if the path is absolute, then it shouldn't be appended as a suffix to 
anything, should it? You put "/home/yourself/dir" in the config and you expect 
the program to access exactly "/home/yourself/dir", not 
"root/home/yourself/dir" or something else!

That's what I was implying in my previous comments, and I'm pretty sure that's 
also what the reporter was talking about.

Original comment by paintitg...@gmail.com on 30 Oct 2013 at 2:29

GoogleCodeExporter commented 9 years ago
So...?

Original comment by paintitg...@gmail.com on 12 Dec 2013 at 10:30