2004-05-26T06:52:22ZFluxBBhttps://bbs.archlinux.org/viewtopic.php?id=4745I've written several scripts to maintain or improve Arch, two of which I've posted here. This one I wrote after I had seriously messed up a Pacman upgrade, and needed to pick up the pieces, so to speak.

findfuckery does nothing more than recurse through a directory tree and find the package owner of every file. I wrote it in Perl so it could cache results (i. e. after doing a pacman -Qo of a file, it would automatically throw in every other file from that package into a "found" hash so it wouldn't do a time-wasting lookup on those files, too). The reason I wrote this is because I accidentally updated about half of gnome without /opt mounted. Needless to say, I needed to easily find out which packages had been installed in there, so that I could remove them, mount opt, and then reinstall them properly.

Now the script. Runs with no arguments, just change directories to the tree you want to run it in (I ran it in /opt), and watch the colors fly. All of the verbose output goes to STDERR... the only thing that goes out to STDOUT is a final, unformatted, list of packages, so you can use this in shell scripts without a problem.