Re: finding orphaned files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




rpm-list-bounces@xxxxxxxxxx wrote on 07/22/2008 12:58:37 PM:

> OK. I'm not sure what you mean by "which way". If you haven't already
> done so, you might want to investigate the --dump query option to get
> detailed info on directory ownership and permissions.

by "which way" I mean that you can list a directory in the %files section a
handful of ways

%dir /path/to/dir
/path/to/dir
/path/to/dir/*

I'm not saying that they are all the Right Way, but that doesn't mean that
someone hasnt used all of them at one point or another. Where this makes a
difference is how it gets removed upon package removal.  Please correct me
if I'm wrong but don't the different methods of declaring the directory in
the %files section behave differently upon rpm removal? I want to say that
they do behave differently, but it has ben a while since I built an RPM
with the purpose of testing them.

The --dump option is helpful and probably what I need to figure out how to
access from inside python, but also shows my concern.

Lets take the the files in /boot/grub and the grub RPM (i'll shorten output
some for the sake of brevity):

My script tells methat these following files are not owned by an RPM:

/boot/grub/device.map
/boot/grub/e2fs_stage1_5
/boot/grub/fat_stage1_5
/boot/grub/ffs_stage1_5
/boot/grub/grub.conf
/boot/grub/iso9660_stage1_5
/boot/grub/jfs_stage1_5
/boot/grub/menu.lst
/boot/grub/minix_stage1_5
/boot/grub/reiserfs_stage1_5
/boot/grub/stage1
/boot/grub/stage2
/boot/grub/ufs2_stage1_5
/boot/grub/vstafs_stage1_5
/boot/grub/xfs_stage1_5

So a quick wrapper script verifies that (assuming the above list is inside
a file called orphans.lst):

[root@hawk ~]# for x in `cat orphans.lst`; do rpm -q --whatprovides $x;
done
file /boot/grub/device.map is not owned by any package
file /boot/grub/e2fs_stage1_5 is not owned by any package
file /boot/grub/fat_stage1_5 is not owned by any package
...
file /boot/grub/ufs2_stage1_5 is not owned by any package
file /boot/grub/vstafs_stage1_5 is not owned by any package
file /boot/grub/xfs_stage1_5 is not owned by any package

Yep, none of them are owned.  So lets look at the shared directory path,
/boot/grub.

[root@hawk ~]# rpm -q --whatprovides /boot/grub
grub-0.97-19

Now taking a --dump of grub:
[root@hawk ~]# rpm -q --dump grub
/boot/grub 4096 1190319671 00000000000000000000000000000000 040755 root
root 0 0 0 X
/sbin/grub 239780 1190319672 643711e5865afb872322eefd1dfbf2de 0100755 root
root 0 0 0 X
/sbin/grub-install 17645 1190319670 de58a44fb9850640aed1df09d2e62c82
0100755 root root 0 0 0 X
...
/usr/share/man/man8/grub.8.gz 766 1190319671
788ab166e49665d586e5b20552d88b67 0100644 root root 0 1 0 X

The only entry related to the /boot/grub direcory and its contents was
specifically /boot/grub, and the 3rd from last value supposedly specifies
"isdoc"*.  This value is not set to true (which I would assume would be a
1).  This should mean that it was defined as '/boot/grub' not '%dir
/boot/grub'.  (on a side note, any idea why the grub.8.gz man page file
would be considered a directory? is the man page wrong?)  So when I remove
that rpm, what happens to the directory and the files?

-greg




* per man page of rpm the column explanation is:
path size mtime md5sum mode owner group isconfig isdoc rdev symlink

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux