Hallo.

I have been thinking about getting rid many of SuSEconfig scripts and
making scriptlets more effective (call them once per transaction instead
of four times per package).

Because modification of RPM seems to be not acceptable, I tried to find
a solution, which will work with unmodified RPM:

Create a new daemon, running by default: triggerd

triggerd can be an inotify based software and will have a configuration
in /etc/trigger.d/. Each file there will contain a list of paths.
If anything in specified path will change, script with the same name
will be started with arguments saying, which directory (and maybe which
file) have been changed.

Specified path can be file, directory or recursive directory search.
There will be a special flag (file), which will block/postpone the
script calling.

Paths:
/etc/trigger.d/*: Configuration files.
/usr/lib/trigger/*: Trigger scripts.
/var/lib/triggerd/postpone/*: Postpone flags. Postpone calling of
  scripts until file here disappears.

This daemon can obsolete many SuSEconfig scripts and even make
scriptlets run faster - for example ldconfig:

/etc/trigger.d/ldconfig:
Symlink to /etc/ld.co.conf

/usr/lib/trigger/ldconfig:
Probably symlink to /sbin/ldconfig

%pre
touch var/lib/triggerd/postpone/ldconfig

%preun
touch var/lib/triggerd/postpone/ldconfig

%posttrans
if !.....zypp_is_running... ; then
rm var/lib/triggerd/postpone/ldconfig
fi

In zypp:
After completing of "transaction":
rm var/lib/triggerd/postpone/ldconfig

Transaction stuff in zypp / yast is not yet connected with RPM, so this
is a work-around.

RPM %posttrans will detect, that YaST/zypp is running, and will not
delete postpone flag. zypp will delete it, when it will reach end of the
"transaction" (i. e. if PreReq of next package has to be resolved or
package list is complete).

This implementation can replace all ocurrences of ldconfig except calls
in "self prerequiring" scriptlets - scriptlets, which require working
binaries from the same package.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [EMAIL PROTECTED]
Lihovarská 1060/12                            tel: +420 284 028 966
190 00 Praha 9                                fax: +420 284 028 951
Czech Republic                                http://www.suse.cz/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to