Bug 345425 - repository refreshing and opensue updater
Summary: repository refreshing and opensue updater
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 10.3
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Final
Hardware: Other Other
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Thomas Göttlicher
QA Contact: Jiri Srain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-01 16:11 UTC by Caleb Cushing
Modified: 2008-04-25 09:31 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Cushing 2007-12-01 16:11:37 UTC
this is semi related to bug 344633 and 344637 I've had to disable the repositories from refreshing automagically every time I try to do something, because I don't have a constant internet connection and even if I did it's annoying that they are refreshing every time I try to do something.

I'd like a setting that tells only opensuse updater to refresh them (this assumes it refreshes them all, I know it doesn't check all repos for updates, or something).

instead the updater relies on whether I have auto-refresh enabled. since I don't it has become useless cruft.

1 possible solution would be to add a setting next to auto-refresh to update with opensuse updater.
Comment 1 Cyril Hrubis 2007-12-06 13:44:25 UTC
Assuming from bug #345424 you are using KDE version.
Comment 2 Thomas Göttlicher 2007-12-06 14:11:38 UTC
Jano, is there any chance to add a refresh command to zypper's xml input we've discussed some weeks ago? In this case opensuseupdater could send a refresh command every time it runs zypper because opensuseupdater would run only if network is available.
Comment 3 Jan Kupec 2007-12-09 12:16:02 UTC
I'm not sure i understand, do you mean xml _output_ perhaps? Because i see no problem with invoking zypper refresh <repo> even now except the output. Yes, it seems i have to work on it ASAP, since you guys depend on it too much :O)
Comment 4 Thomas Göttlicher 2007-12-10 09:49:04 UTC
(In reply to comment #3 from Jan Kupec)
> I'm not sure i understand, do you mean xml _output_ perhaps? Because i see no
> problem with invoking zypper refresh <repo> even now except the output.
Please excuse my unclear question.
I mean some mechanism within the xml to tell zypper to refresh its repos before it starts an operation like checking for patches when autorefresh is disabled:

 (ugly xml-like syntax)

 <refresh/>
 <checkpatches/>
 <checkupdates/>

> Yes, it seems i have to work on it ASAP, since you guys depend on it 
> too much :O)
That would be great but it isn't that urgent. I would like to add the xml-in/out mechanism to the updater for the alpha version. Don't hurry.
Comment 5 Jan Kupec 2008-03-27 10:20:37 UTC
(In reply to comment #4 from Thomas Goettlicher)
> (In reply to comment #3 from Jan Kupec)
> > I'm not sure i understand, do you mean xml _output_ perhaps? Because i see no
> > problem with invoking zypper refresh <repo> even now except the output.
> Please excuse my unclear question.
> I mean some mechanism within the xml to tell zypper to refresh its repos before
> it starts an operation like checking for patches when autorefresh is disabled:
> 
>  (ugly xml-like syntax)
> 
>  <refresh/>
>  <checkpatches/>
>  <checkupdates/>

I still don't understand why not simply executing zypper refresh before checking for updates. You can also do it per repo (refresh only the update repos).
Comment 7 Thomas Göttlicher 2008-03-27 10:44:25 UTC
(In reply to comment #5 from Ján Kupec)
> I still don't understand why not simply executing zypper refresh before
> checking for updates. You can also do it per repo (refresh only the update
> repos).
As we decided not to use checkpatches-wrapper anymore, checking for patches runs with user privileges but "zypper refresh" needs root privileges. How can I refresh the update repo without annoying the user with a password prompt?
Comment 8 Jan Kupec 2008-03-27 11:01:15 UTC
I meant to drop zypp-check-patches (since we don't need the code anymore as zypper --xmlout provides it), not the suid wrapper.

If we need the suid wrapper, let's just use it. Allright, we can rename it to zypper-wrapper or something similar now. We can also make it a general wrapper for all zypper commands (passing all the arguments) if that makes sense to anyone or to stick with just refreshing (and checking updates?).
Comment 9 Jan Kupec 2008-03-27 11:12:35 UTC
(In reply to comment #8 from Ján Kupec)
> We can also make it a general wrapper
> for all zypper commands (passing all the arguments) if that makes sense to

Ehm. Please forget i ever said this part :O)

Comment 10 Thomas Göttlicher 2008-03-27 11:18:01 UTC
(In reply to comment #8 from Ján Kupec)
> I meant to drop zypp-check-patches (since we don't need the code anymore as
> zypper --xmlout provides it), not the suid wrapper.
Ok, it's clear to me, now.

(In reply to comment #9 from Ján Kupec)
> Ehm. Please forget i ever said this part :O)
Done. I can't remember anything. :-)
Comment 11 Thomas Göttlicher 2008-03-27 12:51:27 UTC
I can think of three different ways how to run a refresh before checking for patches:

i)
The updater applets call a zypper-refresh-wrapper before checking for patches.
This would mean to add another suid-root wrapper and to duplicate code in each applet for calling two programs for one action.

ii)
Writing a wrapper for the wrappers: A refresh-and-check-wrapper that calls a suid-root'ed zypper-refresh-wrapper and after that checks for pachtes.
Writing a wrapper for a wrapper isn't really nice.

iii)
Adding a refresh before checking for patches in zypper. Perhaps as a option of 
the xml-updates command or even hard-wired.

I would prefer iii.
Jano, can you think of a better way?
Comment 12 Jan Kupec 2008-03-27 13:48:26 UTC
Only the refresh command requires root access. What about having zypper-refresh-wrapper only and run the query commands (list-updates, patches, search, info) as user.

BTW: please try to use zypper --xmlout -t package -t patch instead of xml-updates, it should do just that now. I'd like to drop the xml-updates command.
Comment 13 Jan Kupec 2008-03-27 13:49:19 UTC
(In reply to comment #12 from Ján Kupec)
> BTW: please try to use zypper --xmlout -t package -t patch instead of
> xml-updates, it should do just that now. I'd like to drop the xml-updates
> command.

i mean zypper --xmlout list-updates -t package -t patch :O)
Comment 14 Thomas Göttlicher 2008-03-27 15:45:30 UTC
(In reply to comment #12 from Ján Kupec)
>  What about having zypper-refresh-wrapper only and run the query commands
> (list-updates, patches, search, info) as user.
That would mean having a shell script 'zypper-refresh-and-check' with the following two calls: 
 /usr/sbin/zypper-refresh-wrapper
 /usr/bin/zypper --xmlout list-updates -t package -t patch 

Yes, I guess it might work but I think it isn't the cleanest solution.
- This would add another not really needed zypper helper script.
- Getting concatenated snippets of xml might confuse the applets (particularly opensuseupdater-gnome, as its xml parser isn't very tolerant)

I'd prefer the functionality embedded into zypper because 'refresh' and 'list-updates' belongs together. Is there any cause not to add this to zypper?
Comment 15 Thomas Göttlicher 2008-04-25 09:31:05 UTC
Fixed in opensuseupdater-kde4. Version will be 0.7.5.