[pacman-dev] [PATCH 10/11] makepkg: do not ask sudo password twice

Loui Chang louipc.ist at gmail.com
Fri Jun 18 06:58:18 EDT 2010

On Thu 17 Jun 2010 19:09 -0500, Dan McGee wrote:
> Correct. There is really no way to avoid being root here; you are
> going to touch everything on the system *and* you need arbitrary
> command execution.
>   /* geteuid undefined in CYGWIN */
>   uid_t myuid = geteuid();
> ......
>   /* check if we have sufficient permission for the requested operation */
>   if(myuid > 0 && needs_root()) {
>     pm_printf(PM_LOG_ERROR, _("you cannot perform this operation
> unless you are root.\n"));
>     cleanup(EXIT_FAILURE);
>   }
> > 2) Doing the actual packaging as root is dangerous, especially if you have
> > "make install" by accident in your PKGBUILD.  Or, as does happen, the
> > software has a shitty Makefile and ignores DESTDIR for part of the
> > installation (for this reason --asroot is not being removed).
> +1000, Try packaging munin sometime from a blank slate as root and let
> me know when you un-screw your system. I have spent a long time
> haggling with packages like that to make sure they are actually doing
> their work in $pkgdest rather than my live system.

Hmm. How does it exactly screw your system?
I did notice that it doesn't have an uninstall make rule, but other than
that it seems to perform sanely, and easy to clean up.

More information about the pacman-dev mailing list