keenerd / packer

Bash wrapper for pacman and AUR.
246 stars 48 forks source link

--asroot is no longer an option #131

Open nshp opened 9 years ago

nshp commented 9 years ago

As of Pacman 4.2, --asroot is no longer an option. makepkg must be run as a normal user. Perhaps packer should give its own error message when run as root?

JotaRandom commented 9 years ago

Yeah, if packer s for install packages from AUR and makepkg not support root user, then why packer support it?, yeah I aggre in a silly nbut informative message about not supporting root.

nubzzz commented 9 years ago

This is also a problem that I am encountering.

pawel-tomkiel commented 9 years ago

Yeah, it emerged to me after todays update. I can't finalize update with all dependencies in AUR

f3rno commented 9 years ago

+1, although running as a normal user works just fine.

mgalgs commented 9 years ago

To get around this, just run packer as a normal (non-root) user.

See also: https://github.com/archlinuxfr/yaourt/issues/67

f3rno commented 9 years ago

Pull request #132 fixes this, would be good to get it in since many people must be experiencing this problem.

xmw commented 9 years ago

what about

# diff -Naur /usr/bin/packer*
--- /usr/bin/packer     2014-08-11 10:43:24.000000000 +0200
+++ /usr/bin/packer.xmw 2015-01-01 23:39:05.706239397 +0100
@@ -328,7 +328,9 @@

   # Installation (makepkg and pacman)
   if [[ $UID -eq 0 ]]; then
-    makepkg $MAKEPKGOPTS --asroot -f
+    id pacman >/dev/null 2>/dev/null || useradd -r -d /var/empty pacman
+    chown -R pacman:pacman .
+    su -c "makepkg $MAKEPKGOPTS -f" pacman
   else
     makepkg $MAKEPKGOPTS -f
   fi
ghost commented 9 years ago

@xmw golly, i wish github had a comment voting option. i'd vote your patch up so hard.

i'd love to see that implemented as well.

oshazard commented 9 years ago

EDIT: Added workaround to apacman wrapper @xmw Thank you for such an elegant fix! I was going to implement AUR user in the .install which is less optimal.

mil commented 9 years ago

+1 thanks @xmw

simon-thorpe commented 9 years ago

+1 @xmw I've now migrated to using apacman instead since the developer implemented this patch.

despairblue commented 9 years ago

:+1:

RaederDev commented 9 years ago

Thank you @xmw that fixed my update problems.