Am Montag, 7. August 2006 08:12 schrieb Pascal Bleser:
houghi wrote:
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.
No, using /usr/src/packages/RPMS directly is a pretty bad idea, building packages as root either, thus there's no way around build stuff as user and moving it to repo as root, AFAICT.
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<------------------------------------------------------------
Very cool, Pascal.
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.
Yes, that would be necessary. Will look into this as soon as I've upgraded the kernel on my repo server (still running 9.3, hoping the best for 10.2..), but this is planned anyway for several reasons.
[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 ? :)
Compare the ctime of the rpms with that of the repo meta data. See: https://lists.dulug.duke.edu/pipermail/rpm-metadata/2006-July/000663.html for a patch to createrepo-0.4.4 (the changelog patch will not apply, but you can ignore that..) Unfortunately, Seth Vidal and Paul Nasrat aren't the fastest guys on the planet when it comes to _bug fixes_ from externals. Now imagine, how they handle enhancement patches.. The checkts option has one well known downside ATM: it doesn't handle the situation, when only packages got removed. Will add ctime check of the directory as well, but that leads to spurious runs on rsynced repos..
Also, consider using createrepo --cache
Ahem, you meant --cachedir. That's what the -c option is doing as well, but you're right, better use long options on ML discussions.. Pete --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-factory-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory-help@opensuse.org