RPM Community Forums

Mailing List Message of <rpm-users>

Re: How not to use rpm owner/group info on unpack?

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 09 Nov 2010 - 03:27:03 CET
Message-id: <CEF40A23-B333-45B5-A0EA-16A3AEA11E78@mac.com>

On Nov 8, 2010, at 9:12 PM, Jeff Johnson wrote:

> See the popt aliases that queries user/group/mode, pipes to awk,

Correction #1: s/pipes to awk/writes shell commands/. It's --last
that uses awk.

> and write the commands that do what you want:
> 	rpm -p --setugids foo*.rpm
> 	rpm -p --setperms foo*.rpm
> in spite of what cpio/alien/tar choose to do.
> When you discover that you need "./" prefixed to

Correction #2: no specific need to prefix if you chdir ...

> that path in the --queryformat, then look at the popt alias
> (usually in /usr/lib/rpm/rpmpopt):
> rpm     alias --setugids -q --qf \
>        '[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shes
> cape}\n]' \

.................................................................^ but added prefix goes here.

>        --pipe "(echo 'ch() { chown -h -- \"$1\" \"$3\";chgrp -h -- \"$2\" \"$3\
> "; }';grep -v \(none\))|sh" \
>        --POPTdesc=$"set user/group ownership of files in a package"

You can extend RPM queries in any number of ways

	-- including invoking rpm2cpio/cpio/tar/alien/whatever --

if you think a bit. See "man 3 popt".

73 de Jeff
Received on Tue Nov 9 03:28:08 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.