Mailinglist Archive: opensuse-factory (599 mails)

< Previous Next >
Re: [opensuse-factory] Running a program when launching the SUSE install part
  • From: Pascal Bleser <pascal.bleser@xxxxxxxxx>
  • Date: Mon, 07 Aug 2006 08:12:19 +0200
  • Message-id: <44D6D9C3.3050201@xxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

houghi wrote:
> On Sun, Aug 06, 2006 at 11:15:31PM +0200, Hans-Peter Jansen wrote:
>> Sure, yast could do that by itself, and even on every start, but that
>> would reduce user experience drastically for some setups (My local repo
>> has about 500 packages..)
>
> I notice this more and more that apparently a solution must be workable
> always in any situation. I believe that hinders development more then it
> helps as it, bcause most likely there will always be an exeption.
>
> Yes, some thought needs to go into things. However due to the openness op
> /usr/src/packages/RPMS I do not think it is a good idea anymore.
>
>> Maybe a daemon, based on inotify, that triggers the rebuild everytime
>> the repo changes, would be a smart solution to this problem..
>
> If I would have the knowledge on how to write such a deamon, I would.
> Unfortunatly I am unable to do so. :-(

Actually that should be quite easy to do with a shell script, using
inotify-tools [1] [2]:
- ---8<------------------------------------------------------------
#!/bin/sh
RPMDIRS=/usr/src/packages/RPMS/*
REPODIR=/usr/src/packages/RPMS
CACHEDIR=/usr/src/packages/RPMS/.cache

inotifywait -m -eclose $RPMDIRS | while read event; do
createrepo -q --cachedir="$CACHEDIR" "$REPODIR" >/dev/null
done
- ---8<------------------------------------------------------------

Would just need to make it somewhat smarter and only run createrepo if
there hasn't been any write after a given amount of seconds (or
minutes), because if rpmbuild creates several RPMS, it will trigger
createrepo immediately although rpmbuild isn't finished with writing all
of them.

[1] http://inotify-tools.sourceforge.net/
[2] SUSE RPMs available in my repo:
http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=System/inotify-tools
(2.2 is built and underway)

>> I've a patch pending to createrepo to speed this up considerably again,
>> if the repo didn't change between invocations.

What is that patch doing ? :)

Also, consider using createrepo --cache

cheers
- --
-o) Pascal Bleser http://linux01.gwdg.de/~pbleser/
/\\ <pascal.bleser@xxxxxxxxx> <guru@xxxxxxxxxxx>
_\_v The more things change, the more they stay insane.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE1tnDr3NMWliFcXcRAtkVAJ950AaSSHemk5MWLG1P1eiv8Gm4jgCfZ2Su
YbvQ4KmiuACnVugcsmsGWIA=
=dTyi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-factory-unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-factory-help@xxxxxxxxxxxx


< Previous Next >