FS#55320 - [devtools] "-U" parameter doesn't work

Attached to Project: Arch Linux
Opened by Manuel Reimer (M-Reimer) - Monday, 28 August 2017, 09:46 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 29 August 2017, 15:49 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I want to autobuild a set of packages. As I also have to do stuff like updating the chroot it is easiest to run the "base script" as root.
I hoped the "-U" parameter allows me to do this, as it auto-switches to the user, given there, for building.

If I try to do so, I get:
[root@vdrdevel64 udisks]# makechrootpkg -c -U build -r /var/cache/repo-make/chroots/vdr4arch
==> Synchronizing chroot copy [/var/cache/repo-make/chroots/vdr4arch/root] -> [copy]...done
==> Making package: udisks 1.0.5-4 (Mon Aug 28 11:44:35 CEST 2017)
==> Retrieving sources...
-> Found udisks-1.0.5.tar.gz
-> Found drop-pci-db.patch
==> Validating source files with md5sums...
udisks-1.0.5.tar.gz ... Passed
drop-pci-db.patch ... Passed
==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.

==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: Build failed, check /var/cache/repo-make/chroots/vdr4arch/copy/build

So for some reason makepkg still runs as root. Please help...
This task depends upon

Closed by  Doug Newgard (Scimmia)
Tuesday, 29 August 2017, 15:49 GMT
Reason for closing:  Not a bug
Comment by Eli Schwartz (eschwartz) - Monday, 28 August 2017, 14:23 GMT
The -U flag tells makepkg which user to download sources as outside the chroot, since $SUDO_USER may not be set when sudo isn't being used to run the makechrootpkg script.

/chrootbuild runs as root, and executes `sudo -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"` with no option to set the user. Have you patched makechrootpkg?