[pacman-dev] add message() function call for use in *.install/.PKGINFO files

VMiklos vmiklos at frugalware.org
Fri Jul 7 06:11:34 EDT 2006


On Wed, May 31, 2006 at 12:35:20PM +0300, ????? ??????? <roman.kyrylych at gmail.com> wrote:
> > currently it is exam perion here, after it is over i'll try to implement
> > it and came up with a patch - it's easier to comment if there's already
> > an implementation
> Thanks! :)

http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=pacman;a=plain_commitdiff;h=20060707003531-e2957-5cce4f0e37fe47c9919bd695097abeec84ef335e.gz;

this actually means that libalpm parses the printed lines:
PM_TRANS_EVT_SCRIPTLET_INFO: normal/old messages
PM_TRANS_EVT_SCRIPTLET_START: a progress started, can be triggered by
echo "START <event desc>"
PM_TRANS_EVT_SCRIPTLET_DONE: a progress ended with a status code, can be
triggered by
echo "DONE <retcode>"

an example new scriptlet:

post_upgrade()
{
      echo "START this will be good"
      echo "DONE 0"
      echo "START this will fail"
      echo "DONE 1"
      echo "old message"
}

op=$1
shift
$op $*

the output:

$ sudo pacman -U cabextract-1.1-2-i686.fpm
loading package data... done.
checking dependencies... done.
checking for file conflicts... done.
(1/1) upgrading cabextract                        [################]
100%
this will be good... done.
this will fail... failed.
old message

the change should be fully backward-compatible since all the old
messages are
now PM_TRANS_EVT_SCRIPTLET_INFO ones

the real changes are in libalpm/util.c|pacman/trans.c where the new
events are generated|handled

comments?

udv / greetings,
VMiklos

-- 
Developer of Frugalware Linux, to make things frugal - http://frugalware.org




More information about the pacman-dev mailing list