[zypp-devel] media change callback problems
Hi, i think we have two problems with media MediaChangeReport::requestMedia() callback: 1) the callback mixes request for another media from media set (where the media are physically changeable CD/DVD) and request for another URL 2) with the refactored libzypp we have no means to change the URL as we did before. The URL edit box has no effect now in YaST dialogs due to this fact. (zypper didn't have this implemented so far.) This is again because we don't have repositories globally associated with media access, and there is nothing like simple redirect(media, newurl) call now. I guess 1) can be solved easily by splitting the requestMedia() into e.g. requestMediaFromSet() and problem(), where requestMediaFromSet() would be called only for changeable media (after a guess whether the error can be caused by wrong media number) and problem() would be called for all media types on real error (where requestMediaFromSet() did not help). This way the UI can display more appropriate message like "Please, insert media labeled 'openSUSE 10.3' #2 into the drive..." for requestMediaFromSet() and "An error occured: ...." for problem(). But for 2) i don't know. Ideas? BTW: I've made a change to the callback so that it is called for CDs/DVDs only, but thanx to Michael i've realized the problem is a little bit more complex. Should i revert that change for now? It should be reverted at least if we decide not to solve the above problems for now. Cheers, Jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Mon, Jul 30, Jan Kupec wrote:
2) with the refactored libzypp we have no means to change the URL as we did before. The URL edit box has no effect now in YaST dialogs due to this fact. (zypper didn't have this implemented so far.)
This is again because we don't have repositories globally associated with media access, and there is nothing like simple redirect(media, newurl) call now.
As far as I see, the requestMedia callback still has the old signature: virtual Action requestMedia( Repository /*source*/ , unsigned /*mediumNr*/ , Error /*error*/ , const std::string & /*description*/ ); And as we no longer have the Repository available, always Repository::noRepository is passed to the callback. What about removing the now unused Repository argument, and introducing an 'Url & newUrl'? If the returned Action == media::MediaChangeReport::CHANGE_URL, we expect url to contain the new URL to use. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
On Mon, Jul 30, Jan Kupec wrote:
2) with the refactored libzypp we have no means to change the URL as we did before. The URL edit box has no effect now in YaST dialogs due to this fact. (zypper didn't have this implemented so far.)
This is again because we don't have repositories globally associated with media access, and there is nothing like simple redirect(media, newurl) call now.
As far as I see, the requestMedia callback still has the old signature:
virtual Action requestMedia( Repository /*source*/ , unsigned /*mediumNr*/ , Error /*error*/ , const std::string & /*description*/ );
And as we no longer have the Repository available, always Repository::noRepository is passed to the callback.
What about removing the now unused Repository argument, and introducing an 'Url & newUrl'?
If the returned Action == media::MediaChangeReport::CHANGE_URL, we expect url to contain the new URL to use.
Yes, then the MediaSetAccess can reattach the new URL. But this may be not a way to go, since we create MediaSetAccess on several places (with URL read from RepoInfo mostly, if not everywhere), we would get the change request pop-up several times, one time for each MediaSetAccess created and used (repo manipulation and commit at least). j. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Mon, Jul 30, Jan Kupec wrote:
Michael Andres wrote:
On Mon, Jul 30, Jan Kupec wrote:
2) with the refactored libzypp we have no means to change the URL as we did before. The URL edit box has no effect now in YaST dialogs due to this fact. (zypper didn't have this implemented so far.)
This is again because we don't have repositories globally associated with media access, and there is nothing like simple redirect(media, newurl) call now.
As far as I see, the requestMedia callback still has the old signature:
virtual Action requestMedia( Repository /*source*/ , unsigned /*mediumNr*/ , Error /*error*/ , const std::string & /*description*/ );
And as we no longer have the Repository available, always Repository::noRepository is passed to the callback.
What about removing the now unused Repository argument, and introducing an 'Url & newUrl'?
If the returned Action == media::MediaChangeReport::CHANGE_URL, we expect url to contain the new URL to use.
Yes, then the MediaSetAccess can reattach the new URL.
But this may be not a way to go, since we create MediaSetAccess on several places (with URL read from RepoInfo mostly, if not everywhere), we would get the change request pop-up several times, one time for each MediaSetAccess created and used (repo manipulation and commit at least).
Yes, maybe too many pop-ups. If so, this has to be fixed zypp internally. MediaSetAccess has to (somehow) indicate a changed url, and a corresponding RepoInfo has to receive the notification and remember the URL. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres napsal(a): [...]
If the returned Action == media::MediaChangeReport::CHANGE_URL, we expect url to contain the new URL to use. Yes, then the MediaSetAccess can reattach the new URL.
But this may be not a way to go, since we create MediaSetAccess on several places (with URL read from RepoInfo mostly, if not everywhere), we would get the change request pop-up several times, one time for each MediaSetAccess created and used (repo manipulation and commit at least).
Yes, maybe too many pop-ups. If so, this has to be fixed zypp internally.
Pkg-bindings internally remember the redirection URL when the URL is changed. In the next media request for already redirected URL it silently redirects the old URL to the new one (without any user interaction). Maybe that there wouldn't be too much popups... Ladislav -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Dňa Po 30. Júl 2007 15:25 Jan Kupec napísal:
Hi,
i think we have two problems with media MediaChangeReport::requestMedia() callback:
1) the callback mixes request for another media from media set (where the media are physically changeable CD/DVD) and request for another URL
2) with the refactored libzypp we have no means to change the URL as we did before. The URL edit box has no effect now in YaST dialogs due to this fact. (zypper didn't have this implemented so far.)
This is bad from users POV. Our users are used to a fact that if you don't have a CD available, you just enter FTP URL instead :( Stano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (4)
-
Jan Kupec
-
Ladislav Slezak
-
Michael Andres
-
Stanislav Visnovsky