View Single Post
  #8   (View Single Post)  
Old 14th June 2008
harisman's Avatar
harisman harisman is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Hellas (Greece)
Posts: 66
Default

I use portupgrade and pkg_cutleaves (carefully used)

When removing packages, I am not using pkg_delete or pkg_deinstall with the -r/-R options because they caused me enough times troubles but the below script , which backups the package and display the left dependencies ( I have call it pkg_remove )

Code:
#!/bin/sh
before="/tmp/pkg_remove_before.tmp"
after="/tmp/pkg_remove_after.tmp"
pkg_cutleaves -l > $before
pkg_create -b $1
pkg_delete $1
pkg_cutleaves -l > $after
diff $before $after | awk '
BEGIN { print "####################################################"}
/\</ {print "Unistalled: "$2}
/\>/ {print "Remaining: "$2}
END { print "####################################################"}
'

Last edited by harisman; 14th June 2008 at 04:56 PM. Reason: I forgot the final quote..
Reply With Quote