Running a program when launching the SUSE install part

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Running a program when launching the SUSE install part

houghi
How can I do the following:

Each time I run `yast, Software, Software Management` that I first run
`createrepo /usr/src/packages/RPMS` so I don't forget to include extra
files I downloaded.

Would this be something usefull to ask for to be done by default?
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

jdd@dodin.org
houghi a écrit :
> How can I do the following:
>
> Each time I run `yast, Software, Software Management` that I first run
> `createrepo /usr/src/packages/RPMS` so I don't forget to include extra
> files I downloaded.
>
> Would this be something usefull to ask for to be done by default?

use the CLI yast (the syntax must be somewhere in the wiki)
and make a small script with createrepo before?

jdd

--
http://www.dodin.net
http://dodin.org/galerie_photo_web/expo/index.html
http://lucien.dodin.net
http://fr.susewiki.org/index.php?title=Gérer_ses_photos

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
In reply to this post by houghi
Hi,

houghi schrieb:
> How can I do the following:
>
> Each time I run `yast, Software, Software Management` that I first run
> `createrepo /usr/src/packages/RPMS` so I don't forget to include extra
> files I downloaded.

You shouldn't have to do it at all, YaST should be able to do it for you.

ZenWorks is able to do it (rug mount), so YaST should offer this
functionality as well. And the implementation should of course be shared
 between both as much as possible.

So this is really an enhancement request, and actually I think it's
already filed as such in Bugzilla.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
Andreas Hanke schrieb:
>> Each time I run `yast, Software, Software Management` that I first run
>> `createrepo /usr/src/packages/RPMS` so I don't forget to include extra
>> files I downloaded.
>
> You shouldn't have to do it at all, YaST should be able to do it for you.

With "it" I mean including RPMs from a local directory without manual
intervention. A local directory with just naked RPMs in it should be a
valid (and working) type of installation source.

Your "run createrepo" proposal is a workaround for a missing feature.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

Pascal Bleser
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Hanke wrote:
> Andreas Hanke schrieb:
>>> Each time I run `yast, Software, Software Management` that I first run
>>> `createrepo /usr/src/packages/RPMS` so I don't forget to include extra
>>> files I downloaded.
>> You shouldn't have to do it at all, YaST should be able to do it for you.
>
> With "it" I mean including RPMs from a local directory without manual
> intervention. A local directory with just naked RPMs in it should be a
> valid (and working) type of installation source.

I don't agree.
If you just have the RPMs and no repository metadata, YaST must scan all
the .rpm files in that directory and extract that metadata (RPM header
information).

createrepo does the same, but the difference is: createrepo also stores
that data ;)

Also, createrepo can use a cache, so it will only fetch RPM headers from
files that are newer than their entry in the cache.

That's more efficient, and reduces the startup time of YaST (if such a
feature is added to YaST).

> Your "run createrepo" proposal is a workaround for a missing feature.

I don't think so. createrepo is the appropriate tool to manage a repository.

I don't know whether zypp is currently capable of using a "naked"
directory of RPMs as an installation source. If it doesn't, I think that
just using createrepo is a better solution than adding more complexity
to zypp.

cheers
- --
  -o) Pascal Bleser     http://linux01.gwdg.de/~pbleser/
  /\\ <[hidden email]>       <[hidden email]>
 _\_v The more things change, the more they stay insane.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE1dIjr3NMWliFcXcRAn5uAKC7arY+ooRAjT4TbZ81gHBS8tEQYwCghG/t
m1zbcgc06qCmeKAF9jnaVLg=
=S7Mb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
In reply to this post by jdd@dodin.org
On Sun, Aug 06, 2006 at 11:42:09AM +0200, jdd wrote:

> houghi a écrit :
> >How can I do the following:
> >
> >Each time I run `yast, Software, Software Management` that I first run
> >`createrepo /usr/src/packages/RPMS` so I don't forget to include extra
> >files I downloaded.
> >
> >Would this be something usefull to ask for to be done by default?
>
> use the CLI yast (the syntax must be somewhere in the wiki)
> and make a small script with createrepo before?

I don't want to use the CLI or at least don't want to be limited to it.

I believe it must be possible to have it run when
/usr/share/YaST2/clients/sw_single.ycp is called. I just can't figure out
how to do it.
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
In reply to this post by Pascal Bleser
Hi,

Pascal Bleser schrieb:

> I don't agree.
> If you just have the RPMs and no repository metadata, YaST must scan all
> the .rpm files in that directory and extract that metadata (RPM header
> information).
>
> createrepo does the same, but the difference is: createrepo also stores
> that data ;)
>
> Also, createrepo can use a cache, so it will only fetch RPM headers from
> files that are newer than their entry in the cache.
>
> That's more efficient, and reduces the startup time of YaST (if such a
> feature is added to YaST).

