I spent the evening cooking up this little script. I'm glad that there's already a thread for PiSi tricks, becuase a full thread for my script is completely overblown.
This came about when I uninstalled VLC, but there were about 8 other packages still lingering on the system that had been downloaded as dependencies. PiSi has no way of finding and removing uneeded/unused packages that were only installed to satify a dependency. I really liked that feature in Apt , so I wrote a ruby script to run through all of the installed packages, and see if the file you just uninstalled was a reverse dependency.
ruby script.rb
( just copy the text to a blank text document and name it *.rb)
It will prompt for a file name. I used "vlc" since that was the package I had just uninstalled, but you should use whatever you just uinstalled.
As you can see there's no error handling, but it's a simple script, so a crash shouldn't wreck your record uptime sesson

. Also, it's setup to just search for reverse dependencies of
REMOVED packages, so don't try to use this as a general lookup tool.
A final word, this script goes through a bunch of text, and peforms many, many PiSi commands. It takes about 3-5 minutes for it to search thought all of the information and return the results. Good script to run during a commerical/bathroom/taco break.
#![/bin/ruby]
puts "Target package:"
target = gets.chomp!
puts "Okay, so lets look for files that were installed with "+target+" \n but are no longer needed...\n This will take awhile"
installed = `pisi li`
found = Array.new
installed.each do |x|
package= x.slice!(0..x.index(' - ')).strip!
if `pisi info #{package} | grep #{target}`.length > 0
depend = `pisi info #{package} | grep 'Reverse Dependencies' `
depend = depend.split("\n")
if depend[0].length < 24
puts package
end
end
end
puts "We're done here, you can use pisi remove <package> to remove the files"