Bug 115534 - Software installation with YaST cannot be stopped
Summary: Software installation with YaST cannot be stopped
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Beta 4
Hardware: Other All
: P5 - None : Normal
Target Milestone: ---
Assignee: Jiri Srain
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-06 22:44 UTC by Stefan Nordhausen
Modified: 2005-10-05 11:43 UTC (History)
1 user (show)

See Also:
Found By: Other
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 Stefan Nordhausen 2005-09-06 22:44:43 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.
Comment 1 Jiri Srain 2005-09-07 15:54:28 UTC
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? 
Comment 2 Michael Andres 2005-09-12 12:25:45 UTC
(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.
Comment 3 Jiri Srain 2005-10-03 08:21:46 UTC
OK, should you first update the code inside package manager, or can I change 
the signature of the DownloadProgress callback first? 
Comment 4 Michael Andres 2005-10-04 13:43:55 UTC
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.
Comment 5 Michael Andres 2005-10-05 06:45:41 UTC
(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.
Comment 6 Jiri Srain 2005-10-05 09:45:42 UTC
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? 
Comment 7 Michael Andres 2005-10-05 10:51:46 UTC
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.
Comment 8 Jiri Srain 2005-10-05 10:58:53 UTC
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... 
Comment 9 Michael Andres 2005-10-05 11:12:07 UTC
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.
Comment 10 Jiri Srain 2005-10-05 11:43:07 UTC
Thanks, this works.