OK so far, but:

- The ZenWorks tools (rug, zen-updater) already have this feature;

- smart has this feature and it really works (fast);

- there is demand for this feature;

- YaST had something similar (something between "naked" directories and
"real" repositories) before zypp via genIS_PLAINcache, so not having it
is actually a regression;

- Not having this feature blocks Bug 167611, a showstopper (Don't say
people shouldn't install RPMs from the file manager - yes, there are
more efficient ways to install software than downloading individual
RPMs, but I know 2 people personally and many, many ones from the web
that switched away from SUSE 10.1 because of not being able to do that).

> I don't think so. createrepo is the appropriate tool to manage a repository.

Yes, it is, but why should it be the only one?

> I don't know whether zypp is currently capable of using a "naked"
> directory of RPMs as an installation source. If it doesn't, I think that
> just using createrepo is a better solution than adding more complexity
> to zypp.

How do the ZenWorks tools do it at the moment? The functionality seems
to be already implemented "somewhere", I just don't know where. It
should be moved, if possible, to a place where it can be shared between
YaST and ZenWorks, i.e. zypp.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
In reply to this post by Pascal Bleser
On Sun, Aug 06, 2006 at 01:27:31PM +0200, Pascal Bleser wrote:
<snip reasons>
> That's more efficient, and reduces the startup time of YaST (if such a
> feature is added to YaST).

Yes, that would be the best of both worlds. So anybody have the bugnumber?
Otherwise I open a new feature request with the createrepo solution in it.
 
> > Your "run createrepo" proposal is a workaround for a missing feature.
>
> I don't think so. createrepo is the appropriate tool to manage a repository.
>
> I don't know whether zypp is currently capable of using a "naked"
> directory of RPMs as an installation source. If it doesn't, I think that
> just using createrepo is a better solution than adding more complexity
> to zypp.

I don't use zypp. I am an old fashioned YaST users. Have been using
createrepo since I leared about it. Can't get much easier then using that
program. :-)

In the meantime, how could I edit /usr/share/YaST2/clients/sw_single.ycp
(At least I asume that is the file I must edit) to run createrepo when
called?
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
In reply to this post by andreas.hanke
On Sun, Aug 06, 2006 at 01:50:14PM +0200, Andreas Hanke wrote:
> - Not having this feature blocks Bug 167611, a showstopper (Don't say
> people shouldn't install RPMs from the file manager - yes, there are
> more efficient ways to install software than downloading individual
> RPMs, but I know 2 people personally and many, many ones from the web
> that switched away from SUSE 10.1 because of not being able to do that).

Download? I have several RPMs that you could not download. Downloaded the
source and use checkinstall to make the RPM. (I don't distribute them and
they work for me, so don't laugh.)

I also asume that the 'better way' is to use a repository. And that is
just what createrepo does. It makes a repo for you. :-)

Concerning the bug, should I add createrepo solution to that bug, or to
174369? The createrepo solution is not identical to downloading an RPM and
installing that.

That could perhaps be solved by running `rpm -Uvh file.rpm`. Unfortunatly
rpm is already linked to real, but it should not be too hard to change
that.

Or have it as a left click and run `rpm -Uvh ...rpm`. If you want it done
by YaST, a wget to /tmp and then `yast -i /tmp/file.rpm` should sove that
as yast can't deal with http or ftp.

--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
Hi,

houghi schrieb:
> Download? I have several RPMs that you could not download. Downloaded the
> source and use checkinstall to make the RPM. (I don't distribute them and
> they work for me, so don't laugh.)

houghi, these were just generic comments I made because they are
somewhat related.

What you are asking for is how to run createrepo, but what you really
want to do is installing packages from a local directory, hence my
comments about installing RPMs from a local directory in general.

> I also asume that the 'better way' is to use a repository. And that is
> just what createrepo does. It makes a repo for you. :-)

Yes and no. A repository is surely a cool thing, but should't be the
only way to install packages from a local directory.

> Concerning the bug, should I add createrepo solution to that bug, or to
> 174369? The createrepo solution is not identical to downloading an RPM and
> installing that.

createrepo is not a solution at all IMHO. Using createrepo for such a
basic functionality as installing packages from local directories
doesn't sound like a good idea to me because it means making
kdebase3-SuSE (and hence KDE) depend on a development tool (createrepo
is a development tool in my eyes).

> That could perhaps be solved by running `rpm -Uvh file.rpm`. Unfortunatly
> rpm is already linked to real, but it should not be too hard to change
> that.
>
> Or have it as a left click and run `rpm -Uvh ...rpm`. If you want it done
> by YaST, a wget to /tmp and then `yast -i /tmp/file.rpm` should sove that
> as yast can't deal with http or ftp.

/bin/rpm doesn't resolve dependencies, we are talking about installation
of local packages with depencency resolution.

