tech-userlevel archive

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

Re: Better provisions for binary package updates

>> If pkg_add is called with the -u option, the install script will be
>> called with the additional argument REPLACE.  This allows the script
>> to perform whatever is needed for an update while retaining backwards
>> compatability (install scripts that are not update aware will behave
>> like before).
> (probably belongs on tech-pkg)
> I see your point, but how different is
>  replace
> vs
>  remove, pause, add
> in terms of the desired end state?

Well, the idea just to pass down the -u flag to the script, not to re-engineer 
the whole thing (although that would be a nice goal one day).  And then, this 
is only done in pkg_add, which is not used for removal of packages.

> In other words, maybe the replace action is really about config file
> merging, which is about if there is an old one.

Not sure if it is wise to touch configuration files during an update.  Maybe 
only if it is unchanged?

> Also, I would like replace do do a /etc/rc.d/foo restart iff the service
> is running.

I thing it is absolutely up to the 'install' script to do the right thing when 
it sees the REPLACE flag.  And yes, for a daemon I'd say that should include 
stopping it (if it is running) and starting it after the update (if it was 

Home | Main Index | Thread Index | Old Index