Skip to content

Commit

Permalink
Remove misleading --setperms and --setugids warnings (RhBug: 1538610)
Browse files Browse the repository at this point in the history
Non-existent %ghost or %missingok files should not cause warnings
generated by rpm --setperms or rpm --setugids.
  • Loading branch information
pavlinamv committed Jun 28, 2018
1 parent e3204e8 commit 38c2f6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rpmpopt.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ rpm alias --scripts --qf '\
' \
--POPTdesc=$"list install/erase scriptlets from package(s)"

rpm alias --setperms -q --qf '[\[ -L %{FILENAMES:shescape} \] || chmod %7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \
rpm alias --setperms -q --qf '[\[ -L %{FILENAMES:shescape} \] || \
\[ $((%{FILEFLAGS} & 2#1001000)) != 0 \] && \[ ! -e %{FILENAMES:shescape} \] || \
chmod %7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \
--pipe "grep -v \(none\) | grep '^. -L ' | sed 's/chmod .../chmod /' | sh" \
--POPTdesc=$"set permissions of files in a package"

rpm alias --setugids -q --qf \
'[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \
--pipe "(echo 'ch() { chown -h -- \"$1\" \"$3\";chgrp -h -- \"$2\" \"$3\"; }';grep '^ch '|grep -v \(none\))|sh" \
'[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape} %{FILEFLAGS}\n]' \
--pipe "(echo 'ch() { \[ $(($4 & 2#1001000)) != 0 \] && \[ ! -e \"$3\" \] || \
(chown -h -- \"$1\" \"$3\";chgrp -h -- \"$2\" \"$3\";) }'; \
grep '^ch '|grep -v \(none\))|sh" \
--POPTdesc=$"set user/group ownership of files in a package"

rpm alias --setcaps -q --qf \
Expand Down

0 comments on commit 38c2f6e

Please sign in to comment.