Reply
Thread Tools
Posts: 21 | Thanked: 14 times | Joined on Dec 2009 @ Turku, Finland
#1
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:

Code:
#!/bin/sh
# postinst script for boulderdash
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    configure)
        ln -s /opt/maemo/usr/bin/boulderdash /usr/bin/
        ln -s /opt/maemo/usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png /usr/share/icons/hicolor/64x64/apps/
        chmod a+x /opt/maemo/usr/bin/boulderdash
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        rm /usr/bin/boulderdash
        rm /usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
 
VDVsx's Avatar
Posts: 1,070 | Thanked: 1,604 times | Joined on Sep 2008 @ Helsinki
#2
Originally Posted by timperi View Post
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:

Code:
#!/bin/sh
# postinst script for boulderdash
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    configure)
        ln -s /opt/maemo/usr/bin/boulderdash /usr/bin/
        ln -s /opt/maemo/usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png /usr/share/icons/hicolor/64x64/apps/
        chmod a+x /opt/maemo/usr/bin/boulderdash
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        rm /usr/bin/boulderdash
        rm /usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
Why are you doing the symbolics links in the postinst script instead of in the rules script ?
__________________
Valério Valério
www.valeriovalerio.org
 

The Following User Says Thank You to VDVsx For This Useful Post:
Posts: 21 | Thanked: 14 times | Joined on Dec 2009 @ Turku, Finland
#3
Originally Posted by VDVsx View Post
Why are you doing the symbolics links in the postinst script instead of in the rules script ?
Because i don't know any better. Thanks for the tip, I'll look into that rules-script
 

The Following User Says Thank You to timperi For This Useful Post:
VDVsx's Avatar
Posts: 1,070 | Thanked: 1,604 times | Joined on Sep 2008 @ Helsinki
#4
Originally Posted by timperi View Post
Because i don't know any better. Thanks for the tip, I'll look into that rules-script
If you put the same code in the rules script, it will solve your problem.

If you want to learn a bit more about these scripts, you can find some info here: http://www.debian.org/doc/debian-pol...erscripts.html
__________________
Valério Valério
www.valeriovalerio.org
 

The Following User Says Thank You to VDVsx For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#5
Originally Posted by VDVsx View Post
If you put the same code in the rules script, it will solve your problem.

If you want to learn a bit more about these scripts, you can find some info here: http://www.debian.org/doc/debian-pol...erscripts.html
Which rules script - the reference actually describes only build time rules but not installation?

(Sorry for bother you).
 

The Following User Says Thank You to egoshin For This Useful Post:
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#6
Originally Posted by timperi View Post
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:
Sorry, but you're doing it all wrong.

Use maemo-optify. Simplest is to make debian/optify file with "auto" in it. Then run maemo-optify-deb for debs produced with dpkg-buildpackage.

Other option is to install directly to /opt/boulderdash directory
 

The Following 2 Users Say Thank You to mikkov For This Useful Post:
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#7
Originally Posted by mikkov View Post
Sorry, but you're doing it all wrong.

Use maemo-optify. Simplest is to make debian/optify file with "auto" in it. Then run maemo-optify-deb for debs produced with dpkg-buildpackage.

Other option is to install directly to /opt/boulderdash directory
Does maemo-optify work in Windows using MADDE? If not, what would be the best way to optify in Windwos?
 

The Following User Says Thank You to Sasler For This Useful Post:
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#8
Originally Posted by Sasler View Post
Does maemo-optify work in Windows using MADDE? If not, what would be the best way to optify in Windwos?
I don't know. But if you're sending packages to autobuilder, maemo-optify works there. Testing before uploading hard, if it doesn't work.

Installing directly to /opt is always possible, I assume.
 

The Following 2 Users Say Thank You to mikkov For This Useful Post:
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#9
Originally Posted by mikkov View Post
I don't know. But if you're sending packages to autobuilder, maemo-optify works there. Testing before uploading hard, if it doesn't work.
Yes, I am sending them to autobuilder, but I'm using Maemo Extras Assistant. Do I need to somehow to tell it to optify and how?

Originally Posted by mikkov View Post
Installing directly to /opt is always possible, I assume.
I tried that, but I must have done something wrong, because nothing worked.
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#10
Originally Posted by Sasler View Post
Yes, I am sending them to autobuilder, but I'm using Maemo Extras Assistant. Do I need to somehow to tell it to optify and how?
auto in debian/optify file is the hint for autobuilder.
 

The Following 2 Users Say Thank You to mikkov For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:44.