home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
root
/
usr
/
share
/
YaST2
/
clients
/
add-on.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
108 lines
/**
* File: clients/add-on.ycp
* Package: yast2-installation
* Summary: Install an add-on product
* Authors: Jiri Srain <jsrain@suse.de>
*
*/
{
textdomain "installation";
import "AddOnProduct";
import "Confirm";
import "PackageLock";
import "PackageCallbacksInit";
import "Report";
import "Wizard";
import "Pkg";
include "installation/add-on-workflow.ycp";
Wizard::CreateDialog();
Wizard::SetContents (
// dialog caption
_("Add-On Product Media"),
// busy message (dialog)
`VBox(`Label(_("Initializing..."))),
// help
_("<p>Initializing add-on products...</p>"),
false,
true
);
Wizard::SetDesktopIcon("vendor");
Wizard::HideBackButton();
Wizard::DisableAbortButton();
Wizard::DisableNextButton();
// --> Initialization start
// check whether running as root
// and having the packager for ourselves
if (! Confirm::MustBeRoot () || ! PackageLock::Check ())
{
UI::CloseDialog ();
return `abort;
}
// initialize target to import all trusted keys (#165849)
Pkg::TargetInit( "/", false );
PackageCallbacksInit::InitPackageCallbacks ();
// Initialize current sources
Read();
symbol ret = nil;
// <-- Initialization finish
Wizard::EnableAbortButton();
Wizard::EnableNextButton();
if (size (WFM::Args()) == 0)
{
y2milestone ("Url not specified in the command line, asking user");
ret = RunWizard();
}
else
{
string url = (string)WFM::Args(0);
y2milestone ("Specified URL %1", url);
do {
createResult = SourceManager::createSource (url);
y2milestone ("Source creating result: %1", createResult);
} while ( createResult == `again );
AddOnProduct::last_ret = `next;
ret = RunAutorunWizard ();
}
if (ret == `next)
{
// feedback heading
string heading = _("Add-On Product Installation");
// feedback message
string message
= _("Reading packages available on the installation sources...");
Popup::ShowFeedback (heading, message);
y2milestone ("syncing srcid %1 to zmd", AddOnProduct::src_id);
boolean synced
= SourceManager::SyncAddedAndDeleted ([AddOnProduct::src_id], []);
y2milestone ("sync status: %1", synced);
Popup::ClearFeedback ();
WFM::CallFunction ("inst_addon_update_sources", []);
ret = AddOnProduct::DoInstall ();
// Write only when there are some changes
Write();
}
UI::CloseDialog();
return ret;
/* EOF */
}