[pacman-dev] pacman user+group support without mtree

pacman-dev pacman-dev at dodtsair.com
Mon Jun 4 20:55:12 UTC 2018


Hello Pacman Dev,
The basic question first, is there a way to create a tarball with .PKGINFO and use that tarball as a pacman package to install files with particular permissions without also adding a .MTREE file to that tarball?

More context, currently we install files into our servers using a bash script.  It pops open a tarball, keeping the users, groups, permissions, times for the files in the tarball, then it copies each file to the filesystem according to their location in the tarball.  It works great for a cheap slightly better then POC solution.  That tarball and a pacman pkg file are vary similar in that those are both tar files, with the files listed according to their desired location on the filesystem.    So my idea was that it would be relatively easy for me to add the appropriate .PKGINFO into the tarball and switch from using my bash script to using pacman itself.  This all worked great, except for users.  In this case the file was created, in the right place, with the right permissions but the wrong user and group.  

$ tar -tvf vienna-os-scaffold-0.0.0-any.pkg.tar.xz | grep sbin/vienna
-r-x------ vienna/nogroup               533 2017-12-04 13:18 usr/local/sbin/vienna
...
$ sudo pacman  --noconfirm -U vienna-os-scaffold-0.0.0-any.pkg.tar.xz 
warning: no 'XferCommand' configured
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) vienna-os-scaffold-0.0.0-0


:: Proceed with installation? [Y/n] 
(1/1) checking package integrity                                                                                                                                    [#####################################################################################################] 100%
(1/1) loading package files                                                                                                                                         [#####################################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                                   [#####################################################################################################] 100%
(1/1) checking available disk space                                                                                                                                 [#####################################################################################################] 100%
:: Processing package changes...
(1/1) installing vienna-os-scaffold 
...
$ ls -l /usr/local/sbin/vienna
-r-x------ 1 501 dialout 533 Dec  4 13:18 /usr/local/sbin/vienna

As the above shell script snippets demonstrate, the file usr/local/sbin/vienna is owned by "vienna" in the tarball, and assigned to group "nogroup".  It also is only readable and execute by the user.   When deployed by pacman it retains the permission and is installed at /usr/local/sbin/vienna.  Which is correct, but it is owned by dialout and 553?  This is not correct.  If I want the file to be installed with user=vienna and group=nogroup, do I need to create a .mtree file and add that to the package as well or is there some other way I can get pacman to look at the user and group of the file inside the tarball?

Michael Power


More information about the pacman-dev mailing list