Re: On the dangers of PKGNAME=.
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Adriaan de Groot wrote:
> 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.
>
> =46rom 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.
In this situation I would set $PKGNAME to "apps/kpilot" and add the
files under it to $INSTALL_DATA. For the other files under "share" add
a new install target "install-local". That's what it is for.
I suppose you might argue that this is more work. The alternative is
allowing an empty $PKGNAME. But that could dump files right below
"share" if you are not careful.
A compromise could be to make a difference between an empty $PKGNAME and
not setting $PKGNAME. It's subtle, but it makes sure that the user sets
$PKGNAME, so that he (hopefully) knows what he is doing.
> > > 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:
I consider this a bug in os.makedirs(). Would you want to post a bug
report for this or should I do it?
This is the relevant code:
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
if head and tail and not path.exists(head):
makedirs(head, mode)
mkdir(name, mode)
The problem is that the recursive implementation of makedirs() only
checks for existence of the dir before going recursive. It doesn't
check again after the recursive invocation. It should either do another
exists() or skip "." directories.
--
MORTICIAN: Bring out your dead!
[clang]
Bring out your dead!
[clang]
Bring out your dead!
CUSTOMER: Here's one -- nine pence.
DEAD PERSON: I'm not dead!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
-------------------------------------------------------
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/