Notices


Reply
Thread Tools
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#21
ok,

i created a new liq* app and enabled maemo-optify in the entire thing.

the following is the bare essentials that I am trying to optify.
bigfile.fakepicture.jpg is exactly what it says, 50mb of media which *SHOULD* be optified.

/usr/share/liqbase/maeoptifytest/
/usr/share/liqbase/maeoptifytest/maeoptifytest
/usr/share/liqbase/maeoptifytest/maeoptifytest.so
/usr/share/liqbase/maeoptifytest/media
/usr/share/liqbase/maeoptifytest/media/bigfile.fakepicture.jpg
/usr/share/liqbase/maeoptifytest/media/readme


maemo-optify in the package runs over hte contents and finds this one large file to optify, saving 50mb
what happens next is where things get interesting.

the bigfile in this instance is 50mb of required media and I want to install it on a machine with 45mb remaining.

maemo-optify works in the following manner:

for each file it finds needing optification, it calls a custom function which is inserted into the POSTINST file, like this:

Code:
# Added by maemo-optify, with apologies.

optify () {
    f="$1"
    if [ ! -h "/$f" ]; then

        # This is not atomic, but re-startable: if interrupted, doing
        # this again will eventually finish with the correct result.
        #
        # XXX - At least that's the idea, but tar needs to be properly
        #       instructed to overwrite the targets.

        echo >&2 "Optifying $f -> /opt/maemo/$f"
        if [ -d "/$f" ]; then
            (cd "/" && tar cf - "$f") | (cd "/opt/maemo/" && tar xf -)
        fi
        mv "/$f" "/$f.removed"
        ln -s "/opt/maemo/$f" "/$f"
    fi

    if [ -e "/$f.removed" ]; then
        rm -rf "/$f.removed"
    fi
}
optify("/usr/share/liqbase/maeoptifytest/media/bigfile.fakepicture.jpg");

the fact this is in the postinst is important, it has to use the whole 50mb immediately to first contain the file, then after everything is done it will move the file to /opt


extra points if you can spot any other potential issues.

i'm gonna do some more investigation and see if theres a way round this
(at least in my specific case I am going to do the original suggestion javis and I think might work), I just dont want this breaking for everyone.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#22
Originally Posted by lcuk View Post
at least in my specific case I am going to do the original suggestion javis and I think might work.
Unfortunately, https://bugs.maemo.org/show_bug.cgi?id=6026 will prevent it from entering extras-testing, unless you can find another way to ensure the library is installed first.
 

The Following User Says Thank You to javispedro For This Useful Post:
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#23
filed a bug: #7276 maemo optify works in postinst and breaks still when space is limited
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#24
Btw, I am not exactly sure about what optify is doing here. Where is the "optify ()" bash function called? A packaged I uploaded to the autobuilder was optified in the usual way (large files were moved to /opt and they _unpack there_), but also did this to the postinst script...

Code:
#!/bin/sh

set -e

case "$1" in
    configure)
    ... blablabla ...
esac

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

exit 0

--stuff added by maemo-optify starts now--
# Added by maemo-optify, with apologies.

optify () {
...
}
Wild guess is that it does something to help smooth upgrades..



Lcuk: note that the bug you filed is probably caused because the application manager will refuse to install things bigger than whatever free space you have in the root partition since it doesn't know in which partition they'll end up.

Last edited by javispedro; 2009-12-23 at 18:15.
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#25
Also, maemo-optify didn't used to deal with paths which didn't include the package name. I can't remember if that's changed: check the source or maemo-developers.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#26
Originally Posted by javispedro View Post
Lcuk: note that the bug you filed is probably caused because the application manager will refuse to install things bigger than whatever free space you have in the root partition since it doesn't know in which partition they'll end up.
I don't think so, or then it's not possible to install openarena anymore
 

The Following User Says Thank You to mikkov For This Useful Post:
aironeous's Avatar
Posts: 819 | Thanked: 806 times | Joined on Jun 2009 @ Oxnard, Ca.
#27
Holy crap. I would have never installed it if i knew it wasn't optified, I assumed it was.

Do not brag or promote your app until it is optified ok? This is very important, you cannot leave this out at any time, period!
Keep it in testing or devel until you optify it or i will complain in this forum.

What do i do to get rid of this 256 rom eating app, In simple user terms?

Can you dev's just say optimizied or not before you talk about it?
Can you just post it in your signature what is optified?
I don't even understand what the op is talking about other than it is not optified.

Last edited by aironeous; 2009-12-23 at 22:16.
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:50.