Regarding your specific proposal of somehow integrating createrepo into
the YaST GUI: Well, if there is no other solution going to be in place
for 10.2, doing that might be better than not doing anything because
installing RPMs from local directories is a desperately needed feature.
But the approach looks strange. Actually I proposed it myself some time
ago, but I don't like it.

As a quick hack for now, you can create a shell script like this:

#!/bin/sh
createrepo /usr/src/packages/RPMS
/sbin/yast2 sw_single

And then change /usr/share/applications/YaST2/sw_single.desktop to have

Exec=/path/to/the/script/above

instead of

Exec=/sbin/yast2 sw_single

By the way, using a directory like /usr/src/packages/RPMS which is world
writable by default as an installation source is not secure. Consider
defining %_topdir to something else in your ~/.rpmmacros file.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
In reply to this post by houghi
Hi,

houghi schrieb:
> I don't use zypp. I am an old fashioned YaST users.

If you're using YaST, you're using zypp.

> In the meantime, how could I edit /usr/share/YaST2/clients/sw_single.ycp

Leave sw_single.ycp alone, and do the hack in sw_single.desktop.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
In reply to this post by andreas.hanke
On Sun, Aug 06, 2006 at 03:05:00PM +0200, Andreas Hanke wrote:
> > Or have it as a left click and run `rpm -Uvh ...rpm`. If you want it done
> > by YaST, a wget to /tmp and then `yast -i /tmp/file.rpm` should sove that
> > as yast can't deal with http or ftp.
>
> /bin/rpm doesn't resolve dependencies, we are talking about installation
> of local packages with depencency resolution.

Would `yast -i /tmp/file.rpm` solve that? I asume only after a createrepo
(or something similar)
 
> Regarding your specific proposal of somehow integrating createrepo into
> the YaST GUI: Well, if there is no other solution going to be in place
> for 10.2, doing that might be better than not doing anything because
> installing RPMs from local directories is a desperately needed feature.
> But the approach looks strange. Actually I proposed it myself some time
> ago, but I don't like it.

I don't think there will be a complete solution ever. If a person
downloads an RPM and want to install it, it will always hapen that he did
not download all of the rpms's that he needed to. The reason for that can
be various and is unimportand for this discussion.

> As a quick hack for now, you can create a shell script like this:
>
> #!/bin/sh
> createrepo /usr/src/packages/RPMS
> /sbin/yast2 sw_single
>
> And then change /usr/share/applications/YaST2/sw_single.desktop to have
>
> Exec=/path/to/the/script/above
>
> instead of
>
> Exec=/sbin/yast2 sw_single

Thanks. Didn't think it was that easy or that file. :-)

> By the way, using a directory like /usr/src/packages/RPMS which is world
> writable by default as an installation source is not secure. Consider
> defining %_topdir to something else in your ~/.rpmmacros file.

I don't use ~/.rpmmacros. Most of the time I just download the RPMs or
make them with checkinstall. The only RPM I really make is makeSUSEdvd.

About /usr/src/packages/RPMS being writable by default. That is indeed a
much more serious issue. You can not then use that as a default. Is there
a reason that it is writabel for all?
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
On Sun, Aug 06, 2006 at 07:00:42PM +0200, houghi wrote:

> > As a quick hack for now, you can create a shell script like this:
> >
> > #!/bin/sh
> > createrepo /usr/src/packages/RPMS
> > /sbin/yast2 sw_single
> >
> > And then change /usr/share/applications/YaST2/sw_single.desktop to have
> >
> > Exec=/path/to/the/script/above
> >
> > instead of
> >
> > Exec=/sbin/yast2 sw_single
>
> Thanks. Didn't think it was that easy or that file. :-)

