Bugzilla – Bug 115534
Software installation with YaST cannot be stopped
Last modified: 2005-10-05 11:43:07 UTC
I wanted to install the kernel sources, but I forgot that I had setup YaST to use ftp.gwdg.de as install source (I'm on ISDN right now). So when I realized it was downloading the kernel instead of reading the CD I clicked the abort ("Abbrechen") button, but nothing happened. I tried the X at the right top of the window: nothing. I just couldn't stop YaST from downloading, so I had to use the evil CTRL+ALT+ESC to kill it. This is not really the way it is supposed to be. YaST should react when I press a button.
YaST checks abort only at specified time points. It should be possiblt to add checking for Abort being pressed when package manager's callbacks are called. Michael, - how often is download status callback called? Once per percent, or more often? - is it possible to stop downloading current package?
(In reply to comment #1) > - how often is download status callback called? Once per percent, or more > often? Don't know. It's libcurl which internally triggers the progress callback. > - is it possible to stop downloading current package? Currently not. We had to change the progress report to return a bool, and in case of false abort the download. Would not be that hard to do, if needed.
OK, should you first update the code inside package manager, or can I change the signature of the DownloadProgress callback first?
yast2-packagemanager-2.13.2 yast2-pkg-bindings-2.13.0 Changed signature of ProgressProvide and ProgressDownload callbacks. Both are now expected to return YCPBoolean. Iff the callback returns YCPBoolean(FALSE), current download is aborted. Both packages are in STABLE now. TODO in pkg-bindings/src/PkgModuleFunctions.h: The /* TYPEINFO: ...*/ comment for CallbackProgressDownload CallbackProgressProvide still lists 'void(string)'. That way the current Packager callbacks in STABLE should work. If you changed the YCPcallbacks, these comments must probabely be changed to 'boolean(string)', to avoid typechecking errors.
(In reply to comment #4) > TODO in pkg-bindings/src/PkgModuleFunctions.h: > > The /* TYPEINFO: ...*/ comment for > > CallbackProgressDownload > CallbackProgressProvide [...] FORGET IT, it's OK the way it is. These are the functions to set the callback. The signature does not change. Simply change your DownloadProgress callback. Once it returns a YCPBoolean, the return value will be evaluated. Any other type is ignored, and download continues.
Thanks, adapted the callbacks in SVN. Just another problem: If I abort package download, package manager tries to install the package (at least it calls the package installation related callbacks). Could you, please, fix it?
If download is aborted, libcurl reports an error. This error is handed to CB_DoneProvide to inform the user. The next action depends on CB_DoneProvides return value. Per default we'll skip this package. I don't see an attempt to install the package.
Uhh, sorry, I'm wrong. The problem I have is that DoneProvide callback is called, reporting the error (Media cannot provide...). Well, I'm probably supposed to handle it some special way. The other proble is that I need a way to abort all the packages in the list - if I selected two packages (OpenOffice and OpenOffice-QuickStarter) and abort the first one (OpenOffice), package manager attempts to download the second one. I need to abort whole transaction. It seems to me that it is currently handled by the StartPackage callback return value...
Yes, DoneProvide should report something like: CommitProvideCallback::result(PMError, const Pathname&) @ ERROR(Media:User aborted operation.)[Callback aborted] @ /suse/i586/OpenOffice_org-zh-TW.rpm DoneProvide may return one of: PROCEED: // return original error SKIP: // skip current media CANCEL: // cancel all RETRY: // retry ! Return 'CANCEL' and installation should stop immediately.
Thanks, this works.