Bug 143841

Summary: [fixfiles] Should apply to installed files only
Product: [Fedora] Fedora Reporter: Enrico Scholz <rh-bugzilla>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, pgraner, sundaram
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.19.2-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-04 23:30:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2004-12-29 20:14:33 UTC
Description of problem:

'fixfiles -R ...' should visit only installed files. Currently, it
handles all files shipped by an rpm.

Reasons, why files are not installed, can be:

* a set '%_install_langs' macro
* a set '%_netsharedpath'
* manual '--exclude*' options


E.g. on a machine where '/usr' is in %_netsharedpath

| # fixfiles -R coreutils relabel
| restorecon get context on /usr/bin/[ failed: 'Operation not supported'
| ...
| restorecon get context on /usr/share/man/man1/yes.1.gz failed: 'Operation not supported'


or when only some languages are installed:

| # fixfiles -R coreutils relabel
| lstat(/usr/share/locale/af/LC_MESSAGES/coreutils.mo) failed: No such file or directory
| ...
| lstat(/usr/share/locale/zh_TW/LC_TIME/coreutils.mo) failed: No such file or directory



Such files can be identified with the '-qs' switch

| # rpm -qs coreutils
| normal        /sbin/runuser
| net shared    /usr/bin/[
| ...
| net shared    /usr/share/man/man1/yes.1.gz

resp.

| normal        /usr/share/info/coreutils.info.gz
| not installed /usr/share/locale/af/LC_MESSAGES/coreutils.mo
| ...
| not installed /usr/share/locale/zh_TW/LC_TIME/coreutils.mo
| normal        /usr/share/man/man1/basename.1.gz



Version-Release number of selected component (if applicable):

policycoreutils-1.19.1-1


How reproducible:

100%


Steps to Reproduce:
1. echo '%_install_langs C' >>/etc/rpm/macros
2. install/upgrade an rpm package with %lang(...) specifiers
3. run 'fixfiles -R ...' on this package


Actual results:

lots of bogus warnings and errors

Comment 1 Enrico Scholz 2004-12-29 20:50:26 UTC
A selector for all "good" files would be

| rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$package" | grep '^0 ' | cut -f2- -d ' '


Comment 2 Daniel Walsh 2005-01-03 18:54:30 UTC
Added to policycoreutils-1.19.2-2