Re: On the dangers of PKGNAME=.
Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 23 October 2003 14:54, you wrote:
> Adriaan de Groot wrote:
> > there would be redundant), I've been reduced to setting PKGNAME=. in KDE
> > recipes.
> This sounds like an ugly solution to me. Setting $PKGNAME to "." is
> alsmost the same as setting it to "".
It is.
> Isn't this similar to using a package name "apps/kpilot"? From this
> short snippit I would think that's the package name.
From this short snippet, yes. Unfortunately, this one recipe needs to install
the following files under share:
./share/apps/kpilot/sysinfoconduit/Template.html
./share/apps/kpilot/sysinfoconduit/Template.txt
./share/services/sysinfo-conduit.desktop
(and several more).
This is a kind of fighting against the beerkaai; KDE just does it this way
even if you'd prefer it didn't.
> > I imagine this is because makedirs recurses and makes each component of
> > the requested path, and /tmp/kde/share and /tmp/kde/share/., while
> > separate components, are the same directory. The attached patch adds a
>
> I don't understand how this can go wrong. Aap only calls os.makedirs()
> if the directory doesn't exist yet. And os.makedirs() only recurses for
> directories that don't exist. Did Python 2.2 have a bug in
> path.exists()? Try this manually:
It is most peculiar:
hashbrown.ebn.kun.nl$python
Python 2.2.2 (#1, May 15 2003, 11:08:44)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.makedirs("/tmp/./balkenende")
>>> os.makedirs("/tmp/kde/./balkenende")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/os.py", line 202, in makedirs
makedirs(head, mode)
File "/usr/local/lib/python2.2/os.py", line 203, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/kde/.'
>>> os.makedirs("/tmp/kde/./balkenende")
>>> os.makedirs("/tmp/kde/./balkenende")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/os.py", line 203, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/kde/./balkenende'
A second attempt (now with python 2.2.3, to see if it makes a diff):
>>> os.makedirs("/tmp/from/here/on/in")
>>> os.makedirs("/tmp/its/./all/downhill")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/os.py", line 203, in makedirs
makedirs(head, mode)
File "/usr/local/lib/python2.2/os.py", line 203, in makedirs
makedirs(head, mode)
File "/usr/local/lib/python2.2/os.py", line 204, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/its/.'
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/