[Bug 507089] Review Request: olpc-powerd - power management for the XO laptop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=507089





--- Comment #4 from Christoph Wickert <fedora@xxxxxxxxxxxxxxxxxxxx>  2009-07-16 19:21:40 EDT ---
On the scriptlets again...

Your scripts only handle the case where one replaces ohm with powerd, but not
when upgrading powerd. The problem is the order: Upon an upgrade, %preun of the
old package runs after %post of the new package, see
https://fedoraproject.org/wiki/Packaging/ScriptletSnippets#Scriptlet_Ordering

So what we get is:

initctl start powerd
initctl start olpc-switchd
...
initctl stop olpc-switchd
initctl stop powerd

This cannot work! How about this:

# Only on install
%post
if [ $1 = 1 ] ; then
    if test -e /etc/init.d/ohmd ; then
        service ohmd stop >/dev/null 2>&1
        chkconfig ohmd off
    fi
    initctl -q start powerd
    initctl -q start olpc-switchd
fi

# Only on uninstall
%preun
if [ $1 = 0 ] ; then
    initctl stop -q olpc-switchd
    initctl stop -q powerd
    if test -e /etc/init.d/ohmd
    then
        /sbin/service ohmd start >/dev/null 2>&1
        /sbin/chkconfig ohmd on
    fi
fi

# Restart after upgrade
%postun
if [ "$1" -ge "1" ] ; then
    initctl stop -q olpc-switchd
    initctl stop -q powerd
    initctl start -q powerd
    initctl start -q olpc-switchd
fi

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Fedora-package-review mailing list
Fedora-package-review@xxxxxxxxxx
http://www.redhat.com/mailman/listinfo/fedora-package-review

[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]