[pacman-dev] [PATCH] makepkg: fall back to su if sudo is not available
Jim Pryor
lists+pacman-dev at jimpryor.net
Thu Feb 25 21:52:21 EST 2010
On Thu, Feb 25, 2010 at 09:05:11PM -0500, Ray Kohler wrote:
> On Thu, Feb 25, 2010 at 7:25 PM, Allan McRae <allan at archlinux.org> wrote:
> >
> > does:
> > su -c "$PACMAN $PACMAN_OPTS $@"
> > not work?
>
> No, that somehow gets parsed as:
>
> su -c 'pacman -U' pkgname
>
> Which makes su complain that there's no such user as pkgname. I found
> no other way to get the whole command into a single string other than
> stuffing it into another variable as I did, and I spent over an hour
> trying various things.
That's the result of the "$@". This should work:
su -c "$PACMAN $PACMAN_OPTS $*"
The normal advantages of using "$@" over using "$*" would have been eliminated
in this context, anyway.
--
Jim Pryor
profjim at jimpryor.net
More information about the pacman-dev
mailing list