summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-05-16 16:19:18 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-05-16 16:19:18 +0300
commit9358ce594ff7e5c05b4a9df3155411d537c41de9 (patch)
treee3b8eefa0ca313bcf3b30f80d61aa8b687cade0f
parent2c080c11877fa083b6439b207368e05bb24e5b59 (diff)
downloadlibrpm-tizen-9358ce594ff7e5c05b4a9df3155411d537c41de9.tar.gz
librpm-tizen-9358ce594ff7e5c05b4a9df3155411d537c41de9.tar.bz2
librpm-tizen-9358ce594ff7e5c05b4a9df3155411d537c41de9.zip
Deal with bad lines in --setperms and --setugids.
Happens for example if a package is not installed (--pipe also captures stderr). Patch from OpenSuSE.
-rw-r--r--rpmpopt.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpmpopt.in b/rpmpopt.in
index b5c47473c..844a1f939 100644
--- a/rpmpopt.in
+++ b/rpmpopt.in
@@ -37,12 +37,12 @@ rpm alias --scripts --qf '\
--POPTdesc=$"list install/erase scriptlets from package(s)"
rpm alias --setperms -q --qf '[\[ -L %{FILENAMES:shescape} \] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \
- --pipe "grep -v \(none\) | sed 's/chmod .../chmod /' | sh" \
+ --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 -- \"$1\" \"$3\";chgrp -- \"$2\" \"$3\"; }';grep -v \(none\))|sh" \
+ --pipe "(echo 'ch() { 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 --conflicts --qf \