Package postinst tries to write into read-only /dev/.static/dev.
true upgrade_postgresql
true upgrade first # neki paketi moraju rucno
true upgrade second # neke pakete zelimo ranije
+true remove_orphaned # ocisti stare libove nakon sto su cn paketi nadogradjeni
true dist_upgrade # instaliraj ostatak
# i ostatak
true debconf_priority reset
xinetd-cn xinetd
'
+# simulate deborphan
+orphaned_packages='
+libsnmp9
+libsensors3
+'
+
# Check if these services are running after upgrade
# package-cn user proces (pazi, regexp) nice name
services_to_check='
fi
}
+# check if package is orphaned (nothing depends on it)
+is_orphaned () {
+ local package deps
+
+ package=$1
+ deps=$(apt-get remove -s $package | grep ^Remv | wc -l)
+ if [ "$deps" -eq 1 ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+# remove old and unused libraries
+remove_orphaned () {
+ local package
+
+ for package in $orphaned_packages; do
+ if is_orphaned $package; then
+ pkgrm $package
+ fi
+ done
+}
+
# monit it causing problems for postinst scripts
# restarting daemons so try to disable it
disable_monit () {