#! /bin/sh

set -e

# if we're upgrading from a version using the old format
if( (test "$1" = "upgrade") && (dpkg --compare-versions "$2" lt "1.4") ); then
  #convert to the new format, saving the old just to be completely save
  for FILE in `ls /etc/desktop-profiles/*.listing`; do
    mv $FILE $FILE.oldformat;
    cat $FILE.oldformat | sed -e 's/\(.*;\)\(.*;.*;.*;\)\(.*;\)\(.*\)/\1\3\2\4/g' > $FILE
  done;  
fi;  

#DEBHELPER#
