You are not logged in.

#1 2010-02-19 03:30:26

hw-tph
Member
Registered: 2006-11-01
Posts: 149

Unexpected basename/find result inside PKGBUILD fakeroot

In my PKGBUILD I am trying to collect a few pixmaps and dump them inside the /usr/share/pixmaps directory. I am failing miserably when trying to do it in some sort of elegant way.


build() {
  # Snip!
  find $srcdir -type f -name \*.png -exec install -D -m644 {} $pkgdir/usr/share/pixmaps/$(basename {}) \;
  # Snip!
}

Even though I use $(basename {}) in my find command, the result I get is that files are installed to /usr/share/pixmaps/home/hakan/devel/aur/blah/src/blah/images/.... This is obviously not what I want.

I have inserted debug statements and the basename seems to be completely ignored. However, when I run the same command manually (not inside the PKGBUILD) to verify I'm not totally insane, it works as expected.

Any pointers?

Offline

#2 2010-02-19 08:31:21

hw-tph
Member
Registered: 2006-11-01
Posts: 149

Re: Unexpected basename/find result inside PKGBUILD fakeroot

It is not half as elegant as I like, but now I simply use a couple of for loops to do the same thing and it works as expected.

I would very much appreciate if somebody could tell me what's wrong with what I posted above, though.

Offline

#3 2010-02-19 11:04:02

kaaposc
Member
From: Latvia
Registered: 2008-07-16
Posts: 30

Re: Unexpected basename/find result inside PKGBUILD fakeroot

Unless you have pixmap files with whitespace in name you could try this:

find $srcdir -type f -name \*.png -exec sh -c 'install -D -m644 {} $pkgdir/usr/share/pixmaps/$(basename {})' \;

Offline

Board footer

Powered by FluxBB