Does not seem to work. :-(

First I delete the repodata, so I am sure that it is created.
When I click on 'Software Management' it does not seem to run the script I
placed at Exec. It launches the

When I directly run the script /usr/local/sbin/REPO_YAST it works as
expected. So the only thing I can conclude is that sw_single.desktop is
not the correct file to edit.

To be sure, I made tried the following:
Exec=/opt/gnome/bin/zenity --calendar

Still the Software Management popped up.
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
In reply to this post by houghi
Hi,

houghi schrieb:
> Would `yast -i /tmp/file.rpm` solve that? I asume only after a createrepo
> (or something similar)

No, "yast -i filename.rpm" is equivalent to "rpm -U --nodeps --force
filename.rpm".

"createrepo" followed by "yast -i packagename" would work, but it's
insecure (YaST could install the wrong package if a different
installation source contains a newer version of the same package -
remember that newer is not always better).

Side note: The current, broken situation in 10.1 is even more insecure
because it can install an _old_ version if that incidentally exists in
one of the working installation sources.

> About /usr/src/packages/RPMS being writable by default. That is indeed a
> much more serious issue. You can not then use that as a default. Is there
> a reason that it is writabel for all?

The permissions of /usr/src/packages are handled by the permissions
system, i.e. /etc/permissions.*. You can change the permissions settings
in /etc/sysconfig/security. Run "SuSEconfig --module permissions"
afterwards.

I don't know whether this default is really a security problem, but
making it writable by root only means that only root can build RPMs
unless the user sets %_topdir in his ~/.rpmmacros file.

Changing that would doing things like creating ATI driver RPMs a tiny
little bit longer because the user would have to perform one additional
step (create ~/.rpmmacros or, much worse, do it as root). Not a severe
problem, but it would have to be documented.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

andreas.hanke
In reply to this post by houghi
Hi,

houghi schrieb:
> So the only thing I can conclude is that sw_single.desktop is
> not the correct file to edit.

It's the correct file to edit, but the wrong place in this file and I
don't know which place in this file is the right one. :-(

YaST doesn't seem to use the Exec= line, it seems to create the yast2
invocation from the X-SuSE-YaST-Call= line. No idea how to edit that
correctly.

Is it possible to invoke a YaST module from another YaST module? If so,
you could create a new module that calls createrepo and afterwards the
sw_single module.

Alternatively, use "rug mount" and afterwards zen-installer. This will
work, but I don't know if you like zen-installer's UI. It is very limited.

Andreas Hanke

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
In reply to this post by andreas.hanke
On Sun, Aug 06, 2006 at 07:26:33PM +0200, Andreas Hanke wrote:
> I don't know whether this default is really a security problem, but
> making it writable by root only means that only root can build RPMs
> unless the user sets %_topdir in his ~/.rpmmacros file.

I would think that this could be a security problem if used together with
createrepo. (This goes for any writable directory where you run createrepo
on)

e.g.
1) Make a makeSUSEdvd rpm and give it a version of 0.99
2) Wait till the new version 0.35 is out and ask the admin to install that
RPM
3) He downloads the RPM and installs it with YaST. Most likely not looking
what version he is installing. YaST will (re-)install the latest version.

Whatever you put in that RPM is now installed. So you must see that the
directories you add as an installation source can't be compromised.

I am the only user, so no real danger, but on a multi-user system this can
be an issue, so adding /usr/src/packages/RPMS by default is not an option,
I think.
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

Hans-Peter Jansen-2
In reply to this post by andreas.hanke
Am Sonntag, 6. August 2006 15:05 schrieb Andreas Hanke:
>
> createrepo is not a solution at all IMHO. Using createrepo for such a
> basic functionality as installing packages from local directories
> doesn't sound like a good idea to me because it means making
> kdebase3-SuSE (and hence KDE) depend on a development tool
> (createrepo is a development tool in my eyes).

Hm, it's more a matter of organization. Note that you run a tool like
createrepo once after modification of a repo, and it's going to be
usable for all your systems. (computers tend to breed nowadays)

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..)

Maybe a daemon, based on inotify, that triggers the rebuild everytime
the repo changes, would be a smart solution to this problem..

> Regarding your specific proposal of somehow integrating createrepo
> into the YaST GUI: Well, if there is no other solution going to be in
> place for 10.2, doing that might be better than not doing anything
> because installing RPMs from local directories is a desperately
> needed feature. But the approach looks strange. Actually I proposed
> it myself some time ago, but I don't like it.
>
> As a quick hack for now, you can create a shell script like this:
>
> #!/bin/sh
> createrepo /usr/src/packages/RPMS
> /sbin/yast2 sw_single

Please check the -c option, e.g. createrepo -qc repocache ..

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

Just ask..

Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

houghi
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. :-(

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

Why is it pending?

--
>>>> Run the following from the bashprompt if you have the kernel sources
for I in `find /usr/src/linux/ -name *.c`; \
do A=`grep -i -A 1 -B 1 fuck $I`;if [ "$A" != "" ]; \
then printf "$I \n$A \n\n"; fi ;done|less

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

Pascal Bleser
-----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/
  /\\ <[hidden email]>       <[hidden email]>
 _\_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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Running a program when launching the SUSE install part

Pascal Bleser
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pascal Bleser wrote:

> 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)

Or using this Python module:
http://pyinotify.sourceforge.net/

RPM will be here in a few hours:
http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=Libraries/python-pyinotify

- --
  -o) Pascal Bleser     http://linux01.gwdg.de/~pbleser/
  /\\ <[hidden email]>       <[hidden email]>
 _\_v The more things change, the more they stay insane.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE1trZr3NMWliFcXcRAtqBAKCLdT6kmuRXo4CTmjAZj5CELlN1CgCgmw04
zBC6tj48BdYlj7XASv/gfug=
=MgUw
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12