Please support VectorLinux!

Author Topic: Run command after uninstall app  (Read 1206 times)

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Run command after uninstall app
« on: February 25, 2011, 07:55:54 pm »
I am building an applications that will update the mime folder. It will screw up the mime type for my desktop after i install it. It can be solve by running
Quote
update-mime-database /usr/share/mime


I can modify the slackbuild to include below command inside the doinst.sh

Quote
if [ -x usr/bin/update-desktop-database -a -x usr/bin/chroot ]; then
  usr/bin/chroot /$ROOT /usr/bin/update-desktop-database &> /dev/null
fi

if [ -x usr/bin/update-mime-database -a -x usr/bin/chroot ]; then
  usr/bin/chroot /$ROOT /usr/bin/update-mime-database /usr/share/mime &> /dev/null
fi

but what if I uninstall the app and re-run the command again?

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Run command after uninstall app
« Reply #1 on: February 25, 2011, 08:29:51 pm »
what files are in the pkg/usr/share/mime/ dir?

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Run command after uninstall app
« Reply #2 on: February 25, 2011, 08:41:11 pm »
Quote
usr/share/mime/
usr/share/mime/application/
usr/share/mime/application/x-glabels.xml
usr/share/mime/aliases
usr/share/mime/packages/
usr/share/mime/packages/glabels.xml
usr/share/mime/icons
usr/share/mime/globs2
usr/share/mime/XMLnamespaces
usr/share/mime/subclasses
usr/share/mime/treemagic
usr/share/mime/types
usr/share/mime/globs
usr/share/mime/magic
usr/share/mime/mime.cache
usr/share/mime/generic-icons
usr/share/omf/
usr/share/omf/glabels/
usr/share/omf/glabels/glabels-de.omf
usr/share/omf/glabels/glabels-C.omf
usr/share/omf/glabels/glabels-es.omf
usr/share/omf/glabels/glabels-cs.omf
usr/share/omf/glabels/glabels-fr.omf
usr/share/mime-info/
usr/share/mime-info/glabels.keys
usr/share/mime-info/glabels.mime

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Run command after uninstall app
« Reply #3 on: February 28, 2011, 08:27:03 pm »
Anyone have any idea?
Cause when you remove some package it need to manually run update-mime-desktop /usr/share/mime to fix the mime setting...

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Run command after uninstall app
« Reply #4 on: February 28, 2011, 08:55:51 pm »
sorry I didnt get back to you sooner.
the package should not  have any files in the /usr/share/mime dir
running "rm $PKG/usr/share/mime/*" from the slackbuild should delete the files and leave the dirs that are needed for this pkg

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Run command after uninstall app
« Reply #5 on: February 28, 2011, 10:26:48 pm »
sorry I didnt get back to you sooner.
the package should not  have any files in the /usr/share/mime dir
running "rm $PKG/usr/share/mime/*" from the slackbuild should delete the files and leave the dirs that are needed for this pkg

Not quite clear what you are saying... ??? ??? ??? ???